]> git.pld-linux.org Git - packages/mediawiki.git/blob - mediawiki.spec
- migrated to apache 2.4
[packages/mediawiki.git] / mediawiki.spec
1 # TODO
2 # - secure webpages and dirs (separate htdocs and includes)
3 #
4 # Conditional build:
5 %bcond_with     apidocs # with apidocs. not finished
6 #
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
9 Name:           mediawiki
10 Version:        1.20.4
11 Release:        2
12 License:        GPL v2
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
21 %if %{with apidocs}
22 BuildRequires:  php-cli
23 BuildRequires:  php-pear-PhpDocumentor
24 %endif
25 BuildRequires:  rpmbuild(macros) >= 1.268
26 Requires:       php(core) >= 5.0
27 Requires:       php(mysql)
28 Requires:       php(pcre)
29 Requires:       php(session)
30 Requires:       php(xml)
31 # includes/UserMailer.php:
32 #Requires:      php-pear-Mail
33 # Optional
34 Requires:       webapps
35 #Suggests:      ImageMagick or php-gd for thumbnails
36 #Suggests:      php-mmcache || php4-mmcache
37 #Suggests:      php-zlib
38 Conflicts:      apache-base < 2.4.0-1
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         _noautoreq      ^/usr/bin/hphpi$
43
44 %define         _appdir         %{_datadir}/%{name}
45 %define         _vardir         %{_sharedstatedir}/%{name}
46 %define         _webapps        /etc/webapps
47 %define         _webapp         %{name}
48 %define         _sysconfdir     %{_webapps}/%{_webapp}
49
50 %description
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>.
54
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>.
59
60 %package setup
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}
65 Requires:       php(posix)
66
67 %description setup
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.
71
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.
76
77 %prep
78 %setup -q
79 %patch0 -p1
80
81 find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v
82 find -name '*.php5' | xargs rm -v
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_vardir}}
87
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}
91
92 ln -s %{_vardir}/cache $RPM_BUILD_ROOT%{_appdir}
93 ln -s %{_vardir}/images $RPM_BUILD_ROOT%{_appdir}
94
95 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
96 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %post setup
102 chmod 770 %{_sysconfdir}
103
104 %postun setup
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
110         fi
111 fi
112
113 %triggerin -- apache1 < 1.3.37-3, apache1-base
114 %webapp_register apache %{_webapp}
115
116 %triggerun -- apache1 < 1.3.37-3, apache1-base
117 %webapp_unregister apache %{_webapp}
118
119 %triggerin -- apache-base
120 %webapp_register httpd %{_webapp}
121
122 %triggerun -- apache-base
123 %webapp_unregister httpd %{_webapp}
124
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}
130         httpd_reload=1
131 fi
132
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}
138         httpd_reload=1
139 fi
140
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
146         fi
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
151         fi
152         rm -f /etc/%{name}/apache.conf.rpmsave
153 fi
154
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}
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
167 else
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
176         fi
177 fi
178
179 if [ "$httpd_reload" ]; then
180         %service httpd reload
181 fi
182 if [ "$apache_reload" ]; then
183         %service apache reload
184 fi
185
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.
190 EOF
191
192 %files
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
198
199 %dir %{_appdir}
200 %{_appdir}/*.php
201 %{_appdir}/languages
202 %{_appdir}/cache
203 %{_appdir}/images
204 %{_appdir}/extensions
205 %{_appdir}/resources
206 %{_appdir}/skins
207 %{_appdir}/includes
208 %{_appdir}/maintenance
209
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
217 %files setup
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
This page took 0.126751 seconds and 4 git commands to generate.