]>
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 |
eab9097f | 6 | Release: 7 |
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 | |
eab9097f | 11 | # Source0-md5: 7ead5f2bc26630c16b206c7c50e2aba1 |
51765038 | 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 |
eab9097f | 35 | %define _noautopear pear(.*Minify/Loader.php) 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} |
eab9097f ER |
52 | Requires: php(ctype) |
53 | Requires: php(date) | |
21f19bc8 ER |
54 | Requires: php(mbstring) |
55 | Requires: php(pcre) | |
eab9097f | 56 | Requires: php(spl) |
42993e38 | 57 | Requires: php-dirs |
42993e38 | 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} | |
1a6e11b9 | 67 | Requires: php(core) >= %{php_min_version} |
21f19bc8 | 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 -qc |
83 | mv *-minify-*/* . | |
42993e38 | 84 | %undos -f php |
3e524d3a | 85 | %patch0 -p1 |
42993e38 | 86 | %patch1 -p1 |
f3d01beb | 87 | %patch2 -p1 |
981a47f4 | 88 | %undos UPGRADING.txt |
981a47f4 | 89 | |
f3d01beb ER |
90 | find -type f | xargs chmod a-x |
91 | ||
5aff6a93 ER |
92 | # not needed for functionality |
93 | %{__rm} min/lib/Minify/YUI/CssCompressor.java | |
94 | %{__rm} -r min/lib/MrClay | |
95 | ||
42993e38 | 96 | # php-firephp-FirePHPCore |
5aff6a93 | 97 | %{__rm} min/lib/FirePHP.php |
42993e38 | 98 | |
f3d01beb ER |
99 | # cleanup backups after patching |
100 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
101 | ||
981a47f4 ER |
102 | %install |
103 | rm -rf $RPM_BUILD_ROOT | |
104 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}} | |
105 | ||
3e524d3a ER |
106 | cp -a min/*.php min/builder $RPM_BUILD_ROOT%{_appdir} |
107 | cp -a min/lib/* $RPM_BUILD_ROOT%{php_data_dir} | |
981a47f4 ER |
108 | |
109 | for config in config.php groupsConfig.php; do | |
110 | mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}} | |
111 | ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir} | |
112 | done | |
113 | ||
3e524d3a ER |
114 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
115 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
116 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf | |
981a47f4 ER |
117 | |
118 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
119 | %webapp_register apache %{_webapp} | |
120 | ||
121 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
122 | %webapp_unregister apache %{_webapp} | |
123 | ||
124 | %triggerin -- apache < 2.2.0, apache-base | |
125 | %webapp_register httpd %{_webapp} | |
126 | ||
127 | %triggerun -- apache < 2.2.0, apache-base | |
128 | %webapp_unregister httpd %{_webapp} | |
129 | ||
130 | %triggerin -- lighttpd | |
131 | %webapp_register lighttpd %{_webapp} | |
132 | ||
133 | %triggerun -- lighttpd | |
134 | %webapp_unregister lighttpd %{_webapp} | |
135 | ||
136 | %clean | |
137 | rm -rf $RPM_BUILD_ROOT | |
138 | ||
139 | %preun | |
140 | if [ "$1" = 0 ]; then | |
141 | echo %{cachedir}/* | xargs rm -rf | |
142 | fi | |
143 | ||
144 | %files | |
145 | %defattr(644,root,root,755) | |
146 | %doc *.txt | |
147 | %dir %attr(750,root,http) %{_sysconfdir} | |
148 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
149 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
150 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
151 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
152 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/groupsConfig.php | |
153 | %dir %{_appdir} | |
154 | %{_appdir}/*.php | |
155 | ||
156 | %dir %attr(771,root,http) %{cachedir} | |
157 | ||
158 | %files builder | |
159 | %defattr(644,root,root,755) | |
160 | %{_appdir}/builder | |
161 | ||
162 | %files -n php-%{name} | |
163 | %defattr(644,root,root,755) | |
164 | %dir %{php_data_dir}/HTTP | |
165 | %{php_data_dir}/HTTP/ConditionalGet.php | |
166 | %{php_data_dir}/HTTP/Encoder.php | |
eab9097f | 167 | %{php_data_dir}/CSSmin.php |
51765038 | 168 | %{php_data_dir}/DooDigestAuth.php |
981a47f4 ER |
169 | %{php_data_dir}/JSMin.php |
170 | %{php_data_dir}/JSMinPlus.php | |
171 | %{php_data_dir}/Minify.php | |
172 | %{php_data_dir}/Minify |