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