]>
Commit | Line | Data |
---|---|---|
981a47f4 ER |
1 | Summary: Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads |
2 | Name: minify | |
6626a6f2 ER |
3 | Version: 2.1.4 |
4 | Release: 0.10 | |
981a47f4 ER |
5 | License: New BSD License |
6 | Group: Applications/WWW | |
6626a6f2 ER |
7 | Source0: http://minify.googlecode.com/files/%{name}_%{version}_beta.zip |
8 | # Source0-md5: f604b827980a8994c1b4dfd6f5974786 | |
981a47f4 ER |
9 | Source1: apache.conf |
10 | Source2: lighttpd.conf | |
11 | URL: http://code.google.com/p/minify/ | |
12 | BuildRequires: rpmbuild(macros) >= 1.553 | |
15a438fc | 13 | BuildRequires: unzip |
981a47f4 ER |
14 | Requires: php-%{name} = %{version}-%{release} |
15 | Requires: webapps | |
16 | BuildArch: noarch | |
17 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
18 | ||
19 | %define _webapps /etc/webapps | |
20 | %define _webapp %{name} | |
21 | %define _sysconfdir %{_webapps}/%{_webapp} | |
22 | %define _appdir %{_datadir}/%{_webapp} | |
23 | %define cachedir /var/cache/%{name} | |
24 | ||
25 | %description | |
26 | Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules | |
27 | for High Performance Web Sites. | |
28 | ||
29 | It combines multiple CSS or Javascript files, removes unnecessary | |
30 | whitespace and comments, and serves them with gzip encoding and | |
31 | optimal client-side cache headers. | |
32 | ||
33 | %package -n php-%{name} | |
34 | Summary: Minify Classes | |
35 | Group: Applications/WWW | |
36 | ||
37 | %description -n php-%{name} | |
38 | Minify Classes. | |
39 | ||
40 | %package builder | |
41 | Summary: Minify URI Builder | |
42 | Group: Applications/WWW | |
43 | Requires: %{name} = %{version}-%{release} | |
44 | ||
45 | %description builder | |
46 | Minify URI Builder. | |
47 | ||
48 | %package unit_tests | |
49 | Summary: Unit tests for Minify | |
50 | Group: Applications/WWW | |
51 | Requires: %{name} = %{version}-%{release} | |
52 | ||
53 | %description unit_tests | |
54 | Unit tests for Minify. | |
55 | ||
56 | %prep | |
57 | %setup -qc | |
58 | %undos UPGRADING.txt | |
59 | %undos -f php | |
60 | ||
61 | mv min/README.txt README.min.txt | |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}} | |
66 | ||
67 | cp -a min/* $RPM_BUILD_ROOT%{_appdir} | |
68 | ||
69 | mv $RPM_BUILD_ROOT%{_appdir}/lib/* $RPM_BUILD_ROOT%{php_data_dir} | |
70 | ||
71 | for config in config.php groupsConfig.php; do | |
72 | mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}} | |
73 | ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir} | |
74 | done | |
75 | ||
76 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
77 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
78 | cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf | |
79 | ||
80 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
81 | %webapp_register apache %{_webapp} | |
82 | ||
83 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
84 | %webapp_unregister apache %{_webapp} | |
85 | ||
86 | %triggerin -- apache < 2.2.0, apache-base | |
87 | %webapp_register httpd %{_webapp} | |
88 | ||
89 | %triggerun -- apache < 2.2.0, apache-base | |
90 | %webapp_unregister httpd %{_webapp} | |
91 | ||
92 | %triggerin -- lighttpd | |
93 | %webapp_register lighttpd %{_webapp} | |
94 | ||
95 | %triggerun -- lighttpd | |
96 | %webapp_unregister lighttpd %{_webapp} | |
97 | ||
98 | %clean | |
99 | rm -rf $RPM_BUILD_ROOT | |
100 | ||
101 | %preun | |
102 | if [ "$1" = 0 ]; then | |
103 | echo %{cachedir}/* | xargs rm -rf | |
104 | fi | |
105 | ||
106 | %files | |
107 | %defattr(644,root,root,755) | |
108 | %doc *.txt | |
109 | %dir %attr(750,root,http) %{_sysconfdir} | |
110 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
111 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
112 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
113 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
114 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/groupsConfig.php | |
115 | %dir %{_appdir} | |
116 | %{_appdir}/*.php | |
117 | ||
118 | %dir %attr(771,root,http) %{cachedir} | |
119 | ||
120 | %files builder | |
121 | %defattr(644,root,root,755) | |
122 | %{_appdir}/builder | |
123 | ||
124 | %files -n php-%{name} | |
125 | %defattr(644,root,root,755) | |
126 | %dir %{php_data_dir}/HTTP | |
127 | %{php_data_dir}/HTTP/ConditionalGet.php | |
128 | %{php_data_dir}/HTTP/Encoder.php | |
129 | %{php_data_dir}/FirePHP.php | |
130 | %{php_data_dir}/JSMin.php | |
131 | %{php_data_dir}/JSMinPlus.php | |
132 | %{php_data_dir}/Minify.php | |
133 | %{php_data_dir}/Minify | |
134 | %dir %{php_data_dir}/Solar | |
135 | %{php_data_dir}/Solar/Dir.php |