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

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

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


Revision 1.19 - (hide annotations) (download)
Thu Dec 1 15:06:30 2022 UTC (23 months, 4 weeks ago) by brianr
Branch: MAIN
Changes since 1.18: +14 -10 lines
*** empty log message ***

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

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