]>
Commit | Line | Data |
---|---|---|
ac30c106 ER |
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 | |
e45b1eac | 6 | Release: 2.5 |
ac30c106 ER |
7 | License: GPL v2 |
8 | Group: Applications/WWW | |
ae8b679f ER |
9 | Source0: http://www.lokeshdhakar.com/projects/lightbox2/releases/lightbox2.04.zip |
10 | # Source0-md5: c930f97a5791f202d7c48303de36f282 | |
11 | Patch0: %{name}.patch | |
e45b1eac | 12 | Patch1: %{name}-dw-jscompress.patch |
ac30c106 | 13 | URL: http://wiki.splitbrain.org/plugin:lightboxv2 |
e45b1eac | 14 | BuildRequires: js |
f64bc347 | 15 | BuildRequires: sharutils |
e45b1eac | 16 | BuildRequires: shrinksafe |
ac30c106 ER |
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 | |
ae8b679f ER |
29 | %setup -qc -n %{plugin} |
30 | ( | |
31 | cat js/prototype.js | |
ae8b679f | 32 | cat js/effects.js |
df1ed666 | 33 | cat js/builder.js |
ae8b679f ER |
34 | cat js/lightbox.js |
35 | ) > script.js | |
36 | %patch0 -p1 | |
e45b1eac | 37 | %patch1 -p1 |
f64bc347 | 38 | uudecode blank.gif.uue |
ae8b679f ER |
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 | |
ac30c106 | 45 | |
e45b1eac ER |
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 | ||
ac30c106 ER |
59 | %install |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | install -d $RPM_BUILD_ROOT%{plugindir} | |
ae8b679f ER |
62 | cp -a images script.js $RPM_BUILD_ROOT%{plugindir} |
63 | cp -a css/lightbox.css $RPM_BUILD_ROOT%{plugindir}/screen.css | |
ac30c106 ER |
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 |