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