1 |
# $Id: smeserver-mediawiki.spec,v 1.7 2022/06/01 13:27:17 brianr Exp $ |
# $Id: smeserver-mediawiki.spec,v 1.16 2022/08/02 05:43:47 jpp Exp $ |
2 |
# Authority: ber_die |
# Authority: ber_die |
3 |
# Name: Dietmar Berteld |
# Name: Dietmar Berteld |
4 |
|
|
5 |
%define name smeserver-mediawiki |
%define name smeserver-mediawiki |
6 |
%define version 1.37.2 |
%define version 1.38.2 |
7 |
%define release 2 |
%define release 2 |
8 |
======= |
|
9 |
>>>>>>> 1.5 |
Summary: Mediawiki Web Application for SME Server 7.x based on Mediawiki 1.38.0 |
|
Summary: Mediawiki Web Application for SME Server 7.x based on Mediawiki 1.37.2 |
|
10 |
Name: %{name} |
Name: %{name} |
11 |
Version: %{version} |
Version: %{version} |
12 |
Release: %{release}%{?dist} |
Release: %{release}%{?dist} |
13 |
License: GPL |
License: GPL |
14 |
Group: /Web/Applications |
Group: /Web/Applications |
15 |
Source: %{name}-%{version}-1.tar.gz |
Source: %{name}-%{version}.tar.gz |
16 |
#Patch0: smeserver-mediawiki-1.6.10-1.patch |
|
17 |
#Patch1: smeserver-mediawiki-1.6.10-Update-to-SME10.patch |
Patch0: smeserver-mediawiki-1.38.2-bz12133-httpd24.patch |
18 |
|
|
19 |
URL: http://mediawiki.org/ |
URL: http://mediawiki.org/ |
20 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
21 |
BuildArch: noarch |
BuildArch: noarch |
22 |
Requires: e-smith-base, e-smith-release >= 10 |
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 |
BuildRequires: e-smith-devtools |
26 |
|
|
27 |
%description |
%description |
33 |
http://your_e-smith-server_adress/wiki |
http://your_e-smith-server_adress/wiki |
34 |
|
|
35 |
%changelog |
%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 |
* Wed Jun 01 2022 BogusDateBot |
59 |
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, |
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, |
60 |
by assuming the date is correct and changing the weekday. |
by assuming the date is correct and changing the weekday. |
111 |
|
|
112 |
%setup |
%setup |
113 |
|
|
114 |
#%patch0 -p1 |
%patch0 -p1 |
115 |
#%patch1 -p1 |
#%patch1 -p1 |
116 |
|
|
117 |
%build |
%build |
118 |
|
perl createlinks |
119 |
|
|
120 |
%install |
%install |
121 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
153 |
APP=MediaWiki |
APP=MediaWiki |
154 |
URL=wiki |
URL=wiki |
155 |
WORKDIR=/root |
WORKDIR=/root |
156 |
INSTALLDIR=/usr/share/doc/mediawiki-1.37.2/Sources |
MEDIAWIKIVERSION='1.38.2' |
157 |
|
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
158 |
HTMLDIR=/opt/mediawiki |
HTMLDIR=/opt/mediawiki |
159 |
MYSQLDB=mediawiki |
MYSQLDB=mediawiki |
160 |
MYSQLUSER=mediawikiuser |
MYSQLUSER=mediawikiuser |
170 |
#Untar application |
#Untar application |
171 |
echo "Decompressing files..." |
echo "Decompressing files..." |
172 |
mkdir -p $HTMLDIR |
mkdir -p $HTMLDIR |
173 |
tar xzf $INSTALLDIR/mediawiki-1.37.2.tar.gz -C /opt |
tar xzf $INSTALLDIR/mediawiki-$MEDIAWIKIVERSION.tar.gz -C /opt |
174 |
case $UPDATE in |
case $UPDATE in |
175 |
0) mv -f /opt/mediawiki-1.37.2/* $HTMLDIR ;; |
0) mv -f /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;; |
176 |
*) cp -ufR /opt/mediawiki-1.37.2/* $HTMLDIR --reply=yes ;; |
*) cp -ufR /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;; |
177 |
esac |
esac |
178 |
rm -rf /opt/mediawiki-1.37.2 |
rm -rf /opt/mediawiki-$MEDIAWIKIVERSION |
179 |
cp $INSTALLDIR/sme.* $HTMLDIR/skins/common/images |
cp $INSTALLDIR/sme.* $HTMLDIR/skins/common/images |
180 |
#Prepare config settings |
#Prepare config settings |
181 |
sed 's.mediawikipassword.'$MYSQLPASS'.g' $INSTALLDIR/LocalSettings.php > $HTMLDIR/LocalSettings.php |
sed 's.mediawikipassword.'$MYSQLPASS'.g' $INSTALLDIR/LocalSettings.php > $HTMLDIR/LocalSettings.php |
182 |
sed "s/mydomain/$DOMAIN/g" $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
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 |
case "$LANG" in |
185 |
de_DE) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "de";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;; |
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 ;; |
es_ES) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "es";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;; |
188 |
it_IT) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "it";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;; |
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 ;; |
*) sed 's.$wgLanguageCode = "en";.$wgLanguageCode = "en";.g' $HTMLDIR/LocalSettings2.php > $HTMLDIR/LocalSettings.php ;; |
190 |
esac |
esac |
191 |
|
rm $HTMLDIR/LocalSettings1.php |
192 |
rm $HTMLDIR/LocalSettings2.php |
rm $HTMLDIR/LocalSettings2.php |
193 |
cp $INSTALLDIR/PwAuthPlugin.php $HTMLDIR/extensions/PwAuthPlugin.php |
#cp $INSTALLDIR/PwAuthPlugin.php $HTMLDIR/extensions/PwAuthPlugin.php |
194 |
#Creating SME-Groups for MediaWiki (disabled) |
#Creating SME-Groups for MediaWiki (disabled) |
195 |
#/sbin/e-smith/db accounts set mw_read group |
#/sbin/e-smith/db accounts set mw_read group |
196 |
#/sbin/e-smith/db accounts setprop mw_read Description "MediaWiki Read" |
#/sbin/e-smith/db accounts setprop mw_read Description "MediaWiki Read" |
215 |
echo "Creating MySQL User and DataBase..." |
echo "Creating MySQL User and DataBase..." |
216 |
mysqladmin -u root create $MYSQLDB |
mysqladmin -u root create $MYSQLDB |
217 |
mysql $MYSQLDB < $INSTALLDIR/$MYSQLDB.sql |
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' ) " |
mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " |
220 |
mysqladmin flush-privileges |
mysqladmin flush-privileges |
221 |
;; |
;; |
226 |
;; |
;; |
227 |
esac |
esac |
228 |
# Rebuilding Wiki language menus |
# Rebuilding Wiki language menus |
229 |
php $HTMLDIR/maintenance/rebuildMessages.php --rebuild |
#php $HTMLDIR/maintenance/rebuildMessages.php --rebuild |
230 |
echo "Applying modifications to services..." |
#echo "Applying modifications to services..." |
231 |
# Uncomment the PwAuth-function |
# Uncomment the PwAuth-function |
232 |
sed 's.#!..g' $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
sed 's.#!..g' $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
233 |
mv $HTMLDIR/LocalSettings2.php $HTMLDIR/LocalSettings.php |
mv $HTMLDIR/LocalSettings2.php $HTMLDIR/LocalSettings.php |
234 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
#Handled in the -update event |
235 |
systemctl restart httpd-e-smith.service |
#/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
236 |
|
#systemctl restart httpd-e-smith.service |
237 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
238 |
case $UPDATE in |
case $UPDATE in |
239 |
0) |
0) |
270 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
271 |
|
|
272 |
%preun |
%preun |
273 |
INSTALLDIR=/usr/share/doc/mediawiki-1.37.2/Sources |
MEDIAWIKIVERSION='1.38.2' |
274 |
|
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
275 |
if [ $1 = 0 ] ; then |
if [ $1 = 0 ] ; then |
276 |
mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/MW-Full-Uninstall.sh /root/ |
mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/MW-Full-Uninstall.sh /root/ |
277 |
fi |
fi |