]>
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} | |
7b6f32f6 ER |
5 | Version: 20090312 |
6 | Release: 1 | |
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 | |
a10348f8 ER |
12 | Patch1: %{name}-konqueror.patch |
13 | Patch2: %{name}-dw-jscompress.patch | |
ac30c106 | 14 | URL: http://wiki.splitbrain.org/plugin:lightboxv2 |
e45b1eac | 15 | BuildRequires: js |
f64bc347 | 16 | BuildRequires: sharutils |
e45b1eac | 17 | BuildRequires: shrinksafe |
ac30c106 ER |
18 | Requires: dokuwiki >= 20061106 |
19 | BuildArch: noarch | |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
21 | ||
22 | %define dokuconf /etc/webapps/dokuwiki | |
7b6f32f6 | 23 | %define dokudir /usr/share/dokuwiki |
ac30c106 ER |
24 | %define plugindir %{dokudir}/lib/plugins/%{plugin} |
25 | ||
26 | %description | |
27 | Plugin to integrate LightBox v2 javascript animation in DokuWiki. | |
28 | ||
29 | %prep | |
ae8b679f | 30 | %setup -qc -n %{plugin} |
ceaa8242 ER |
31 | %patch0 -p1 |
32 | %patch1 -p1 | |
33 | %patch2 -p1 | |
ae8b679f ER |
34 | ( |
35 | cat js/prototype.js | |
ae8b679f | 36 | cat js/effects.js |
df1ed666 | 37 | cat js/builder.js |
ae8b679f ER |
38 | cat js/lightbox.js |
39 | ) > script.js | |
f64bc347 | 40 | uudecode blank.gif.uue |
ae8b679f ER |
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 | |
ac30c106 | 47 | |
e45b1eac ER |
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 | } | |
a10348f8 | 59 | js_compress script.js |
e45b1eac | 60 | |
ac30c106 ER |
61 | %install |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | install -d $RPM_BUILD_ROOT%{plugindir} | |
ae8b679f ER |
64 | cp -a images script.js $RPM_BUILD_ROOT%{plugindir} |
65 | cp -a css/lightbox.css $RPM_BUILD_ROOT%{plugindir}/screen.css | |
ac30c106 ER |
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 |