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