]>
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 | |
4ca11b01 | 5 | Version: 3.0 |
591473b3 | 6 | Release: 2.3 |
981a47f4 ER |
7 | License: New BSD License |
8 | Group: Applications/WWW | |
4ca11b01 | 9 | #Source0: https://github.com/mrclay/minify/archive/%{version}/%{name}-%{version}.tar.gz |
0f2f0225 | 10 | #Source0: https://github.com/glensc/minify/archive/lessphp-dev3/%{name}-%{version}.tar.gz |
1751fa7f ER |
11 | Source0: https://github.com/mrclay/minify/archive/e271c37/%{name}-%{version}.tar.gz |
12 | # Source0-md5: 4691fc13004fa5863bbfece3f70f6f6a | |
3e524d3a | 13 | Patch0: paths.patch |
42993e38 | 14 | Patch1: pear-firephp.patch |
f3d01beb | 15 | Patch2: yui-path.patch |
93d46ec2 | 16 | Patch3: contentfunc-params.patch |
ab52a567 ER |
17 | Source1: apache.conf |
18 | Source2: lighttpd.conf | |
0f2f0225 | 19 | URL: https://github.com/mrclay/minify |
591473b3 | 20 | BuildRequires: phpab |
95c64b7e | 21 | BuildRequires: rpmbuild(macros) >= 1.654 |
15a438fc | 22 | BuildRequires: unzip |
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 |
95c64b7e | 35 | %define _noautoreq_pear .*Minify/Loader.php FirePHPCore/FirePHP.class.php |
c6db73a7 | 36 | |
981a47f4 ER |
37 | %description |
38 | Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules | |
39 | for High Performance Web Sites. | |
40 | ||
41 | It combines multiple CSS or Javascript files, removes unnecessary | |
42 | whitespace and comments, and serves them with gzip encoding and | |
43 | optimal client-side cache headers. | |
44 | ||
45 | %package -n php-%{name} | |
46 | Summary: Minify Classes | |
47 | Group: Applications/WWW | |
1a6e11b9 | 48 | Requires: php(core) >= %{php_min_version} |
eab9097f ER |
49 | Requires: php(ctype) |
50 | Requires: php(date) | |
21f19bc8 ER |
51 | Requires: php(mbstring) |
52 | Requires: php(pcre) | |
eab9097f | 53 | Requires: php(spl) |
42993e38 | 54 | Requires: php-dirs |
656c761a ER |
55 | Requires: php-yui-css-compressor |
56 | Suggests: lessphp >= 0.4.0 | |
42993e38 | 57 | Suggests: php-firephp-FirePHPCore |
981a47f4 ER |
58 | |
59 | %description -n php-%{name} | |
60 | Minify Classes. | |
61 | ||
62 | %package builder | |
63 | Summary: Minify URI Builder | |
64 | Group: Applications/WWW | |
65 | Requires: %{name} = %{version}-%{release} | |
1a6e11b9 | 66 | Requires: php(core) >= %{php_min_version} |
21f19bc8 | 67 | Requires: php(pcre) |
981a47f4 ER |
68 | |
69 | %description builder | |
70 | Minify URI Builder. | |
71 | ||
72 | %package unit_tests | |
73 | Summary: Unit tests for Minify | |
74 | Group: Applications/WWW | |
75 | Requires: %{name} = %{version}-%{release} | |
76 | ||
77 | %description unit_tests | |
78 | Unit tests for Minify. | |
79 | ||
80 | %prep | |
4ca11b01 ER |
81 | %setup -qc |
82 | mv %{name}-*/* . | |
42993e38 | 83 | %undos -f php |
3e524d3a | 84 | %patch0 -p1 |
42993e38 | 85 | %patch1 -p1 |
f3d01beb | 86 | %patch2 -p1 |
6d697cfd | 87 | %patch3 -p1 |
981a47f4 | 88 | %undos UPGRADING.txt |
981a47f4 | 89 | |
f3d01beb ER |
90 | find -type f | xargs chmod a-x |
91 | ||
5aff6a93 | 92 | # not needed for functionality |
0f2f0225 | 93 | %{__rm} -r lib/MrClay |
656c761a | 94 | |
f3d01beb ER |
95 | # cleanup backups after patching |
96 | find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
97 | ||
591473b3 ER |
98 | %build |
99 | phpab -n -e '*/tests/*' -o lib/Minify/autoload.php -b lib/Minify . | |
100 | ||
981a47f4 ER |
101 | %install |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}} | |
104 | ||
1751fa7f ER |
105 | cp -a *.php builder $RPM_BUILD_ROOT%{_appdir} |
106 | cp -a lib/* $RPM_BUILD_ROOT%{php_data_dir} | |
981a47f4 ER |
107 | |
108 | for config in config.php groupsConfig.php; do | |
109 | mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}} | |
110 | ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir} | |
111 | done | |
112 | ||
3e524d3a ER |
113 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
114 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
ab52a567 | 115 | cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf |
981a47f4 ER |
116 | |
117 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
118 | %webapp_register apache %{_webapp} | |
119 | ||
120 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
121 | %webapp_unregister apache %{_webapp} | |
122 | ||
ab52a567 | 123 | %triggerin -- apache < 2.2.0, apache-base |
981a47f4 ER |
124 | %webapp_register httpd %{_webapp} |
125 | ||
ab52a567 | 126 | %triggerun -- apache < 2.2.0, apache-base |
981a47f4 ER |
127 | %webapp_unregister httpd %{_webapp} |
128 | ||
129 | %triggerin -- lighttpd | |
130 | %webapp_register lighttpd %{_webapp} | |
131 | ||
132 | %triggerun -- lighttpd | |
133 | %webapp_unregister lighttpd %{_webapp} | |
134 | ||
135 | %clean | |
136 | rm -rf $RPM_BUILD_ROOT | |
137 | ||
138 | %preun | |
139 | if [ "$1" = 0 ]; then | |
140 | echo %{cachedir}/* | xargs rm -rf | |
141 | fi | |
142 | ||
143 | %files | |
144 | %defattr(644,root,root,755) | |
145 | %doc *.txt | |
146 | %dir %attr(750,root,http) %{_sysconfdir} | |
147 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
148 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
149 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
150 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
151 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/groupsConfig.php | |
152 | %dir %{_appdir} | |
153 | %{_appdir}/*.php | |
154 | ||
155 | %dir %attr(771,root,http) %{cachedir} | |
156 | ||
157 | %files builder | |
158 | %defattr(644,root,root,755) | |
159 | %{_appdir}/builder | |
160 | ||
161 | %files -n php-%{name} | |
162 | %defattr(644,root,root,755) | |
163 | %dir %{php_data_dir}/HTTP | |
164 | %{php_data_dir}/HTTP/ConditionalGet.php | |
165 | %{php_data_dir}/HTTP/Encoder.php | |
51765038 | 166 | %{php_data_dir}/DooDigestAuth.php |
981a47f4 ER |
167 | %{php_data_dir}/Minify.php |
168 | %{php_data_dir}/Minify |