]> git.pld-linux.org Git - packages/minify.git/blame - minify.spec
- php deps, use system firephp package (from pear dir)
[packages/minify.git] / minify.spec
CommitLineData
42993e38
ER
1%define php_min_version 5.2.1
2%include /usr/lib/rpm/macros.php
981a47f4
ER
3Summary: Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads
4Name: minify
6626a6f2 5Version: 2.1.4
42993e38 6Release: 0.15
981a47f4
ER
7License: New BSD License
8Group: Applications/WWW
ed36d77a
ER
9#Source0: http://minify.googlecode.com/files/%{name}_%{version}_beta.zip
10Source0: https://github.com/mrclay/minify/tarball/master#/%{name}.tgz
11# Source0-md5: 2eeff0f069b52b89ba78c22d20de60e2
3e524d3a 12Patch0: paths.patch
42993e38 13Patch1: pear-firephp.patch
981a47f4
ER
14Source1: apache.conf
15Source2: lighttpd.conf
16URL: http://code.google.com/p/minify/
17BuildRequires: rpmbuild(macros) >= 1.553
15a438fc 18BuildRequires: unzip
981a47f4 19Requires: php-%{name} = %{version}-%{release}
42993e38
ER
20Requires: php-common >= 4:%{php_min_version}
21Requires: php-pcre
981a47f4
ER
22Requires: webapps
23BuildArch: noarch
24BuildRoot: %{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
33Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules
34for High Performance Web Sites.
35
36It combines multiple CSS or Javascript files, removes unnecessary
37whitespace and comments, and serves them with gzip encoding and
38optimal client-side cache headers.
39
40%package -n php-%{name}
41Summary: Minify Classes
42Group: Applications/WWW
42993e38
ER
43Requires: php-common >= 4:%{php_min_version}
44Requires: php-date
45Requires: php-dirs
46Requires: php-mbstring
47Requires: php-pcre
48Suggests: php-firephp-FirePHPCore
981a47f4
ER
49
50%description -n php-%{name}
51Minify Classes.
52
53%package builder
54Summary: Minify URI Builder
55Group: Applications/WWW
56Requires: %{name} = %{version}-%{release}
42993e38
ER
57Requires: php-common >= 4:%{php_min_version}
58Requires: php-pcre
981a47f4
ER
59
60%description builder
61Minify URI Builder.
62
63%package unit_tests
64Summary: Unit tests for Minify
65Group: Applications/WWW
66Requires: %{name} = %{version}-%{release}
67
68%description unit_tests
69Unit tests for Minify.
70
71%prep
72%setup -qc
ed36d77a 73mv mrclay-minify-*/* .
42993e38 74%undos -f php
3e524d3a 75%patch0 -p1
42993e38 76%patch1 -p1
981a47f4 77%undos UPGRADING.txt
981a47f4
ER
78
79mv min/README.txt README.min.txt
80
42993e38
ER
81# php-firephp-FirePHPCore
82rm min/lib/FirePHP.php
83
981a47f4
ER
84%install
85rm -rf $RPM_BUILD_ROOT
86install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}}
87
3e524d3a
ER
88cp -a min/*.php min/builder $RPM_BUILD_ROOT%{_appdir}
89cp -a min/lib/* $RPM_BUILD_ROOT%{php_data_dir}
981a47f4
ER
90
91for config in config.php groupsConfig.php; do
92 mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}}
93 ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir}
94done
95
3e524d3a
ER
96cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
97cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
98cp -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
119rm -rf $RPM_BUILD_ROOT
120
121%preun
122if [ "$1" = 0 ]; then
123 echo %{cachedir}/* | xargs rm -rf
124fi
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
This page took 0.110189 seconds and 4 git commands to generate.