]>
Commit | Line | Data |
---|---|---|
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 | 7 | Summary: MediaWiki - the collaborative editing software that runs Wikipedia |
38de538f | 8 | Summary(pl.UTF-8): MediaWiki - oprogramowanie do wspólnej edycji, na którym działa Wikipedia |
6b6d6010 | 9 | Name: mediawiki |
c3d11b2d | 10 | Version: 1.20.4 |
3848a96c | 11 | Release: 2 |
8be0de73 | 12 | License: GPL v2 |
fcbef5c2 | 13 | Group: Applications/WWW |
c8a7bec9 | 14 | Source0: http://download.wikimedia.org/mediawiki/1.20/%{name}-%{version}.tar.gz |
c3d11b2d | 15 | # Source0-md5: ad0e4c2319bc80713da2b8bf74091c3f |
3848a96c JR |
16 | Source1: %{name}-apache.conf |
17 | Source2: %{name}-httpd.conf | |
87f2a94b | 18 | Patch0: %{name}-confdir2.patch |
e5534f84 | 19 | URL: http://www.mediawiki.org/ |
613e8f16 | 20 | BuildRequires: sed >= 4.0 |
1ba63b93 | 21 | %if %{with apidocs} |
613e8f16 ER |
22 | BuildRequires: php-cli |
23 | BuildRequires: php-pear-PhpDocumentor | |
24 | %endif | |
4419d6e6 | 25 | BuildRequires: rpmbuild(macros) >= 1.268 |
c65ad78d | 26 | Requires: php(core) >= 5.0 |
2ed1e242 ER |
27 | Requires: php(mysql) |
28 | Requires: php(pcre) | |
6ce579da | 29 | Requires: php(session) |
2ed1e242 | 30 | Requires: php(xml) |
b22e6573 ER |
31 | # includes/UserMailer.php: |
32 | #Requires: php-pear-Mail | |
613e8f16 | 33 | # Optional |
6ce579da | 34 | Requires: webapps |
349190d5 | 35 | #Suggests: ImageMagick or php-gd for thumbnails |
349190d5 | 36 | #Suggests: php-mmcache || php4-mmcache |
6ce579da | 37 | #Suggests: php-zlib |
3848a96c | 38 | Conflicts: apache-base < 2.4.0-1 |
7faae83c | 39 | BuildArch: noarch |
6b6d6010 | 40 | BuildRoot: %{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 | |
51 | MediaWiki is the collaborative editing software that runs Wikipedia, | |
52 | for 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 |
56 | MediaWiki to oprogramowanie do wspólnej edycji, na którym działa | |
57 | Wikipedia. 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 |
61 | Summary: MediaWiki setup package | |
38de538f | 62 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji MediaWiki |
613e8f16 | 63 | Group: Applications/WWW |
4419d6e6 | 64 | Requires: %{name} = %{epoch}:%{version}-%{release} |
2ed1e242 | 65 | Requires: php(posix) |
613e8f16 ER |
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 | ||
9ae185a8 JR |
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. | |
613e8f16 | 76 | |
6b6d6010 | 77 | %prep |
78 | %setup -q | |
458cb1c6 | 79 | %patch0 -p1 |
613e8f16 | 80 | |
1ba63b93 | 81 | find '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v |
f389e0ea | 82 | find -name '*.php5' | xargs rm -v |
6b6d6010 | 83 | |
84 | %install | |
85 | rm -rf $RPM_BUILD_ROOT | |
ea11228e | 86 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{_vardir}} |
1ba63b93 | 87 | |
ea11228e | 88 | cp -a mw-config extensions includes languages maintenance resources skins $RPM_BUILD_ROOT%{_appdir} |
89 | cp -a cache images $RPM_BUILD_ROOT%{_vardir} | |
87f2a94b | 90 | cp *.php $RPM_BUILD_ROOT%{_appdir} |
2a287787 | 91 | |
ea11228e | 92 | ln -s %{_vardir}/cache $RPM_BUILD_ROOT%{_appdir} |
93 | ln -s %{_vardir}/images $RPM_BUILD_ROOT%{_appdir} | |
94 | ||
5623fddf | 95 | install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
3848a96c | 96 | install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf |
2a287787 | 97 | |
6b6d6010 | 98 | %clean |
99 | rm -rf $RPM_BUILD_ROOT | |
2a287787 | 100 | |
1ba63b93 ER |
101 | %post setup |
102 | chmod 770 %{_sysconfdir} | |
103 | ||
104 | %postun setup | |
105 | if [ "$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 |
111 | fi |
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) | |
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 | |
1eb6a164 | 132 | |
1ba63b93 ER |
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 | |
5623fddf | 140 | |
1ba63b93 ER |
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 | |
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 |
153 | fi |
154 | ||
1ba63b93 ER |
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 | |
e3a7d789 ER |
176 | fi |
177 | fi | |
178 | ||
1ba63b93 | 179 | if [ "$httpd_reload" ]; then |
4419d6e6 | 180 | %service httpd reload |
e3a7d789 | 181 | fi |
1ba63b93 | 182 | if [ "$apache_reload" ]; then |
4419d6e6 | 183 | %service apache reload |
e3a7d789 | 184 | fi |
e3a7d789 | 185 | |
349190d5 ER |
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 | ||
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 |