1 |
# $Id: smeserver-mediawiki.spec,v 1.9 2022/06/01 13:28:34 brianr Exp $ |
# $Id: smeserver-mediawiki.spec,v 1.20 2022/12/01 15:14:03 brianr 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.38.0 |
%define version 1.39.4 |
7 |
%define release 1 |
%define release 1 |
8 |
|
|
9 |
Summary: Mediawiki Web Application for SME Server 7.x based on Mediawiki 1.38.0 |
Summary: Mediawiki Web Application for SME Server 10.x based on Mediawiki 1.39.0 |
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}.tar.gz |
Source: %{name}-%{version}.tar.gz |
16 |
#Patch0: smeserver-mediawiki-1.37.2-Fix-up-password-generation-and-localsettings.patch |
|
17 |
#Patch1: smeserver-mediawiki-1.6.10-Update-to-SME10.patch |
#Patch0: smeserver-mediawiki-1.38.2-bz12133-httpd24.patch |
18 |
|
#Patch1: smeserver-mediawiki-1.38.2-bz12134-backup.patch |
19 |
|
|
20 |
URL: http://mediawiki.org/ |
URL: http://mediawiki.org/ |
21 |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot |
22 |
BuildArch: noarch |
BuildArch: noarch |
23 |
Requires: e-smith-base, e-smith-release >= 10 |
Requires: e-smith-base, e-smith-release >= 10 |
24 |
|
Requires: e-smith-apache >= 2.6.0-19 |
25 |
|
Requires: smeserver-php >= 3.0.0-43 |
26 |
BuildRequires: e-smith-devtools |
BuildRequires: e-smith-devtools |
27 |
|
|
28 |
%description |
%description |
34 |
http://your_e-smith-server_adress/wiki |
http://your_e-smith-server_adress/wiki |
35 |
|
|
36 |
%changelog |
%changelog |
37 |
|
|
38 |
|
* Sat Jul 22 2023 Brian Read <brianr@koozali.org> 1.39.4-1.sme |
39 |
|
- Update to LTS version 1.39.4 (Supported until dec 2025)[SME: 12385] |
40 |
|
|
41 |
|
* Thu Dec 01 2022 Brian Read <brianr@bjsystems.co.uk> 1.39.0-1.sme |
42 |
|
- Update to LTS version 1.39.0 (Supported until dec 2025)[SME: 12250] |
43 |
|
|
44 |
|
* Tue Aug 02 2022 Jean-Philippe Pialasse <tests@pialasse.com> 1.38.2-2.sme |
45 |
|
- update to httpd 2.4 access syntax [SME: 12133] |
46 |
|
- add to core backup [SME: 12134] |
47 |
|
|
48 |
|
* Tue Jul 12 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.2-1.sme |
49 |
|
- Update version to Mediawiki-1.38.2 [sme: 11987] |
50 |
|
- Fix initial admin user password |
51 |
|
|
52 |
|
* Thu Jun 09 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.1-2.sme |
53 |
|
- fix sql user create [SME: 11987] |
54 |
|
|
55 |
|
* Wed Jun 08 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-2.sme |
56 |
|
- Update version to Mediawiki-1.38.1 [sme: 11987] |
57 |
|
|
58 |
|
* Fri Jun 03 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-2.sme |
59 |
|
- update sql create [SME: 11987] |
60 |
|
|
61 |
* Fri Jun 03 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-1.sme |
* Fri Jun 03 2022 Brian Read <brianr@bjsystems.co.uk> 1.38.0-1.sme |
62 |
- Rollup tar file to include mediawiki 1.38.0 [SME: 11987] |
- Rollup tar file to include mediawiki 1.38.0 [SME: 11987] |
63 |
|
|
124 |
#%patch1 -p1 |
#%patch1 -p1 |
125 |
|
|
126 |
%build |
%build |
127 |
|
perl createlinks |
128 |
|
|
129 |
%install |
%install |
130 |
rm -rf $RPM_BUILD_ROOT |
rm -rf $RPM_BUILD_ROOT |
162 |
APP=MediaWiki |
APP=MediaWiki |
163 |
URL=wiki |
URL=wiki |
164 |
WORKDIR=/root |
WORKDIR=/root |
165 |
MEDIAWIKIVERSION='1.38.0' |
MEDIAWIKIVERSION='1.39.4' |
166 |
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
167 |
HTMLDIR=/opt/mediawiki |
HTMLDIR=/opt/mediawiki |
168 |
MYSQLDB=mediawiki |
MYSQLDB=mediawiki |
179 |
#Untar application |
#Untar application |
180 |
echo "Decompressing files..." |
echo "Decompressing files..." |
181 |
mkdir -p $HTMLDIR |
mkdir -p $HTMLDIR |
182 |
tar xzf $INSTALLDIR/mediawiki-1.37.2.tar.gz -C /opt |
tar xzf $INSTALLDIR/mediawiki-$MEDIAWIKIVERSION.tar.gz -C /opt |
183 |
case $UPDATE in |
case $UPDATE in |
184 |
0) mv -f /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;; |
0) mv -f /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;; |
185 |
*) cp -ufR /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR --reply=yes ;; |
*) cp -ufR /opt/mediawiki-$MEDIAWIKIVERSION/* $HTMLDIR ;; |
186 |
esac |
esac |
187 |
rm -rf /opt/mediawiki-$MEDIAWIKIVERSION |
rm -rf /opt/mediawiki-$MEDIAWIKIVERSION |
188 |
cp $INSTALLDIR/sme.* $HTMLDIR/skins/common/images |
cp $INSTALLDIR/sme.* $HTMLDIR/skins/common/images |
189 |
#Prepare config settings |
#Prepare config settings |
190 |
sed 's.mediawikipassword.'$MYSQLPASS'.g' $INSTALLDIR/LocalSettings.php > $HTMLDIR/LocalSettings.php |
sed 's.mediawikipassword.'$MYSQLPASS'.g' $INSTALLDIR/LocalSettings.php > $HTMLDIR/LocalSettings.php |
191 |
sed "s/mydomain/$DOMAIN/g" $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
sed "s/mydomain/$DOMAIN/g" $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings1.php |
192 |
|
sed "s/myhost/$SRVNAME/g" $HTMLDIR/LocalSettings1.php > $HTMLDIR/LocalSettings2.php |
193 |
case "$LANG" in |
case "$LANG" in |
194 |
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 ;; |
195 |
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 ;; |
197 |
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 ;; |
198 |
*) 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 ;; |
199 |
esac |
esac |
200 |
|
rm $HTMLDIR/LocalSettings1.php |
201 |
rm $HTMLDIR/LocalSettings2.php |
rm $HTMLDIR/LocalSettings2.php |
202 |
cp $INSTALLDIR/PwAuthPlugin.php $HTMLDIR/extensions/PwAuthPlugin.php |
#cp $INSTALLDIR/PwAuthPlugin.php $HTMLDIR/extensions/PwAuthPlugin.php |
203 |
#Creating SME-Groups for MediaWiki (disabled) |
#Creating SME-Groups for MediaWiki (disabled) |
204 |
#/sbin/e-smith/db accounts set mw_read group |
#/sbin/e-smith/db accounts set mw_read group |
205 |
#/sbin/e-smith/db accounts setprop mw_read Description "MediaWiki Read" |
#/sbin/e-smith/db accounts setprop mw_read Description "MediaWiki Read" |
224 |
echo "Creating MySQL User and DataBase..." |
echo "Creating MySQL User and DataBase..." |
225 |
mysqladmin -u root create $MYSQLDB |
mysqladmin -u root create $MYSQLDB |
226 |
mysql $MYSQLDB < $INSTALLDIR/$MYSQLDB.sql |
mysql $MYSQLDB < $INSTALLDIR/$MYSQLDB.sql |
227 |
|
mysql $MYSQLDB -e "UPDATE user SET user_password = MD5( CONCAT( user_id, '-', MD5( 'mediawikiadmin' ) ) ) WHERE user_id =1 " |
228 |
mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " |
mysql -u root -e "SET PASSWORD FOR $MYSQLUSER@localhost = PASSWORD( '$MYSQLPASS' ) " |
229 |
mysqladmin flush-privileges |
mysqladmin flush-privileges |
230 |
;; |
;; |
235 |
;; |
;; |
236 |
esac |
esac |
237 |
# Rebuilding Wiki language menus |
# Rebuilding Wiki language menus |
238 |
php $HTMLDIR/maintenance/rebuildMessages.php --rebuild |
#php $HTMLDIR/maintenance/rebuildMessages.php --rebuild |
239 |
echo "Applying modifications to services..." |
#echo "Applying modifications to services..." |
240 |
# Uncomment the PwAuth-function |
# Uncomment the PwAuth-function |
241 |
sed 's.#!..g' $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
sed 's.#!..g' $HTMLDIR/LocalSettings.php > $HTMLDIR/LocalSettings2.php |
242 |
mv $HTMLDIR/LocalSettings2.php $HTMLDIR/LocalSettings.php |
mv $HTMLDIR/LocalSettings2.php $HTMLDIR/LocalSettings.php |
243 |
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
#Handled in the -update event |
244 |
systemctl restart httpd-e-smith.service |
#/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf |
245 |
|
#systemctl restart httpd-e-smith.service |
246 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
247 |
case $UPDATE in |
case $UPDATE in |
248 |
0) |
0) |
279 |
echo "-------------------------------------------------------------------------------" |
echo "-------------------------------------------------------------------------------" |
280 |
|
|
281 |
%preun |
%preun |
282 |
|
MEDIAWIKIVERSION='1.39.4' |
283 |
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
INSTALLDIR=/usr/share/doc/mediawiki-$MEDIAWIKIVERSION/Sources |
284 |
if [ $1 = 0 ] ; then |
if [ $1 = 0 ] ; then |
285 |
mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/MW-Full-Uninstall.sh /root/ |
mv $INSTALLDIR/DO_NOT_USE_OR_DELETE/MW-Full-Uninstall.sh /root/ |