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