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