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