/[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.2 - (hide annotations) (download)
Wed Jun 1 09:14:52 2022 UTC (2 years, 5 months ago) by brianr
Branch: MAIN
Changes since 1.1: +22 -13 lines
* Tue May 31 2022 Brian Read <brianr@bjsystems.co.uk> 1.6.10-10.sme
- Update to SME10 [SME:11987]
- Add php-fpm stuff to httpd.conf
- Add in createlinks

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

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