2 # - secure webpages and dirs (separate htdocs and includes)
5 %bcond_with apidocs # with apidocs. not finished
7 Summary: MediaWiki - the collaborative editing software that runs Wikipedia
8 Summary(pl.UTF-8): MediaWiki - oprogramowanie do wspólnej edycji, na którym działa Wikipedia
13 Group: Applications/WWW
14 Source0: http://download.wikimedia.org/mediawiki/1.20/%{name}-%{version}.tar.gz
15 # Source0-md5: ad0e4c2319bc80713da2b8bf74091c3f
16 Source1: %{name}-apache.conf
17 Source2: %{name}-httpd.conf
18 Patch0: %{name}-confdir2.patch
19 URL: http://www.mediawiki.org/
20 BuildRequires: sed >= 4.0
22 BuildRequires: php-cli
23 BuildRequires: php-pear-PhpDocumentor
25 BuildRequires: rpmbuild(macros) >= 1.268
26 Requires: php(core) >= 5.0
29 Requires: php(session)
31 # includes/UserMailer.php:
32 #Requires: php-pear-Mail
35 #Suggests: ImageMagick or php-gd for thumbnails
36 #Suggests: php-mmcache || php4-mmcache
38 Conflicts: apache-base < 2.4.0-1
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 %define _noautoreq ^/usr/bin/hphpi$
44 %define _appdir %{_datadir}/%{name}
45 %define _vardir %{_sharedstatedir}/%{name}
46 %define _webapps /etc/webapps
47 %define _webapp %{name}
48 %define _sysconfdir %{_webapps}/%{_webapp}
51 MediaWiki is the collaborative editing software that runs Wikipedia,
52 for a list of features please consult:
53 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
55 %description -l pl.UTF-8
56 MediaWiki to oprogramowanie do wspólnej edycji, na którym działa
57 Wikipedia. Listę możliwości można znaleźć pod adresem:
58 <http://meta.wikimedia.org/wiki/MediaWiki_feature_list>.
61 Summary: MediaWiki setup package
62 Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji MediaWiki
63 Group: Applications/WWW
64 Requires: %{name} = %{epoch}:%{version}-%{release}
68 Install this package to configure initial MediaWiki installation. You
69 should uninstall this package when you're done, as it considered
70 insecure to keep the setup files in place.
72 %description setup -l pl.UTF-8
73 Ten pakiet należy zainstalować w celu wstępnej konfiguracji MediaWiki
74 po pierwszej instalacji. Potem należy go odinstalować, jako że
75 pozostawienie plików instalacyjnych mogłoby być niebezpieczne.
81 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
82 find -name '*.php5' | xargs rm -v
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_vardir}}
88 cp -a mw-config extensions includes languages maintenance resources skins $RPM_BUILD_ROOT%{_appdir}
89 cp -a cache images $RPM_BUILD_ROOT%{_vardir}
90 cp *.php $RPM_BUILD_ROOT%{_appdir}
92 ln -s %{_vardir}/cache $RPM_BUILD_ROOT%{_appdir}
93 ln -s %{_vardir}/images $RPM_BUILD_ROOT%{_appdir}
95 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
96 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
99 rm -rf $RPM_BUILD_ROOT
102 chmod 770 %{_sysconfdir}
105 if [ "$1" = "0" ]; then
106 chmod 750 %{_sysconfdir}
107 if [ -f %{_sysconfdir}/LocalSettings.php ]; then
108 chown root:http %{_sysconfdir}/LocalSettings.php
109 chmod 640 %{_sysconfdir}/LocalSettings.php
113 %triggerin -- apache1 < 1.3.37-3, apache1-base
114 %webapp_register apache %{_webapp}
116 %triggerun -- apache1 < 1.3.37-3, apache1-base
117 %webapp_unregister apache %{_webapp}
119 %triggerin -- apache-base
120 %webapp_register httpd %{_webapp}
122 %triggerun -- apache-base
123 %webapp_unregister httpd %{_webapp}
125 %triggerpostun -- %{name} < 1.5.3-0.2
126 # nuke very-old config location (this mostly for Ra)
127 if [ -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}
133 # migrate from httpd (apache2) config dir
134 if [ -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}
141 # migrate from apache-config macros
142 if [ -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
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
152 rm -f /etc/%{name}/apache.conf.rpmsave
155 # migrating from earlier apache-config?
156 if [ -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}
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}
168 # no earlier registration. assume migration from Ra
169 if [ -d /etc/apache/webapps.d ]; then
170 /usr/sbin/webapp register apache %{_webapp}
173 if [ -d /etc/httpd/webapps.d ]; then
174 /usr/sbin/webapp register httpd %{_webapp}
179 if [ "$httpd_reload" ]; then
180 %service httpd reload
182 if [ "$apache_reload" ]; then
183 %service apache reload
186 %triggerpostun -- %{name} < 1.6.0
187 %banner -e %{name}-1.6 <<EOF
188 You may use command line upgrade script maintenance/update.php to
189 upgrade from previous version.
193 %defattr(644,root,root,755)
194 %doc docs FAQ HISTORY INSTALL README RELEASE-NOTES-1.20 UPGRADE *.sample
195 %dir %attr(750,root,http) %{_sysconfdir}
196 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
197 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
204 %{_appdir}/extensions
208 %{_appdir}/maintenance
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
218 %defattr(644,root,root,755)
219 %dir %attr(775,root,http) %{_appdir}/mw-config
220 %{_appdir}/mw-config/index.php
221 %{_appdir}/mw-config/overrides.php