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