]> git.pld-linux.org Git - packages/minify.git/blame - minify.spec
- pull whole diff from issue #28
[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
8bc6d0a8 5Version: 2.1.5
b10b4d40 6Release: 3
981a47f4
ER
7License: New BSD License
8Group: Applications/WWW
51765038
ER
9#Source0: https://minify.googlecode.com/files/%{name}-%{version}.zip
10Source0: https://github.com/mrclay/minify/tarball/master#/%{name}-%{version}.tgz
11# Source0-md5: b2c39b7edf323e99232141b8d25cbde4
12#Source0: https://github.com/glensc/minify/tarball/lesscss#/%{name}-less-%{version}.tgz
3e524d3a 13Patch0: paths.patch
42993e38 14Patch1: pear-firephp.patch
f3d01beb 15Patch2: yui-path.patch
b10b4d40
ER
16Patch3: https://github.com/glensc/minify/compare/master...issue-28.patch
17# Patch3-md5: 7becc6d49be446e5c304ecab9f19cae4
981a47f4
ER
18Source1: apache.conf
19Source2: lighttpd.conf
20URL: http://code.google.com/p/minify/
21BuildRequires: rpmbuild(macros) >= 1.553
15a438fc 22BuildRequires: unzip
981a47f4 23Requires: php-%{name} = %{version}-%{release}
42993e38
ER
24Requires: php-common >= 4:%{php_min_version}
25Requires: php-pcre
981a47f4
ER
26Requires: webapps
27BuildArch: noarch
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%define _webapps /etc/webapps
31%define _webapp %{name}
32%define _sysconfdir %{_webapps}/%{_webapp}
33%define _appdir %{_datadir}/%{_webapp}
34%define cachedir /var/cache/%{name}
35
c6db73a7 36# skip pear deps
ae20e76f 37%define _noautopear pear(Minify.*) pear(JSMin.*) pear(HTTP/ConditionalGet.php) pear(HTTP/Encoder.php) Requires: pear(FirePHPCore/FirePHP.class.php)
c6db73a7
ER
38
39# put it together for rpmbuild
40%define _noautoreq %{?_noautophp} %{?_noautopear}
41
981a47f4
ER
42%description
43Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules
44for High Performance Web Sites.
45
46It combines multiple CSS or Javascript files, removes unnecessary
47whitespace and comments, and serves them with gzip encoding and
48optimal client-side cache headers.
49
50%package -n php-%{name}
51Summary: Minify Classes
52Group: Applications/WWW
42993e38
ER
53Requires: php-common >= 4:%{php_min_version}
54Requires: php-date
55Requires: php-dirs
56Requires: php-mbstring
57Requires: php-pcre
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}
42993e38
ER
67Requires: php-common >= 4:%{php_min_version}
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
51765038
ER
82#%setup
83%setup -qc
84mv *-minify-*/* .
42993e38 85%undos -f php
3e524d3a 86%patch0 -p1
42993e38 87%patch1 -p1
f3d01beb 88%patch2 -p1
51765038 89%patch3 -p1
981a47f4 90%undos UPGRADING.txt
981a47f4 91
f3d01beb
ER
92find -type f | xargs chmod a-x
93
8bc6d0a8 94#mv min/README.txt README.min.txt
981a47f4 95
5aff6a93
ER
96# not needed for functionality
97%{__rm} min/lib/Minify/YUI/CssCompressor.java
98%{__rm} -r min/lib/MrClay
99
42993e38 100# php-firephp-FirePHPCore
5aff6a93 101%{__rm} min/lib/FirePHP.php
42993e38 102
f3d01beb
ER
103# cleanup backups after patching
104find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
105
981a47f4
ER
106%install
107rm -rf $RPM_BUILD_ROOT
108install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}}
109
3e524d3a
ER
110cp -a min/*.php min/builder $RPM_BUILD_ROOT%{_appdir}
111cp -a min/lib/* $RPM_BUILD_ROOT%{php_data_dir}
981a47f4
ER
112
113for config in config.php groupsConfig.php; do
114 mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}}
115 ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir}
116done
117
3e524d3a
ER
118cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
119cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
120cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
981a47f4
ER
121
122%triggerin -- apache1 < 1.3.37-3, apache1-base
123%webapp_register apache %{_webapp}
124
125%triggerun -- apache1 < 1.3.37-3, apache1-base
126%webapp_unregister apache %{_webapp}
127
128%triggerin -- apache < 2.2.0, apache-base
129%webapp_register httpd %{_webapp}
130
131%triggerun -- apache < 2.2.0, apache-base
132%webapp_unregister httpd %{_webapp}
133
134%triggerin -- lighttpd
135%webapp_register lighttpd %{_webapp}
136
137%triggerun -- lighttpd
138%webapp_unregister lighttpd %{_webapp}
139
140%clean
141rm -rf $RPM_BUILD_ROOT
142
143%preun
144if [ "$1" = 0 ]; then
145 echo %{cachedir}/* | xargs rm -rf
146fi
147
148%files
149%defattr(644,root,root,755)
150%doc *.txt
151%dir %attr(750,root,http) %{_sysconfdir}
152%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
153%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
154%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
155%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
156%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/groupsConfig.php
157%dir %{_appdir}
158%{_appdir}/*.php
159
160%dir %attr(771,root,http) %{cachedir}
161
162%files builder
163%defattr(644,root,root,755)
164%{_appdir}/builder
165
166%files -n php-%{name}
167%defattr(644,root,root,755)
168%dir %{php_data_dir}/HTTP
169%{php_data_dir}/HTTP/ConditionalGet.php
170%{php_data_dir}/HTTP/Encoder.php
51765038
ER
171%{php_data_dir}/CSSMin.php
172%{php_data_dir}/DooDigestAuth.php
981a47f4
ER
173%{php_data_dir}/JSMin.php
174%{php_data_dir}/JSMinPlus.php
175%{php_data_dir}/Minify.php
176%{php_data_dir}/Minify
This page took 0.062002 seconds and 4 git commands to generate.