/[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.17 - (show annotations) (download)
Tue Aug 2 05:45:21 2022 UTC (2 years, 4 months ago) by jpp
Branch: MAIN
Changes since 1.16: +4 -2 lines
* Tue Aug 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.38.2-2.sme
- update to httpd 2.4 access syntax [SME: 12133]

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

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