/[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.7 - (show annotations) (download)
Wed Jun 1 13:27:17 2022 UTC (2 years, 6 months ago) by brianr
Branch: MAIN
Changes since 1.6: +2 -3 lines
* Wed Jun 01 2022 BogusDateBot
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
  by assuming the date is correct and changing the weekday.
  Thu Oct 23 2007 --> Thu Oct 18 2007 or Tue Oct 23 2007 or Thu Oct 25 2007 or ....
  Thu Feb 26 2008 --> Thu Feb 21 2008 or Tue Feb 26 2008 or Thu Feb 28 2008 or ....

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

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