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