]> git.pld-linux.org Git - packages/minify.git/blame - minify.spec
up to 3.0-273a08f
[packages/minify.git] / minify.spec
CommitLineData
42993e38 1%define php_min_version 5.2.1
359417ca 2%define subver 273a08f
42993e38 3%include /usr/lib/rpm/macros.php
981a47f4
ER
4Summary: Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads
5Name: minify
4ca11b01 6Version: 3.0
359417ca 7Release: 2.6
981a47f4
ER
8License: New BSD License
9Group: Applications/WWW
4ca11b01 10#Source0: https://github.com/mrclay/minify/archive/%{version}/%{name}-%{version}.tar.gz
0f2f0225 11#Source0: https://github.com/glensc/minify/archive/lessphp-dev3/%{name}-%{version}.tar.gz
359417ca
ER
12Source0: https://github.com/mrclay/minify/archive/%{subver}/%{name}-%{version}-%{subver}.tar.gz
13# Source0-md5: 524e397b24721820b04a57dac4419875
3e524d3a 14Patch0: paths.patch
42993e38 15Patch1: pear-firephp.patch
f3d01beb 16Patch2: yui-path.patch
93d46ec2 17Patch3: contentfunc-params.patch
ab52a567
ER
18Source1: apache.conf
19Source2: lighttpd.conf
0f2f0225 20URL: https://github.com/mrclay/minify
591473b3 21BuildRequires: phpab
95c64b7e 22BuildRequires: rpmbuild(macros) >= 1.654
15a438fc 23BuildRequires: unzip
981a47f4
ER
24Requires: php-%{name} = %{version}-%{release}
25Requires: webapps
26BuildArch: noarch
27BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29%define _webapps /etc/webapps
30%define _webapp %{name}
31%define _sysconfdir %{_webapps}/%{_webapp}
32%define _appdir %{_datadir}/%{_webapp}
33%define cachedir /var/cache/%{name}
34
c6db73a7 35# skip pear deps
95c64b7e 36%define _noautoreq_pear .*Minify/Loader.php FirePHPCore/FirePHP.class.php
c6db73a7 37
981a47f4
ER
38%description
39Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules
40for High Performance Web Sites.
41
42It combines multiple CSS or Javascript files, removes unnecessary
43whitespace and comments, and serves them with gzip encoding and
44optimal client-side cache headers.
45
46%package -n php-%{name}
47Summary: Minify Classes
48Group: Applications/WWW
1a6e11b9 49Requires: php(core) >= %{php_min_version}
eab9097f
ER
50Requires: php(ctype)
51Requires: php(date)
21f19bc8
ER
52Requires: php(mbstring)
53Requires: php(pcre)
eab9097f 54Requires: php(spl)
42993e38 55Requires: php-dirs
656c761a
ER
56Requires: php-yui-css-compressor
57Suggests: lessphp >= 0.4.0
42993e38 58Suggests: php-firephp-FirePHPCore
981a47f4
ER
59
60%description -n php-%{name}
61Minify Classes.
62
63%package builder
64Summary: Minify URI Builder
65Group: Applications/WWW
66Requires: %{name} = %{version}-%{release}
1a6e11b9 67Requires: php(core) >= %{php_min_version}
21f19bc8 68Requires: php(pcre)
981a47f4
ER
69
70%description builder
71Minify URI Builder.
72
73%package unit_tests
74Summary: Unit tests for Minify
75Group: Applications/WWW
76Requires: %{name} = %{version}-%{release}
77
78%description unit_tests
79Unit tests for Minify.
80
81%prep
4ca11b01
ER
82%setup -qc
83mv %{name}-*/* .
42993e38 84%undos -f php
3e524d3a 85%patch0 -p1
42993e38 86%patch1 -p1
f3d01beb 87%patch2 -p1
6d697cfd 88%patch3 -p1
981a47f4 89%undos UPGRADING.txt
981a47f4 90
f3d01beb
ER
91find -type f | xargs chmod a-x
92
5aff6a93 93# not needed for functionality
0f2f0225 94%{__rm} -r lib/MrClay
656c761a 95
f3d01beb
ER
96# cleanup backups after patching
97find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
98
591473b3
ER
99%build
100phpab -n -e '*/tests/*' -o lib/Minify/autoload.php -b lib/Minify .
101
981a47f4
ER
102%install
103rm -rf $RPM_BUILD_ROOT
104install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}}
105
1751fa7f
ER
106cp -a *.php builder $RPM_BUILD_ROOT%{_appdir}
107cp -a lib/* $RPM_BUILD_ROOT%{php_data_dir}
981a47f4
ER
108
109for config in config.php groupsConfig.php; do
110 mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}}
111 ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir}
112done
113
3e524d3a
ER
114cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
115cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
ab52a567 116cp -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
ab52a567 124%triggerin -- apache < 2.2.0, apache-base
981a47f4
ER
125%webapp_register httpd %{_webapp}
126
ab52a567 127%triggerun -- apache < 2.2.0, apache-base
981a47f4
ER
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
137rm -rf $RPM_BUILD_ROOT
138
139%preun
140if [ "$1" = 0 ]; then
141 echo %{cachedir}/* | xargs rm -rf
142fi
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
51765038 167%{php_data_dir}/DooDigestAuth.php
981a47f4
ER
168%{php_data_dir}/Minify.php
169%{php_data_dir}/Minify
This page took 0.127637 seconds and 4 git commands to generate.