2 # - secure webpages and dirs (separate htdocs and includes)
5 %bcond_with apidocs # with apidocs
7 Summary: MediaWiki - the collaborative editing software that runs Wikipedia
8 Summary(pl): MediaWiki - oprogramowanie do wspólnej edycji, na którym dzia³a Wikipedia
13 Group: Applications/WWW
14 Source0: http://dl.sourceforge.net/wikipedia/%{name}-%{version}.tar.gz
15 # Source0-md5: fc697787f04208d1842a2c646deca626
17 Patch0: %{name}-mysqlroot.patch
18 Patch1: %{name}-confdir2.patch
19 URL: http://wikipedia.sourceforge.net/
20 BuildRequires: sed >= 4.0
22 BuildRequires: php-cli
23 BuildRequires: php-pear-PhpDocumentor
25 BuildRequires: rpmbuild(macros) >= 1.268
29 # includes/UserMailer.php:
30 #Requires: php-pear-Mail
32 #Requires: ImageMagick or php-gd for thumbnails
34 #Requires: turck-mmcache
36 Requires: webserver = apache
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 %define _appdir %{_datadir}/%{name}
40 %define _webapps /etc/webapps
41 %define _webapp %{name}
42 %define _sysconfdir %{_webapps}/%{_webapp}
45 MediaWiki is the collaborative editing software that runs Wikipedia,
46 for a list of features please consult:
47 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
50 MediaWiki to oprogramowanie do wspólnej edycji, na którym dzia³a
51 Wikipedia. Listê mo¿liwo¶ci mo¿na znale¼æ pod adresem:
52 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
55 Summary: MediaWiki setup package
56 Summary(pl): Pakiet do wstêpnej konfiguracji MediaWiki
57 Group: Applications/WWW
58 Requires: %{name} = %{epoch}:%{version}-%{release}
61 Install this package to configure initial MediaWiki installation. You
62 should uninstall this package when you're done, as it considered
63 insecure to keep the setup files in place.
65 %description setup -l pl
66 Ten pakiet nale¿y zainstalowaæ w celu wstêpnej konfiguracji MediaWiki
67 po pierwszej instalacji. Potem nale¿y go odinstalowaæ, jako ¿e
68 pozostawienie plików instalacyjnych mog³oby byæ niebezpieczne.
75 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
81 cp -a config extensions images includes languages maintenance math skins $RPM_BUILD_ROOT%{_appdir}
82 cp -a AdminSettings.sample $RPM_BUILD_ROOT%{_sysconfdir}/AdminSettings.php
84 cp *.php install-utils.inc $RPM_BUILD_ROOT%{_appdir}
86 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
87 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
90 rm -rf $RPM_BUILD_ROOT
93 chmod 770 %{_sysconfdir}
96 if [ "$1" = "0" ]; then
97 chmod 750 %{_sysconfdir}
98 if [ -f %{_sysconfdir}/LocalSettings.php ]; then
99 chown root:http %{_sysconfdir}/LocalSettings.php
100 chmod 640 %{_sysconfdir}/LocalSettings.php
104 %triggerin -- apache1
105 %webapp_register apache %{_webapp}
107 %triggerun -- apache1
108 %webapp_unregister apache %{_webapp}
110 %triggerin -- apache < 2.2.0, apache-base
111 %webapp_register httpd %{_webapp}
113 %triggerun -- apache < 2.2.0, apache-base
114 %webapp_unregister httpd %{_webapp}
116 %triggerpostun -- %{name} < 1.5.3-0.2
117 # nuke very-old config location (this mostly for Ra)
118 if [ -f /etc/httpd/httpd.conf ]; then
119 sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
120 /usr/sbin/webapp register httpd %{_webapp}
124 # migrate from httpd (apache2) config dir
125 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
126 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
127 mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
128 /usr/sbin/webapp register httpd %{_webapp}
132 # migrate from apache-config macros
133 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
134 if [ -d /etc/apache/webapps.d ]; then
135 cp -f %{_sysconfdir}/apache.conf{,.rpmnew}
136 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/apache.conf
139 if [ -d /etc/httpd/webapps.d ]; then
140 cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
141 cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf
143 rm -f /etc/%{name}/apache.conf.rpmsave
146 # migrating from earlier apache-config?
147 if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
148 if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
149 rm -f /etc/apache/conf.d/99_%{name}.conf
150 /usr/sbin/webapp register apache %{_webapp}
153 if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
154 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
155 /usr/sbin/webapp register httpd %{_webapp}
159 # no earlier registration. assume migration from Ra
160 if [ -d /etc/apache/webapps.d ]; then
161 /usr/sbin/webapp register apache %{_webapp}
164 if [ -d /etc/httpd/webapps.d ]; then
165 /usr/sbin/webapp register httpd %{_webapp}
170 if [ "$httpd_reload" ]; then
171 %service httpd reload
173 if [ "$apache_reload" ]; then
174 %service apache reload
178 %defattr(644,root,root,755)
179 %doc docs FAQ HISTORY INSTALL README RELEASE-NOTES UPGRADE *.sample tests
180 %dir %attr(750,root,http) %{_sysconfdir}
181 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
182 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
183 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/AdminSettings.php
190 %{_appdir}/extensions
193 %{_appdir}/maintenance
196 %defattr(644,root,root,755)
197 %dir %attr(775,root,http) %{_appdir}/config
198 %{_appdir}/install-utils.inc
199 %{_appdir}/config/index.php