/[smecontribs]/rpms/smeserver-mediawiki/contribs10/smeserver-mediawiki.spec
ViewVC logotype

Contents of /rpms/smeserver-mediawiki/contribs10/smeserver-mediawiki.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.13 - (show annotations) (download)
Tue Jul 12 11:47:01 2022 UTC (2 years, 3 months ago) by brianr
Branch: MAIN
Changes since 1.12: +2 -2 lines
* Tue Jul 12 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.2-1.sme
- Update version to Mediawiki-1.38.2 [sme: 11987]
- Fix initial admin user

1 # $Id: smeserver-mediawiki.spec,v 1.12 2022/07/12 11:29:51 brianr Exp $
2 # Authority: ber_die
3 # Name: Dietmar Berteld
4
5 %define name smeserver-mediawiki
6 %define version 1.38.2
7 %define release 1
8
9 Summary: Mediawiki Web Application for SME Server 7.x based on Mediawiki 1.38.0
10 Name: %{name}
11 Version: %{version}
12 Release: %{release}%{?dist}
13 License: GPL
14 Group: /Web/Applications
15 Source: %{name}-%{version}.tar.gz
16
17 #Patch0: smeserver-mediawiki-1.38.1-Fix-sql-create.patch
18 #Patch0: smeserver-mediawiki-1.37.2-Fix-up-password-generation-and-localsettings.patch
19 #Patch1: smeserver-mediawiki-1.6.10-Update-to-SME10.patch
20
21 URL: http://mediawiki.org/
22 BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
23 BuildArch: noarch
24 Requires: e-smith-base, e-smith-release >= 10
25 BuildRequires: e-smith-devtools
26
27 %description
28 This RPM is an addon for the SME Server v10
29 The target audience is the Linux/E-smith administrator
30 who wants to add Wikipedia-SW.
31 Mediawiki is a very popular Wiki and is used by the wikipedia-project.
32 After installation open your webbrowser your local site
33 http://your_e-smith-server_adress/wiki
34
35 %changelog
36 * Tue Jul 12 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.2-1.sme
37 - Update version to Mediawiki-1.38.2 [sme: 11987]
38 - Fix initial admin user
39
40 * Thu Jun 09 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.1-2.sme
41 - fix sql user create [SME: 11987]
42
43 * Wed Jun 08 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-2.sme
44 - Update version to Mediawiki-1.38.1 [sme: 11987]
45
46 * Fri Jun 03 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-2.sme
47 - update sql create [SME: 11987]
48
49 * Fri Jun 03 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-1.sme
50 - Rollup tar file to include mediawiki 1.38.0 [SME: 11987]
51
52 * Wed Jun 01 2022 Brian Read <brianr@bjsystems.co.uk> 1.37.2-3.sme
53 - Fix-up-password-generation-and-localsettings [SME: 11987]
54
55 * Wed Jun 01 2022 BogusDateBot
56 - Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
57 by assuming the date is correct and changing the weekday.
58 Thu Oct 23 2007 --> Thu Oct 18 2007 or Tue Oct 23 2007 or Thu Oct 25 2007 or ....
59 Thu Feb 26 2008 --> Thu Feb 21 2008 or Tue Feb 26 2008 or Thu Feb 28 2008 or ....
60
61 * Tue May 31 2022 Brian Read <brianr@bjsystems.co.uk> 1.6.10-10 sme
62 - Update to SME10 [SME:11987]
63 - Add php-fpm stuff to httpd.conf
64 - Update to mw 1.37.2
65
66 * Mon May 12 2008 Dietmar Berteld> 1.6.10-9
67 - Disabing automatic creation of SME groups. No idea to synchronise them to mediawiki groups.
68
69 * Mon May 12 2008 Dietmar Berteld> 1.6.10-8
70 - Adding PwAuth-function, SME users can login with their SME passwords
71 Automatic creation of a few default mw_groups and list them in the
72 configuration file as well so admins only need to add users to the proper
73 groups in the server-manager
74
75 * Tue Feb 26 2008 Dietmar Berteld>
76 Thu Feb 26 2008 --> Thu Feb 21 2008 or Tue Feb 26 2008 or Thu Feb 28 2008 or ....
77 - [1.6.10-7] Fixed httpd-settings for local access only
78
79 * Tue Oct 23 2007 Dietmar Berteld>
80 Thu Oct 23 2007 --> Thu Oct 18 2007 or Tue Oct 23 2007 or Thu Oct 25 2007 or ....
81 - [1.6.10-6] Fixed automated uninstall issue for MySQL-DB and MySQL-user
82
83 * Fri Oct 19 2007 Dietmar Berteld>
84 - [1.6.10-5] Fixed short URL's
85 - Improved Apache template for better security
86 - Improved integration in SME (PublicAccess local/global - global)
87
88 * Wed Oct 10 2007 Sylvain Gomez <sylvaingomez@free.fr>
89 - [1.6.10-4] Fixed short URL's
90 Fixed Apache restarting at the wrong time while uninstalling
91 Added missing MySQL User
92 Added automatic lang detection at install stage
93 Changed sme.png logo
94
95 * Wed Sep 05 2007 Dietmar Berteld <dietmar@berteld.com>
96 - [1.6.10-3] Simpler method to create MySQL-Datebase
97 Using short URL's
98
99 * Wed Apr 25 2007 Dietmar Berteld <dietmar@berteld.com>
100 - [1.6.10-2] Security Improvements (template, MySQL, directory-rights)
101 Thanks for the help to Sylvain Gomez <sylvain.gomez@free.fr>
102
103 * Thu Apr 12 2007 Dietmar Berteld <dietmar@berteld.com>
104 - [1.6.10-1] Initial version
105
106 %prep
107 rm -rf $RPM_BUILD_ROOT
108
109 %setup
110
111 #%patch0 -p1
112 #%patch1 -p1
113
114 %build
115 perl createlinks
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 (cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
120 rm -f %{name}-%{version}-filelist
121 /sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %pre
127
128 UPDATE=$(ls /opt | grep -c mediawiki)
129 case $UPDATE in
130 0)
131 echo "Installing MediaWiki... Please wait!"
132 ;;
133 *)
134 echo "Updating MediaWiki... Please wait!"
135 mkdir -p /opt/MW_RPM_BACKUP
136 cd /opt
137 echo "Backing up installation files..."
138 tar -czf /opt/MW_RPM_BACKUP/mediawiki.tar.gz mediawiki
139 echo "Backing up MySQL database..."
140 mysqldump mediawiki > /opt/MW_RPM_BACKUP/mediawiki.sql
141 /sbin/e-smith/db configuration show mediawiki > /opt/MW_RPM_BACKUP/config.txt
142 ;;
143 esac
144
145 %post
146
147 # General Information
148 /etc/e-smith/events/actions/initialize-default-databases
149 # General Information
150 APP=MediaWiki
151 URL=wiki
152 WORKDIR=/root
153 MEDIAWIKIVERSION='1.38.1'
154 INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources
155 HTMLDIR=/opt/mediawiki
156 MYSQLDB=mediawiki
157 MYSQLUSER=mediawikiuser
158 MYSQLPASS=$(/sbin/e-smith/db configuration getprop mediawiki DbPassword)
159 DOMAIN=$(/sbin/e-smith/db configuration get DomainName)
160 SRVNAME=$(/sbin/e-smith/db configuration get SystemName)
161 UPDATE=$(ls /opt | grep -c mediawiki)
162 grep "LANG=" /etc/sysconfig/i18n > lang1
163 sed -e 's/LANG="//g' lang1 > lang2
164 sed -e 's/"//g' lang2 > lang
165 LANG=$(cat lang)
166 rm -rf lang*
167 #Untar application
168 echo "Decompressing files..."
169 mkdir -p $HTMLDIR
170 tar xzf $INSTALLDIR/mediawiki-$MEDIAWIKIVERSION.tar.gz -C /opt
171 case $UPDATE in
172 0) mv -f /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;;
173 *) cp -ufR /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;;
174 esac
175 rm -rf /opt/mediawiki-$MEDIAWIKIVERSION
176 cp $INSTALLDIR/sme.* $HTMLDIR/skins/common/images
177 #Prepare config settings
178 sed 's.mediawikipassword.'$MYSQLPASS'.g' $INSTALLDIR/LocalSettings.php > $HTMLDIR/LocalSettings.php
179 sed "s/mydomain/$DOMAIN/g" $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings1.php
180 sed "s/myhost/$SRVNAME/g" $HTMLDIR/LocalSettings1.php > $HTMLDIR/LocalSettings2.php
181 case "$LANG" in
182 de_DE) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "de";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;;
183 es_ES) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "es";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;;
184 fr_FR) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "fr";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;;
185 it_IT) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "it";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;;
186 *) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "en";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;;
187 esac
188 rm $HTMLDIR/LocalSettings1.php
189 rm $HTMLDIR/LocalSettings2.php
190 #cp $INSTALLDIR/PwAuthPlugin.php $HTMLDIR/extensions/PwAuthPlugin.php
191 #Creating SME-Groups for MediaWiki (disabled)
192 #/sbin/e-smith/db accounts set mw_read group
193 #/sbin/e-smith/db accounts setprop mw_read Description "MediaWiki Read"
194 #/sbin/e-smith/db accounts set mw_edit group
195 #/sbin/e-smith/db accounts setprop mw_edit Description "MediaWiki Edit"
196 #/sbin/e-smith/db accounts set mw_createpage group
197 #/sbin/e-smith/db accounts setprop mw_createpage Description "MediaWiki Create Page"
198 #/sbin/e-smith/db accounts set mw_createtalk group
199 #/sbin/e-smith/db accounts setprop mw_createtalk Description "MediaWiki Create Talk"
200 #/sbin/e-smith/signal-event group-create
201 #Changing some rights
202 chmod 644 $HTMLDIR/extensions/PwAuthPlugin.php
203 chown -R root:root $HTMLDIR
204 chown root:www $HTMLDIR/images
205 chown root:www $HTMLDIR/LocalSettings.php
206 chmod 775 $HTMLDIR/images
207 chmod 440 $HTMLDIR/LocalSettings.php
208 #Creating DataBase
209 echo "MySQL installation:"
210 case $UPDATE in
211 0)
212 echo "Creating MySQL User and DataBase..."
213 mysqladmin -u root create $MYSQLDB
214 mysql $MYSQLDB < $INSTALLDIR/$MYSQLDB.sql
215 mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) "
216 mysqladmin flush-privileges
217 ;;
218 *)
219 echo "Fixing MySQL rights..."
220 mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) "
221 mysqladmin flush-privileges
222 ;;
223 esac
224 # Rebuilding Wiki language menus
225 #php $HTMLDIR/maintenance/rebuildMessages.php --rebuild
226 #echo "Applying modifications to services..."
227 # Uncomment the PwAuth-function
228 sed 's.#!..g' $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php
229 mv $HTMLDIR/LocalSettings2.php $HTMLDIR/LocalSettings.php
230 #Handled in the -update event
231 #/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
232 #systemctl restart httpd-e-smith.service
233 echo "-------------------------------------------------------------------------------"
234 case $UPDATE in
235 0)
236 echo "$APP Installation completed."
237 echo "Reminder:"
238 echo "- Website open globally"
239 echo "- go to http://$DOMAIN/$URL"
240 #echo "- Usernames are identical with SME users"
241 #echo "- Passwords are identical with SME passwords"
242 echo "- MediaWiki admin = SME admin"
243 ;;
244 *)
245 echo "$APP update completed."
246 echo "Reminder:"
247 echo "- The old install was backed up and can be found in /opt/MW_RPM_BACKUP"
248 echo " PLEASE MOVE THIS DIRECTORY TO A SAFE PLACE!!!"
249 echo "- Website open globally"
250 echo "- go to http://$DOMAIN/$URL"
251 #echo "- Usernames are identical with SME users"
252 #echo "- Passwords are identical with SME passwords"
253 echo "- MediaWiki admin = SME admin"
254 ;;
255 esac
256 echo "-------------------------------------------------------------------------------"
257 echo "Following DB parameters are allowed:"
258 echo " # config setprop $MYSQLDB HTTPS on/off"
259 echo " # config setprop $MYSQLDB PublicAccess local/global"
260 echo " "
261 echo "Don't forget to apply modifications with following commands:"
262 echo " # expand-template /etc/httpd/conf/httpd.conf"
263 echo " # systemctl restart httpd-e-smith.service"
264 echo " "
265 echo "For more details, see http://wiki.contribs.org/Mediawiki"
266 echo "-------------------------------------------------------------------------------"
267
268 %preun
269 MEDIAWIKIVERSION='1.38.1'
270 INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources
271 if [ $1 = 0 ] ; then
272 mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/MW-Full-Uninstall.sh /root/
273 fi
274
275 %postun
276 if [ $1 = 0 ] ; then
277 echo "Restarting services..."
278 /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
279 #/usr/local/bin/svc -h /service/httpd-e-smith
280 systemctl restart httpd-e-smith.service
281 echo " "
282 echo "Uninstallation finished!"
283 echo "If you want to completly remove it (installation files and MySQL user+database)"
284 echo "please issue the following command at the prompt:"
285 echo "# sh /root/MW-Full-Uninstall.sh"
286 fi
287
288 %files -f %{name}-%{version}-filelist
289
290 %defattr(-,root,root)

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed