]>
Commit | Line | Data |
---|---|---|
54267275 ER |
1 | # TODO |
2 | # - pkg for mousewheel | |
3 | %define plugin fancybox | |
6c3387e9 | 4 | Summary: Fancybox - Fancy lightbox alternative |
54267275 | 5 | Name: jquery-%{plugin} |
6c3387e9 | 6 | Version: 1.3.1 |
54267275 | 7 | Release: 1 |
6545f82b | 8 | License: MIT / GPL v2 |
6c3387e9 ER |
9 | Group: Applications/WWW |
10 | Source0: http://fancybox.googlecode.com/files/jquery.fancybox-%{version}.zip | |
11 | # Source0-md5: d72d950a798ffaa83750dfd6e4a0e382 | |
12 | URL: http://www.fancybox.net/ | |
54267275 | 13 | BuildRequires: rpmbuild(macros) >= 1.565 |
9fc9fbf6 | 14 | BuildRequires: unzip |
6c3387e9 ER |
15 | Requires: jquery >= 1.3 |
16 | BuildArch: noarch | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
54267275 | 19 | %define _appdir %{_datadir}/jquery/%{plugin} |
6c3387e9 ER |
20 | |
21 | %description | |
22 | FancyBox is a tool for displaying images, html content and multi-media | |
23 | in a Mac-style "lightbox" that floats overtop of web page. | |
24 | ||
6545f82b | 25 | Features include: |
6c3387e9 ER |
26 | - Can display images, HTML elements, SWF movies, Iframes and also Ajax |
27 | requests | |
28 | - Customizable through settings and CSS | |
29 | - Groups related items and adds navigation. | |
30 | - If the mouse wheel plugin is included in the page then FancyBox will | |
31 | respond to mouse wheel events as well | |
32 | - Support fancy transitions by using easing plugin | |
33 | - Adds a nice drop shadow under the zoomed item | |
34 | ||
35 | %package demo | |
36 | Summary: Demo for jQuery.fancybox | |
37 | Summary(pl.UTF-8): Pliki demonstracyjne dla pakietu jQuery.fancybox | |
38 | Group: Development | |
39 | Requires: %{name} = %{version}-%{release} | |
40 | ||
41 | %description demo | |
42 | Demonstrations and samples for jQuery.fancybox. | |
43 | ||
44 | %prep | |
45 | %setup -qn jquery.fancybox-%{version} | |
46 | ||
54267275 | 47 | %undos -f js,html,txt |
6c3387e9 ER |
48 | |
49 | mv fancybox/jquery.fancybox{-%{version},}.css | |
50 | mv fancybox/jquery.fancybox{-%{version}.pack,}.js | |
6545f82b ER |
51 | |
52 | # source | |
53 | install -d demo src | |
54 | mv fancybox/jquery.fancybox-%{version}.js src/jquery.fancybox.js | |
55 | ||
56 | # deps - rename for now | |
57 | mv fancybox/jquery.easing{-1.3.pack,}.js # ? not used? | |
6c3387e9 | 58 | mv fancybox/jquery.mousewheel{-3.0.2.pack,}.js |
54267275 ER |
59 | # otherwise yuicompressor won't pack |
60 | sed -i -e 's,^/\*!,/*,' fancybox/jquery.mousewheel.js | |
6545f82b ER |
61 | |
62 | # adjust demos to work offline | |
63 | mv index.html style.css ajax.txt example demo | |
54267275 | 64 | ln -s %{_datadir}/jquery demo |
6545f82b ER |
65 | |
66 | sed -i -e ' | |
54267275 ER |
67 | s,./fancybox/jquery.fancybox-1.3.1.js,jquery/fancybox/fancybox.js, |
68 | s,./fancybox/jquery.fancybox-1.3.1.css,jquery/fancybox/fancybox.css, | |
6545f82b | 69 | |
54267275 | 70 | s,http://code.jquery.com/jquery-1.4.2.min.js,jquery/jquery.js, |
6545f82b | 71 | |
54267275 | 72 | s,./fancybox/jquery.mousewheel-3.0.2.pack.js,jquery/fancybox/mousewheel.js, |
6545f82b ER |
73 | |
74 | s,./example/,example/,g | |
75 | ' demo/index.html | |
6c3387e9 | 76 | |
54267275 ER |
77 | %build |
78 | install -d build | |
79 | ||
80 | # compress .js | |
81 | for js in fancybox/*.js; do | |
82 | out=build/${js#*/jquery.} | |
83 | yuicompressor --charset UTF-8 $js -o $out | |
84 | js -C -f $out | |
85 | done | |
86 | ||
87 | # pack .css | |
88 | for css in fancybox/*.css; do | |
89 | out=build/${css#*/jquery.} | |
90 | yuicompressor --charset UTF-8 $css -o $out | |
91 | done | |
92 | ||
93 | cp -a fancybox/*.png build | |
94 | cp -a fancybox/*.gif build | |
95 | ||
6c3387e9 ER |
96 | %install |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_examplesdir}/%{name}-%{version}} | |
54267275 | 99 | cp -a build/* $RPM_BUILD_ROOT%{_appdir} |
6545f82b | 100 | cp -a demo/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
6c3387e9 ER |
101 | |
102 | %clean | |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | ||
105 | %files | |
106 | %defattr(644,root,root,755) | |
54267275 | 107 | %{_appdir} |
6c3387e9 ER |
108 | |
109 | %files demo | |
110 | %defattr(644,root,root,755) | |
111 | %{_examplesdir}/%{name}-%{version} |