]>
Commit | Line | Data |
---|---|---|
b54d08c7 ER |
1 | %define subver 2009-12-25 |
2 | %define ver %(echo %{subver} | tr -d -) | |
1807986d | 3 | %define php_min_version 5.1.2 |
067355f7 | 4 | %include /usr/lib/rpm/macros.php |
d73655e0 | 5 | Summary: PHP-based Wiki webapplication |
b9cde090 | 6 | Summary(pl.UTF-8): Aplikacja WWW Wiki oparta na PHP |
d73655e0 | 7 | Name: dokuwiki |
988b16db | 8 | Version: %{ver} |
af5aefcd | 9 | Release: 3 |
d73655e0 SP |
10 | License: GPL v2 |
11 | Group: Applications/WWW | |
616a9f7a ER |
12 | Source0: http://www.splitbrain.org/_media/projects/dokuwiki/%{name}-%{subver}c.tgz |
13 | # Source0-md5: 2649b6fecbcb273374f5be8f0a2edf02 | |
99646b81 ER |
14 | Source1: %{name}-apache.conf |
15 | Source2: %{name}-lighttpd.conf | |
db16581c ER |
16 | Source3: jude.png |
17 | # Source3-md5: 623344128960e18f86097dfee213ad4a | |
18 | Source4: eventum.gif | |
db16581c ER |
19 | Source5: http://forum.skype.com/style_emoticons/skype/skype.png |
20 | # Source5-md5: 25c355be038267dc9fdb724b628000b9 | |
dff16d0a ER |
21 | Source6: pld_button.png |
22 | # Source6-md5: 185afa921e81bd726b9f0f9f0909dc6e | |
107aba6f | 23 | Patch66: %{name}-config.patch |
641b29cc | 24 | Patch0: %{name}-paths.patch |
59f818e0 | 25 | Patch2: %{name}-mysqlauth.patch |
0a785872 | 26 | Patch3: %{name}-config-allow-require.patch |
48993817 | 27 | Patch4: %{name}-geshi.patch |
9e409dbc | 28 | Patch5: %{name}-http_auth-option.patch |
ff1d703f | 29 | Patch6: %{name}-nice_exit.patch |
19f4a739 | 30 | Patch7: %{name}-mail-headerencodequotes.patch |
e79c8784 | 31 | Patch8: %{name}-notify-respect-minor.patch |
6bda8de4 | 32 | Patch9: %{name}-media-userinfo.patch |
aea2faa7 | 33 | Patch10: %{name}-mailtext.patch |
1bf63c70 | 34 | Patch11: %{name}-notifyns.patch |
e21b2065 | 35 | Patch12: %{name}-mailthreads.patch |
369ed483 | 36 | Patch13: %{name}-media-directlink.patch |
e5ce8ca9 | 37 | Patch14: interwiki-outputonly.patch |
ae5a5f57 | 38 | Patch15: simplepie.patch |
bba17ba4 | 39 | Patch18: install.patch |
dff16d0a | 40 | Patch19: pld-branding.patch |
a3e2b241 | 41 | Patch20: fixprivilegeescalationbug.diff |
638afb06 | 42 | Patch21: task-1821.patch |
259e9b01 | 43 | Patch22: adldap.patch |
3aa37b5a | 44 | URL: http://www.dokuwiki.org/dokuwiki |
067355f7 | 45 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
db16581c | 46 | BuildRequires: rpmbuild(macros) >= 1.520 |
1807986d ER |
47 | Requires: php-common >= 4:%{php_min_version} |
48 | Requires: php-geshi >= 1.0.7.19 | |
988b16db | 49 | Requires: php-simplepie >= 1.0.1 |
bd481dc8 | 50 | Requires: php-xml |
d73655e0 | 51 | Requires: webapps |
105a71ba | 52 | Requires: webserver(access) |
24a3d556 | 53 | Requires: webserver(alias) |
bd481dc8 | 54 | Requires: webserver(php) |
259e9b01 | 55 | Suggests: php-adldap >= 3.3.1 |
bd481dc8 | 56 | Suggests: php-gd |
083e173b | 57 | # can use gz compression to store attic pages |
bd481dc8 | 58 | Suggests: php-zlib |
d73655e0 SP |
59 | BuildArch: noarch |
60 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
61 | ||
62 | %define _webapps /etc/webapps | |
63 | %define _webapp %{name} | |
64 | %define _sysconfdir %{_webapps}/%{_webapp} | |
65 | %define _appdir %{_datadir}/%{_webapp} | |
881190a4 | 66 | %define _localstatedir /var/lib/%{name} |
db16581c | 67 | %define find_lang %{_usrlibrpm}/dokuwiki-find-lang.sh %{buildroot} |
d73655e0 | 68 | |
067355f7 | 69 | # bad depsolver |
0a09ce01 | 70 | %define _noautopear 'pear(/usr/share/php/geshi.php)' 'pear(/usr/share/php/adLDAP.php)' |
1807986d ER |
71 | |
72 | # exclude optional php dependencies | |
616a9f7a | 73 | %define _noautophp php-bzip2 php-bcmath php-zip php-date php-ftp php-hash php-ldap php-mbstring php-mysql php-pgsql php-tokenizer |
1807986d ER |
74 | |
75 | %define _noautoreq %{_noautophp} %{_noautopear} | |
067355f7 | 76 | |
d73655e0 SP |
77 | %description |
78 | DokuWiki is a standards compliant, simple to use Wiki, mainly aimed at | |
79 | creating documentation of any kind. It is targeted at developer teams, | |
80 | workgroups and small companies. It has a simple but powerful syntax | |
81 | which makes sure the datafiles remain readable outside the Wiki and | |
82 | eases the creation of structured texts. All data is stored in plain | |
b9cde090 JB |
83 | text files - no database is required. |
84 | ||
85 | %description -l pl.UTF-8 | |
86 | DokuWiki to zgodne ze standardami i proste w użyciu Wiki, przeznaczone | |
87 | głównie do tworzenia dokumentów wszelkiego rodzaju. Jest przeznaczone | |
88 | dla zespołów programistów, grup roboczych i małych firm. Ma prostą, | |
89 | ale mającą duże możliwości składnię, dzięki której pliki danych | |
90 | pozostają czytelne poza Wiki, a także ułatwiającą tworzenie tekstów | |
91 | strukturalnych. Wszystkie dane są przechowywane w plikach tekstowych - | |
92 | nie jest wymagana baza danych. | |
d73655e0 | 93 | |
641b29cc | 94 | %package setup |
4c94baaa JB |
95 | Summary: DokuWiki setup package |
96 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji DokuWiki | |
641b29cc ER |
97 | Group: Applications/WWW |
98 | Requires: %{name} = %{version}-%{release} | |
99 | ||
100 | %description setup | |
4c94baaa | 101 | Install this package to configure initial DokuWiki installation. You |
641b29cc ER |
102 | should uninstall this package when you're done, as it considered |
103 | insecure to keep the setup files in place. | |
104 | ||
105 | %description setup -l pl.UTF-8 | |
4c94baaa | 106 | Ten pakiet należy zainstalować w celu wstępnej konfiguracji DokuWiki |
641b29cc ER |
107 | po pierwszej instalacji. Potem należy go odinstalować, jako że |
108 | pozostawienie plików instalacyjnych mogłoby być niebezpieczne. | |
109 | ||
d73655e0 | 110 | %prep |
b54d08c7 | 111 | %setup -q -n %{name}-%{subver} |
641b29cc | 112 | %patch0 -p1 |
59f818e0 | 113 | %patch2 -p1 |
0a785872 | 114 | %patch3 -p1 |
48993817 | 115 | %patch4 -p1 |
9e409dbc | 116 | %patch5 -p1 |
ff1d703f | 117 | %patch6 -p1 |
19f4a739 | 118 | %patch7 -p1 |
e79c8784 | 119 | %patch8 -p1 |
6bda8de4 | 120 | %patch9 -p1 |
aea2faa7 | 121 | %patch10 -p1 |
1bf63c70 | 122 | %patch11 -p1 |
e21b2065 | 123 | %patch12 -p1 |
369ed483 | 124 | %patch13 -p1 |
e5ce8ca9 | 125 | %patch14 -p1 |
ae5a5f57 | 126 | %patch15 -p1 |
bba17ba4 | 127 | %patch18 -p1 |
a3e2b241 ER |
128 | %patch19 -p1 |
129 | %patch20 -p1 | |
638afb06 | 130 | %patch21 -p1 |
259e9b01 | 131 | %patch22 -p1 |
d73655e0 | 132 | |
107aba6f ER |
133 | %patch66 -p1 |
134 | ||
7df7f76f | 135 | find -name _dummy | xargs rm |
a3e2b241 | 136 | rm lib/index.html lib/plugins/index.html inc/lang/.htaccess |
7df7f76f | 137 | |
2d01b400 ER |
138 | # safe file |
139 | mv conf/words.aspell{.dist,} | |
140 | ||
b3528e0c | 141 | # use system geshi package |
48993817 | 142 | rm -f inc/geshi.php |
b3528e0c ER |
143 | rm -rf inc/geshi |
144 | ||
259e9b01 ER |
145 | # use system adldap package |
146 | rm -f inc/adLDAP.php | |
147 | ||
ae5a5f57 ER |
148 | # use system simplepie package |
149 | rm -f inc/SimplePie.php | |
150 | ||
7df7f76f ER |
151 | # our plugins dir is not writable anyway, nothing to convert |
152 | rm -rf lib/plugins/upgradeplugindirectory | |
153 | ||
107aba6f ER |
154 | # flash source |
155 | rm -rf lib/_fla | |
156 | ||
08b33253 ER |
157 | # cleanup backups after patching |
158 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
159 | ||
107aba6f ER |
160 | %build |
161 | md5=$(md5sum -b conf/dokuwiki.php | awk '{print $1}') | |
162 | if ! grep $md5 install.php; then | |
af5aefcd | 163 | : update %{name}-config.patch -- it is outdated |
107aba6f ER |
164 | exit 1 |
165 | fi | |
166 | ||
d73655e0 SP |
167 | %install |
168 | rm -rf $RPM_BUILD_ROOT | |
641b29cc | 169 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_localstatedir},%{_appdir}/{bin,inc,lib}} |
d73655e0 SP |
170 | |
171 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} | |
641b29cc ER |
172 | cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin |
173 | cp -a inc/* $RPM_BUILD_ROOT%{_appdir}/inc | |
174 | cp -a lib/* $RPM_BUILD_ROOT%{_appdir}/lib | |
881190a4 ER |
175 | cp -a conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
176 | cp -a data/* $RPM_BUILD_ROOT%{_localstatedir} | |
107aba6f ER |
177 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
178 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
179 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
a4053ed1 ER |
180 | touch $RPM_BUILD_ROOT%{_sysconfdir}/acronyms.local.conf |
181 | touch $RPM_BUILD_ROOT%{_sysconfdir}/entities.local.conf | |
182 | touch $RPM_BUILD_ROOT%{_sysconfdir}/interwiki.local.conf | |
7df7f76f ER |
183 | touch $RPM_BUILD_ROOT%{_sysconfdir}/license.local.php |
184 | touch $RPM_BUILD_ROOT%{_sysconfdir}/local.php | |
185 | touch $RPM_BUILD_ROOT%{_sysconfdir}/local.protected.php | |
a4053ed1 ER |
186 | touch $RPM_BUILD_ROOT%{_sysconfdir}/mime.local.conf |
187 | touch $RPM_BUILD_ROOT%{_sysconfdir}/smileys.local.conf | |
d6d39525 | 188 | touch $RPM_BUILD_ROOT%{_sysconfdir}/userstyle.css |
d73655e0 | 189 | |
2d01b400 | 190 | ln $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/{dokubug,bug}.gif |
107aba6f | 191 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_appdir}/lib/images/fileicons/jide.png |
db16581c ER |
192 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/eventum.gif |
193 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/skype.gif | |
dff16d0a | 194 | cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_appdir}/lib/tpl/default/images/button-pld.png |
2d01b400 | 195 | |
fe631b5b | 196 | # find locales |
db16581c | 197 | %find_lang %{name}.lang |
fe631b5b | 198 | |
b607609a ER |
199 | # make inc/lang/en/edit.txt as %config |
200 | %{__sed} -i -e ' | |
201 | /%%lang([^)]\+) \/usr\/share\/dokuwiki\/inc\/lang\/[^/]\+/{ | |
202 | # make entry as %%dir | |
203 | s/^/%%dir /; p | |
204 | ||
205 | # add files inside the %dir | |
206 | s/^%%dir /%%config(noreplace) %%verify(not md5 mtime size) /; s/$/\/*.*/ | |
207 | }' %{name}.lang | |
208 | ||
d73655e0 SP |
209 | %clean |
210 | rm -rf $RPM_BUILD_ROOT | |
211 | ||
641b29cc ER |
212 | %post setup |
213 | chmod 770 %{_sysconfdir} | |
214 | chmod 660 %{_sysconfdir}/dokuwiki.php | |
215 | ||
216 | %postun setup | |
217 | if [ "$1" = "0" ]; then | |
1bf63c70 ER |
218 | if [ -f %{_sysconfdir}/dokuwiki.php ]; then |
219 | chmod 750 %{_sysconfdir} | |
220 | chmod 640 %{_sysconfdir}/dokuwiki.php | |
221 | fi | |
641b29cc ER |
222 | fi |
223 | ||
d73655e0 SP |
224 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
225 | %webapp_register apache %{_webapp} | |
226 | ||
227 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
228 | %webapp_unregister apache %{_webapp} | |
229 | ||
230 | %triggerin -- apache < 2.2.0, apache-base | |
231 | %webapp_register httpd %{_webapp} | |
232 | ||
233 | %triggerun -- apache < 2.2.0, apache-base | |
234 | %webapp_unregister httpd %{_webapp} | |
235 | ||
99646b81 ER |
236 | %triggerin -- lighttpd |
237 | %webapp_register lighttpd %{_webapp} | |
238 | ||
239 | %triggerun -- lighttpd | |
240 | %webapp_unregister lighttpd %{_webapp} | |
241 | ||
881190a4 ER |
242 | %pretrans |
243 | if [ -d %{_appdir}/data -a ! -L %{_appdir}/data ]; then | |
244 | mv -f %{_appdir}/data/* %{_localstatedir} | |
245 | rm -rf %{_appdir}/data | |
246 | fi | |
247 | if [ -d %{_appdir}/conf -a ! -L %{_appdir}/conf ]; then | |
248 | mv -f %{_appdir}/conf/* %{_sysconfdir} | |
249 | rm -rf %{_appdir}/conf | |
250 | fi | |
251 | exit 0 | |
252 | ||
fe631b5b | 253 | %files -f %{name}.lang |
d73655e0 | 254 | %defattr(644,root,root,755) |
08b33253 | 255 | %doc README |
d73655e0 SP |
256 | %dir %attr(750,root,http) %{_sysconfdir} |
257 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
258 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
99646b81 ER |
259 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
260 | ||
881190a4 | 261 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mediameta.php |
881190a4 | 262 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/msg |
2d01b400 | 263 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/words.aspell |
7df7f76f | 264 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scheme.conf |
a4053ed1 | 265 | |
a4053ed1 ER |
266 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/acronyms.local.conf |
267 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/entities.local.conf | |
268 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/interwiki.local.conf | |
7df7f76f ER |
269 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/license.local.php |
270 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/local.protected.php | |
a4053ed1 ER |
271 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.local.conf |
272 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smileys.local.conf | |
d6d39525 | 273 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/userstyle.css |
7df7f76f | 274 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/local.php |
2d01b400 | 275 | |
a4053ed1 | 276 | # use local.php,local.protected.php, etc for local changes |
a4053ed1 | 277 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/acronyms.conf |
7df7f76f | 278 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/dokuwiki.php |
a4053ed1 | 279 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/entities.conf |
fc7417e4 | 280 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/interwiki.conf |
7df7f76f | 281 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/license.php |
a4053ed1 ER |
282 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/mime.conf |
283 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/smileys.conf | |
b9fff555 | 284 | |
a4053ed1 | 285 | # samples. perhaps move to %doc instead? |
b9fff555 ER |
286 | %attr(640,root,http) %{_sysconfdir}/mysql.conf.php.example |
287 | %attr(640,root,http) %{_sysconfdir}/acl.auth.php.dist | |
288 | %attr(640,root,http) %{_sysconfdir}/wordblock.conf | |
289 | %attr(640,root,http) %{_sysconfdir}/local.php.dist | |
290 | %attr(640,root,http) %{_sysconfdir}/users.auth.php.dist | |
881190a4 | 291 | |
641b29cc | 292 | %dir %{_appdir} |
fe631b5b ER |
293 | %{_appdir}/doku.php |
294 | %{_appdir}/feed.php | |
295 | %{_appdir}/index.php | |
641b29cc ER |
296 | %dir %{_appdir}/bin |
297 | %attr(755,root,root) %{_appdir}/bin/dwpage.php | |
298 | %attr(755,root,root) %{_appdir}/bin/indexer.php | |
299 | %attr(755,root,root) %{_appdir}/bin/wantedpages.php | |
fe631b5b ER |
300 | |
301 | %dir %{_appdir}/inc | |
302 | %{_appdir}/inc/*.php | |
303 | %{_appdir}/inc/auth | |
304 | %{_appdir}/inc/parser | |
305 | ||
306 | %dir %{_appdir}/lib | |
307 | %dir %{_appdir}/lib/plugins | |
308 | %dir %{_appdir}/lib/plugins/acl | |
309 | %{_appdir}/lib/plugins/acl/*.* | |
08b33253 | 310 | %{_appdir}/lib/plugins/acl/pix |
fe631b5b ER |
311 | %dir %{_appdir}/lib/plugins/config |
312 | %{_appdir}/lib/plugins/config/*.* | |
107aba6f | 313 | %{_appdir}/lib/plugins/config/images |
fe631b5b ER |
314 | %{_appdir}/lib/plugins/config/settings |
315 | %dir %{_appdir}/lib/plugins/plugin | |
316 | %{_appdir}/lib/plugins/plugin/*.* | |
107aba6f | 317 | %{_appdir}/lib/plugins/plugin/classes |
fe631b5b ER |
318 | %dir %{_appdir}/lib/plugins/revert |
319 | %{_appdir}/lib/plugins/revert/*.* | |
320 | %dir %{_appdir}/lib/plugins/usermanager | |
321 | %{_appdir}/lib/plugins/usermanager/*.* | |
322 | %{_appdir}/lib/plugins/usermanager/images | |
fe631b5b | 323 | %{_appdir}/lib/plugins/info |
08b33253 ER |
324 | %dir %{_appdir}/lib/plugins/popularity |
325 | %{_appdir}/lib/plugins/popularity/*.* | |
fe631b5b ER |
326 | %{_appdir}/lib/plugins/*.php |
327 | %{_appdir}/lib/images | |
328 | %{_appdir}/lib/scripts | |
329 | %{_appdir}/lib/styles | |
330 | %{_appdir}/lib/tpl | |
331 | %{_appdir}/lib/exe | |
881190a4 ER |
332 | |
333 | %dir %attr(770,root,http) %{_localstatedir} | |
334 | %dir %attr(770,root,http) %{_localstatedir}/attic | |
335 | %dir %attr(770,root,http) %{_localstatedir}/cache | |
336 | %dir %attr(770,root,http) %{_localstatedir}/index | |
337 | %dir %attr(770,root,http) %{_localstatedir}/locks | |
338 | %dir %attr(770,root,http) %{_localstatedir}/media | |
339 | %dir %attr(770,root,http) %{_localstatedir}/media/wiki | |
340 | %dir %attr(770,root,http) %{_localstatedir}/meta | |
341 | %dir %attr(770,root,http) %{_localstatedir}/pages | |
af5aefcd | 342 | %dir %attr(770,root,http) %{_localstatedir}/pages/playground |
881190a4 | 343 | %dir %attr(770,root,http) %{_localstatedir}/pages/wiki |
08b33253 | 344 | %dir %attr(770,root,http) %{_localstatedir}/tmp |
b9fff555 | 345 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/media/wiki/dokuwiki-128.png |
b9fff555 ER |
346 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/wiki/dokuwiki.txt |
347 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/wiki/syntax.txt | |
8e4e22ac | 348 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/playground/playground.txt |
641b29cc ER |
349 | |
350 | %files setup | |
351 | %defattr(644,root,root,755) | |
352 | %{_appdir}/install.php |