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