- enable konqueror patch
[packages/dokuwiki-plugin-lightbox.git] / dokuwiki-plugin-lightbox.spec
1 %define         plugin          lightbox
2 Summary:        DokuWiki Light Box v2 plugin
3 Summary(pl.UTF-8):      Wtyczka lightboxv2 dla DokuWiki
4 Name:           dokuwiki-plugin-%{plugin}
5 Version:        20080808
6 Release:        2.9
7 License:        GPL v2
8 Group:          Applications/WWW
9 Source0:        http://www.lokeshdhakar.com/projects/lightbox2/releases/lightbox2.04.zip
10 # Source0-md5:  c930f97a5791f202d7c48303de36f282
11 Patch0:         %{name}.patch
12 Patch1:         %{name}-konqueror.patch
13 Patch2:         %{name}-dw-jscompress.patch
14 URL:            http://wiki.splitbrain.org/plugin:lightboxv2
15 BuildRequires:  js
16 BuildRequires:  sharutils
17 BuildRequires:  shrinksafe
18 Requires:       dokuwiki >= 20061106
19 BuildArch:      noarch
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         dokuconf        /etc/webapps/dokuwiki
23 %define         dokudir /usr/share/dokuwiki
24 %define         plugindir       %{dokudir}/lib/plugins/%{plugin}
25
26 %description
27 Plugin to integrate LightBox v2 javascript animation in DokuWiki.
28
29 %prep
30 %setup -qc -n %{plugin}
31 (
32         cat js/prototype.js
33         cat js/effects.js
34         cat js/builder.js
35         cat js/lightbox.js
36 ) > script.js
37 %patch0 -p1
38 %patch1 -p1
39 %patch2 -p1
40 uudecode blank.gif.uue
41
42 rm -f images/bullet.gif
43 rm -f images/donate-button.gif
44 rm -f images/download-icon.gif
45 rm -f images/image-1.jpg
46 rm -f images/thumb-1.jpg
47
48 %build
49 js_compress() {
50         for a in "$@"; do
51                 # compress
52                 shrinksafe -c script.js > $a.tmp && mv $a.tmp script.js
53                 # trim newlines
54                 tr -d '\r\n' < script.js > $a.tmp && mv $a.tmp script.js
55                 # check syntax
56                 js -C -f script.js
57         done
58 }
59 js_compress script.js
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{plugindir}
64 cp -a images script.js $RPM_BUILD_ROOT%{plugindir}
65 cp -a css/lightbox.css $RPM_BUILD_ROOT%{plugindir}/screen.css
66
67 %clean
68 rm -rf $RPM_BUILD_ROOT
69
70 %post
71 # force css cache refresh
72 if [ -f %{dokuconf}/local.php ]; then
73         touch %{dokuconf}/local.php
74 fi
75
76 %files
77 %defattr(644,root,root,755)
78 %dir %{plugindir}
79 %{plugindir}/*.css
80 %{plugindir}/*.js
81 %{plugindir}/images
This page took 0.110356 seconds and 3 git commands to generate.