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