]> git.pld-linux.org Git - packages/mediawiki.git/blame - mediawiki.spec
- migrated to apache 2.4
[packages/mediawiki.git] / mediawiki.spec
CommitLineData
e3a7d789 1# TODO
1ba63b93 2# - secure webpages and dirs (separate htdocs and includes)
613e8f16
ER
3#
4# Conditional build:
349190d5 5%bcond_with apidocs # with apidocs. not finished
613e8f16 6#
3e45cb33 7Summary: MediaWiki - the collaborative editing software that runs Wikipedia
38de538f 8Summary(pl.UTF-8): MediaWiki - oprogramowanie do wspólnej edycji, na którym działa Wikipedia
6b6d6010 9Name: mediawiki
c3d11b2d 10Version: 1.20.4
3848a96c 11Release: 2
8be0de73 12License: GPL v2
fcbef5c2 13Group: Applications/WWW
c8a7bec9 14Source0: http://download.wikimedia.org/mediawiki/1.20/%{name}-%{version}.tar.gz
c3d11b2d 15# Source0-md5: ad0e4c2319bc80713da2b8bf74091c3f
3848a96c
JR
16Source1: %{name}-apache.conf
17Source2: %{name}-httpd.conf
87f2a94b 18Patch0: %{name}-confdir2.patch
e5534f84 19URL: http://www.mediawiki.org/
613e8f16 20BuildRequires: sed >= 4.0
1ba63b93 21%if %{with apidocs}
613e8f16
ER
22BuildRequires: php-cli
23BuildRequires: php-pear-PhpDocumentor
24%endif
4419d6e6 25BuildRequires: rpmbuild(macros) >= 1.268
c65ad78d 26Requires: php(core) >= 5.0
2ed1e242
ER
27Requires: php(mysql)
28Requires: php(pcre)
6ce579da 29Requires: php(session)
2ed1e242 30Requires: php(xml)
b22e6573
ER
31# includes/UserMailer.php:
32#Requires: php-pear-Mail
613e8f16 33# Optional
6ce579da 34Requires: webapps
349190d5 35#Suggests: ImageMagick or php-gd for thumbnails
349190d5 36#Suggests: php-mmcache || php4-mmcache
6ce579da 37#Suggests: php-zlib
3848a96c 38Conflicts: apache-base < 2.4.0-1
7faae83c 39BuildArch: noarch
6b6d6010 40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
87f2a94b 42%define _noautoreq ^/usr/bin/hphpi$
43
b29bd451 44%define _appdir %{_datadir}/%{name}
ea11228e 45%define _vardir %{_sharedstatedir}/%{name}
1ba63b93
ER
46%define _webapps /etc/webapps
47%define _webapp %{name}
48%define _sysconfdir %{_webapps}/%{_webapp}
6b6d6010 49
50%description
51MediaWiki is the collaborative editing software that runs Wikipedia,
52for a list of features please consult:
e3a7d789 53<http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
6b6d6010 54
9ae185a8
JR
55%description -l pl.UTF-8
56MediaWiki to oprogramowanie do wspólnej edycji, na którym działa
57Wikipedia. Listę możliwości można znaleźć pod adresem:
e3a7d789 58<http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
6b6d6010 59
613e8f16
ER
60%package setup
61Summary: MediaWiki setup package
38de538f 62Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji MediaWiki
613e8f16 63Group: Applications/WWW
4419d6e6 64Requires: %{name} = %{epoch}:%{version}-%{release}
2ed1e242 65Requires: php(posix)
613e8f16
ER
66
67%description setup
68Install this package to configure initial MediaWiki installation. You
69should uninstall this package when you're done, as it considered
70insecure to keep the setup files in place.
71
9ae185a8
JR
72%description setup -l pl.UTF-8
73Ten pakiet należy zainstalować w celu wstępnej konfiguracji MediaWiki
74po pierwszej instalacji. Potem należy go odinstalować, jako że
75pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
613e8f16 76
6b6d6010 77%prep
78%setup -q
458cb1c6 79%patch0 -p1
613e8f16 80
1ba63b93 81find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
f389e0ea 82find -name '*.php5' | xargs rm -v
6b6d6010 83
84%install
85rm -rf $RPM_BUILD_ROOT
ea11228e 86install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_vardir}}
1ba63b93 87
ea11228e 88cp -a mw-config extensions includes languages maintenance resources skins $RPM_BUILD_ROOT%{_appdir}
89cp -a cache images $RPM_BUILD_ROOT%{_vardir}
87f2a94b 90cp *.php $RPM_BUILD_ROOT%{_appdir}
2a287787 91
ea11228e 92ln -s %{_vardir}/cache $RPM_BUILD_ROOT%{_appdir}
93ln -s %{_vardir}/images $RPM_BUILD_ROOT%{_appdir}
94
5623fddf 95install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
3848a96c 96install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
2a287787 97
6b6d6010 98%clean
99rm -rf $RPM_BUILD_ROOT
2a287787 100
1ba63b93
ER
101%post setup
102chmod 770 %{_sysconfdir}
103
104%postun setup
105if [ "$1" = "0" ]; then
106 chmod 750 %{_sysconfdir}
157f8048
ER
107 if [ -f %{_sysconfdir}/LocalSettings.php ]; then
108 chown root:http %{_sysconfdir}/LocalSettings.php
109 chmod 640 %{_sysconfdir}/LocalSettings.php
110 fi
1ba63b93
ER
111fi
112
108845f9 113%triggerin -- apache1 < 1.3.37-3, apache1-base
1ba63b93 114%webapp_register apache %{_webapp}
1eb6a164 115
108845f9 116%triggerun -- apache1 < 1.3.37-3, apache1-base
1ba63b93 117%webapp_unregister apache %{_webapp}
1eb6a164 118
3848a96c 119%triggerin -- apache-base
1ba63b93 120%webapp_register httpd %{_webapp}
1eb6a164 121
3848a96c 122%triggerun -- apache-base
1ba63b93
ER
123%webapp_unregister httpd %{_webapp}
124
125%triggerpostun -- %{name} < 1.5.3-0.2
126# nuke very-old config location (this mostly for Ra)
127if [ -f /etc/httpd/httpd.conf ]; then
128 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
129 /usr/sbin/webapp register httpd %{_webapp}
130 httpd_reload=1
131fi
1eb6a164 132
1ba63b93
ER
133# migrate from httpd (apache2) config dir
134if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
135 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
136 mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
137 /usr/sbin/webapp register httpd %{_webapp}
138 httpd_reload=1
139fi
5623fddf 140
1ba63b93
ER
141# migrate from apache-config macros
142if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
143 if [ -d /etc/apache/webapps.d ]; then
144 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
145 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
5623fddf 146 fi
1ba63b93
ER
147
148 if [ -d /etc/httpd/webapps.d ]; then
149 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
150 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
5623fddf 151 fi
1ba63b93 152 rm -f /etc/%{name}/apache.conf.rpmsave
5623fddf
ER
153fi
154
1ba63b93
ER
155# migrating from earlier apache-config?
156if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
157 if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
158 rm -f /etc/apache/conf.d/99_%{name}.conf
159 /usr/sbin/webapp register apache %{_webapp}
160 apache_reload=1
161 fi
162 if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
163 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
164 /usr/sbin/webapp register httpd %{_webapp}
165 httpd_reload=1
166 fi
167else
168 # no earlier registration. assume migration from Ra
169 if [ -d /etc/apache/webapps.d ]; then
170 /usr/sbin/webapp register apache %{_webapp}
171 apache_reload=1
172 fi
173 if [ -d /etc/httpd/webapps.d ]; then
174 /usr/sbin/webapp register httpd %{_webapp}
175 httpd_reload=1
e3a7d789
ER
176 fi
177fi
178
1ba63b93 179if [ "$httpd_reload" ]; then
4419d6e6 180 %service httpd reload
e3a7d789 181fi
1ba63b93 182if [ "$apache_reload" ]; then
4419d6e6 183 %service apache reload
e3a7d789 184fi
e3a7d789 185
349190d5
ER
186%triggerpostun -- %{name} < 1.6.0
187%banner -e %{name}-1.6 <<EOF
188You may use command line upgrade script maintenance/update.php to
189upgrade from previous version.
190EOF
191
6b6d6010 192%files
193%defattr(644,root,root,755)
c8a7bec9 194%doc docs FAQ HISTORY INSTALL README RELEASE-NOTES-1.20 UPGRADE *.sample
613e8f16 195%dir %attr(750,root,http) %{_sysconfdir}
5623fddf 196%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
1ba63b93 197%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
1ba63b93 198
b29bd451 199%dir %{_appdir}
1ba63b93 200%{_appdir}/*.php
b29bd451 201%{_appdir}/languages
ea11228e 202%{_appdir}/cache
b29bd451
ER
203%{_appdir}/images
204%{_appdir}/extensions
87f2a94b 205%{_appdir}/resources
b29bd451
ER
206%{_appdir}/skins
207%{_appdir}/includes
1ba63b93 208%{_appdir}/maintenance
613e8f16 209
ea11228e 210%dir %attr(750,root,http) %{_vardir}
211%dir %attr(770,root,http) %{_vardir}/cache
212%{_vardir}/cache/.htaccess
213%dir %attr(770,root,http) %{_vardir}/images
214%{_vardir}/images/.htaccess
215%{_vardir}/images/README
216
613e8f16
ER
217%files setup
218%defattr(644,root,root,755)
87f2a94b 219%dir %attr(775,root,http) %{_appdir}/mw-config
220%{_appdir}/mw-config/index.php
c8a7bec9 221%{_appdir}/mw-config/overrides.php
This page took 0.102759 seconds and 5 git commands to generate.