/[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.6 - (show annotations) (download)
Wed Jun 1 13:23:19 2022 UTC (2 years, 6 months ago) by brianr
Branch: MAIN
Changes since 1.5: +7 -4 lines
Update to 1.37.2 release - update - 2

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

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