]>
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} |
b90e9913 | 9 | Release: 1 |
d73655e0 SP |
10 | License: GPL v2 |
11 | Group: Applications/WWW | |
b54d08c7 ER |
12 | Source0: http://www.splitbrain.org/_media/projects/dokuwiki/%{name}-%{subver}.tgz |
13 | # Source0-md5: 1428c896de83bd2a754efd18919d0594 | |
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 | |
cb50e4a6 | 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 | # we don't want php(xxx) being resolved to php-xxx | |
76 | %define _noautoreqdep '^php(.*)' | |
77 | ||
78 | %define _noautoreq %{_noautophp} %{_noautopear} | |
067355f7 | 79 | |
d73655e0 SP |
80 | %description |
81 | DokuWiki is a standards compliant, simple to use Wiki, mainly aimed at | |
82 | creating documentation of any kind. It is targeted at developer teams, | |
83 | workgroups and small companies. It has a simple but powerful syntax | |
84 | which makes sure the datafiles remain readable outside the Wiki and | |
85 | eases the creation of structured texts. All data is stored in plain | |
b9cde090 JB |
86 | text files - no database is required. |
87 | ||
88 | %description -l pl.UTF-8 | |
89 | DokuWiki to zgodne ze standardami i proste w użyciu Wiki, przeznaczone | |
90 | głównie do tworzenia dokumentów wszelkiego rodzaju. Jest przeznaczone | |
91 | dla zespołów programistów, grup roboczych i małych firm. Ma prostą, | |
92 | ale mającą duże możliwości składnię, dzięki której pliki danych | |
93 | pozostają czytelne poza Wiki, a także ułatwiającą tworzenie tekstów | |
94 | strukturalnych. Wszystkie dane są przechowywane w plikach tekstowych - | |
95 | nie jest wymagana baza danych. | |
d73655e0 | 96 | |
641b29cc | 97 | %package setup |
4c94baaa JB |
98 | Summary: DokuWiki setup package |
99 | Summary(pl.UTF-8): Pakiet do wstępnej konfiguracji DokuWiki | |
641b29cc ER |
100 | Group: Applications/WWW |
101 | Requires: %{name} = %{version}-%{release} | |
102 | ||
103 | %description setup | |
4c94baaa | 104 | Install this package to configure initial DokuWiki installation. You |
641b29cc ER |
105 | should uninstall this package when you're done, as it considered |
106 | insecure to keep the setup files in place. | |
107 | ||
108 | %description setup -l pl.UTF-8 | |
4c94baaa | 109 | Ten pakiet należy zainstalować w celu wstępnej konfiguracji DokuWiki |
641b29cc ER |
110 | po pierwszej instalacji. Potem należy go odinstalować, jako że |
111 | pozostawienie plików instalacyjnych mogłoby być niebezpieczne. | |
112 | ||
d73655e0 | 113 | %prep |
b54d08c7 | 114 | %setup -q -n %{name}-%{subver} |
641b29cc | 115 | %patch0 -p1 |
59f818e0 | 116 | %patch2 -p1 |
0a785872 | 117 | %patch3 -p1 |
48993817 | 118 | %patch4 -p1 |
9e409dbc | 119 | %patch5 -p1 |
ff1d703f | 120 | %patch6 -p1 |
19f4a739 | 121 | %patch7 -p1 |
e79c8784 | 122 | %patch8 -p1 |
6bda8de4 | 123 | %patch9 -p1 |
aea2faa7 | 124 | %patch10 -p1 |
1bf63c70 | 125 | %patch11 -p1 |
e21b2065 | 126 | %patch12 -p1 |
369ed483 | 127 | %patch13 -p1 |
e5ce8ca9 | 128 | %patch14 -p1 |
ae5a5f57 | 129 | %patch15 -p1 |
bba17ba4 | 130 | %patch18 -p1 |
a3e2b241 ER |
131 | %patch19 -p1 |
132 | %patch20 -p1 | |
638afb06 | 133 | %patch21 -p1 |
259e9b01 | 134 | %patch22 -p1 |
d73655e0 | 135 | |
107aba6f ER |
136 | %patch66 -p1 |
137 | ||
7df7f76f | 138 | find -name _dummy | xargs rm |
a3e2b241 | 139 | rm lib/index.html lib/plugins/index.html inc/lang/.htaccess |
7df7f76f | 140 | |
2d01b400 ER |
141 | # safe file |
142 | mv conf/words.aspell{.dist,} | |
143 | ||
b3528e0c | 144 | # use system geshi package |
48993817 | 145 | rm -f inc/geshi.php |
b3528e0c ER |
146 | rm -rf inc/geshi |
147 | ||
259e9b01 ER |
148 | # use system adldap package |
149 | rm -f inc/adLDAP.php | |
150 | ||
ae5a5f57 ER |
151 | # use system simplepie package |
152 | rm -f inc/SimplePie.php | |
153 | ||
7df7f76f ER |
154 | # our plugins dir is not writable anyway, nothing to convert |
155 | rm -rf lib/plugins/upgradeplugindirectory | |
156 | ||
107aba6f ER |
157 | # flash source |
158 | rm -rf lib/_fla | |
159 | ||
08b33253 ER |
160 | # cleanup backups after patching |
161 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
162 | ||
107aba6f ER |
163 | %build |
164 | md5=$(md5sum -b conf/dokuwiki.php | awk '{print $1}') | |
165 | if ! grep $md5 install.php; then | |
166 | : update %{name}-config.patch oudated | |
167 | exit 1 | |
168 | fi | |
169 | ||
d73655e0 SP |
170 | %install |
171 | rm -rf $RPM_BUILD_ROOT | |
641b29cc | 172 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_localstatedir},%{_appdir}/{bin,inc,lib}} |
d73655e0 SP |
173 | |
174 | cp -a *.php $RPM_BUILD_ROOT%{_appdir} | |
641b29cc ER |
175 | cp -a bin/* $RPM_BUILD_ROOT%{_appdir}/bin |
176 | cp -a inc/* $RPM_BUILD_ROOT%{_appdir}/inc | |
177 | cp -a lib/* $RPM_BUILD_ROOT%{_appdir}/lib | |
881190a4 ER |
178 | cp -a conf/* $RPM_BUILD_ROOT%{_sysconfdir} |
179 | cp -a data/* $RPM_BUILD_ROOT%{_localstatedir} | |
107aba6f ER |
180 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
181 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
182 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
a4053ed1 ER |
183 | touch $RPM_BUILD_ROOT%{_sysconfdir}/acronyms.local.conf |
184 | touch $RPM_BUILD_ROOT%{_sysconfdir}/entities.local.conf | |
185 | touch $RPM_BUILD_ROOT%{_sysconfdir}/interwiki.local.conf | |
7df7f76f ER |
186 | touch $RPM_BUILD_ROOT%{_sysconfdir}/license.local.php |
187 | touch $RPM_BUILD_ROOT%{_sysconfdir}/local.php | |
188 | touch $RPM_BUILD_ROOT%{_sysconfdir}/local.protected.php | |
a4053ed1 ER |
189 | touch $RPM_BUILD_ROOT%{_sysconfdir}/mime.local.conf |
190 | touch $RPM_BUILD_ROOT%{_sysconfdir}/smileys.local.conf | |
d6d39525 | 191 | touch $RPM_BUILD_ROOT%{_sysconfdir}/userstyle.css |
d73655e0 | 192 | |
2d01b400 | 193 | ln $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/{dokubug,bug}.gif |
107aba6f | 194 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_appdir}/lib/images/fileicons/jide.png |
db16581c ER |
195 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/eventum.gif |
196 | cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_appdir}/lib/images/interwiki/skype.gif | |
dff16d0a | 197 | cp -a %{SOURCE6} $RPM_BUILD_ROOT%{_appdir}/lib/tpl/default/images/button-pld.png |
2d01b400 | 198 | |
fe631b5b | 199 | # find locales |
db16581c | 200 | %find_lang %{name}.lang |
fe631b5b | 201 | |
b607609a ER |
202 | # make inc/lang/en/edit.txt as %config |
203 | %{__sed} -i -e ' | |
204 | /%%lang([^)]\+) \/usr\/share\/dokuwiki\/inc\/lang\/[^/]\+/{ | |
205 | # make entry as %%dir | |
206 | s/^/%%dir /; p | |
207 | ||
208 | # add files inside the %dir | |
209 | s/^%%dir /%%config(noreplace) %%verify(not md5 mtime size) /; s/$/\/*.*/ | |
210 | }' %{name}.lang | |
211 | ||
d73655e0 SP |
212 | %clean |
213 | rm -rf $RPM_BUILD_ROOT | |
214 | ||
641b29cc ER |
215 | %post setup |
216 | chmod 770 %{_sysconfdir} | |
217 | chmod 660 %{_sysconfdir}/dokuwiki.php | |
218 | ||
219 | %postun setup | |
220 | if [ "$1" = "0" ]; then | |
1bf63c70 ER |
221 | if [ -f %{_sysconfdir}/dokuwiki.php ]; then |
222 | chmod 750 %{_sysconfdir} | |
223 | chmod 640 %{_sysconfdir}/dokuwiki.php | |
224 | fi | |
641b29cc ER |
225 | fi |
226 | ||
d73655e0 SP |
227 | %triggerin -- apache1 < 1.3.37-3, apache1-base |
228 | %webapp_register apache %{_webapp} | |
229 | ||
230 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
231 | %webapp_unregister apache %{_webapp} | |
232 | ||
233 | %triggerin -- apache < 2.2.0, apache-base | |
234 | %webapp_register httpd %{_webapp} | |
235 | ||
236 | %triggerun -- apache < 2.2.0, apache-base | |
237 | %webapp_unregister httpd %{_webapp} | |
238 | ||
99646b81 ER |
239 | %triggerin -- lighttpd |
240 | %webapp_register lighttpd %{_webapp} | |
241 | ||
242 | %triggerun -- lighttpd | |
243 | %webapp_unregister lighttpd %{_webapp} | |
244 | ||
881190a4 ER |
245 | %pretrans |
246 | if [ -d %{_appdir}/data -a ! -L %{_appdir}/data ]; then | |
247 | mv -f %{_appdir}/data/* %{_localstatedir} | |
248 | rm -rf %{_appdir}/data | |
249 | fi | |
250 | if [ -d %{_appdir}/conf -a ! -L %{_appdir}/conf ]; then | |
251 | mv -f %{_appdir}/conf/* %{_sysconfdir} | |
252 | rm -rf %{_appdir}/conf | |
253 | fi | |
254 | exit 0 | |
255 | ||
fe631b5b | 256 | %files -f %{name}.lang |
d73655e0 | 257 | %defattr(644,root,root,755) |
08b33253 | 258 | %doc README |
d73655e0 SP |
259 | %dir %attr(750,root,http) %{_sysconfdir} |
260 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
261 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
99646b81 ER |
262 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf |
263 | ||
881190a4 | 264 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mediameta.php |
881190a4 | 265 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/msg |
2d01b400 | 266 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/words.aspell |
7df7f76f | 267 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scheme.conf |
a4053ed1 | 268 | |
a4053ed1 ER |
269 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/acronyms.local.conf |
270 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/entities.local.conf | |
271 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/interwiki.local.conf | |
7df7f76f ER |
272 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/license.local.php |
273 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/local.protected.php | |
a4053ed1 ER |
274 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mime.local.conf |
275 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/smileys.local.conf | |
d6d39525 | 276 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/userstyle.css |
7df7f76f | 277 | %attr(660,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/local.php |
2d01b400 | 278 | |
a4053ed1 | 279 | # use local.php,local.protected.php, etc for local changes |
a4053ed1 | 280 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/acronyms.conf |
7df7f76f | 281 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/dokuwiki.php |
a4053ed1 | 282 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/entities.conf |
fc7417e4 | 283 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/interwiki.conf |
7df7f76f | 284 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/license.php |
a4053ed1 ER |
285 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/mime.conf |
286 | %attr(640,root,http) %config %verify(not md5 mtime size) %{_sysconfdir}/smileys.conf | |
b9fff555 | 287 | |
a4053ed1 | 288 | # samples. perhaps move to %doc instead? |
b9fff555 ER |
289 | %attr(640,root,http) %{_sysconfdir}/mysql.conf.php.example |
290 | %attr(640,root,http) %{_sysconfdir}/acl.auth.php.dist | |
291 | %attr(640,root,http) %{_sysconfdir}/wordblock.conf | |
292 | %attr(640,root,http) %{_sysconfdir}/local.php.dist | |
293 | %attr(640,root,http) %{_sysconfdir}/users.auth.php.dist | |
881190a4 | 294 | |
641b29cc | 295 | %dir %{_appdir} |
fe631b5b ER |
296 | %{_appdir}/doku.php |
297 | %{_appdir}/feed.php | |
298 | %{_appdir}/index.php | |
641b29cc ER |
299 | %dir %{_appdir}/bin |
300 | %attr(755,root,root) %{_appdir}/bin/dwpage.php | |
301 | %attr(755,root,root) %{_appdir}/bin/indexer.php | |
302 | %attr(755,root,root) %{_appdir}/bin/wantedpages.php | |
fe631b5b ER |
303 | |
304 | %dir %{_appdir}/inc | |
305 | %{_appdir}/inc/*.php | |
306 | %{_appdir}/inc/auth | |
307 | %{_appdir}/inc/parser | |
308 | ||
309 | %dir %{_appdir}/lib | |
310 | %dir %{_appdir}/lib/plugins | |
311 | %dir %{_appdir}/lib/plugins/acl | |
312 | %{_appdir}/lib/plugins/acl/*.* | |
08b33253 | 313 | %{_appdir}/lib/plugins/acl/pix |
fe631b5b ER |
314 | %dir %{_appdir}/lib/plugins/config |
315 | %{_appdir}/lib/plugins/config/*.* | |
107aba6f | 316 | %{_appdir}/lib/plugins/config/images |
fe631b5b ER |
317 | %{_appdir}/lib/plugins/config/settings |
318 | %dir %{_appdir}/lib/plugins/plugin | |
319 | %{_appdir}/lib/plugins/plugin/*.* | |
107aba6f | 320 | %{_appdir}/lib/plugins/plugin/classes |
fe631b5b ER |
321 | %dir %{_appdir}/lib/plugins/revert |
322 | %{_appdir}/lib/plugins/revert/*.* | |
323 | %dir %{_appdir}/lib/plugins/usermanager | |
324 | %{_appdir}/lib/plugins/usermanager/*.* | |
325 | %{_appdir}/lib/plugins/usermanager/images | |
fe631b5b | 326 | %{_appdir}/lib/plugins/info |
08b33253 ER |
327 | %dir %{_appdir}/lib/plugins/popularity |
328 | %{_appdir}/lib/plugins/popularity/*.* | |
fe631b5b ER |
329 | %{_appdir}/lib/plugins/*.php |
330 | %{_appdir}/lib/images | |
331 | %{_appdir}/lib/scripts | |
332 | %{_appdir}/lib/styles | |
333 | %{_appdir}/lib/tpl | |
334 | %{_appdir}/lib/exe | |
881190a4 ER |
335 | |
336 | %dir %attr(770,root,http) %{_localstatedir} | |
337 | %dir %attr(770,root,http) %{_localstatedir}/attic | |
338 | %dir %attr(770,root,http) %{_localstatedir}/cache | |
339 | %dir %attr(770,root,http) %{_localstatedir}/index | |
340 | %dir %attr(770,root,http) %{_localstatedir}/locks | |
341 | %dir %attr(770,root,http) %{_localstatedir}/media | |
342 | %dir %attr(770,root,http) %{_localstatedir}/media/wiki | |
343 | %dir %attr(770,root,http) %{_localstatedir}/meta | |
344 | %dir %attr(770,root,http) %{_localstatedir}/pages | |
881190a4 | 345 | %dir %attr(770,root,http) %{_localstatedir}/pages/wiki |
08b33253 | 346 | %dir %attr(770,root,http) %{_localstatedir}/tmp |
b9fff555 | 347 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/media/wiki/dokuwiki-128.png |
b9fff555 ER |
348 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/wiki/dokuwiki.txt |
349 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/wiki/syntax.txt | |
8e4e22ac | 350 | %attr(660,root,http) %config(noreplace,missingok) %verify(not md5 mtime size) %{_localstatedir}/pages/playground/playground.txt |
641b29cc ER |
351 | |
352 | %files setup | |
353 | %defattr(644,root,root,755) | |
354 | %{_appdir}/install.php |