]> git.pld-linux.org Git - packages/minify.git/blob - minify.spec
up to 2.2.0
[packages/minify.git] / minify.spec
1 %define         php_min_version 5.2.1
2 %include        /usr/lib/rpm/macros.php
3 Summary:        Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads
4 Name:           minify
5 Version:        2.2.0
6 Release:        1
7 License:        New BSD License
8 Group:          Applications/WWW
9 Source0:        https://github.com/mrclay/minify/archive/%{version}/%{name}-%{version}.tar.gz
10 # Source0-md5:  25b45b2340cae680d169f75c8dcafbc7
11 Patch0:         paths.patch
12 Patch1:         pear-firephp.patch
13 Patch2:         yui-path.patch
14 # https://github.com/mrclay/minify/pull/69
15 Patch3:         https://github.com/glensc/minify/compare/contentfunc-params.patch
16 # Patch3-md5:   bb60232a8a119d1d2eb0caa71dca9207
17 Source1:        apache.conf
18 Source2:        lighttpd.conf
19 URL:            http://code.google.com/p/minify/
20 BuildRequires:  rpmbuild(macros) >= 1.654
21 BuildRequires:  unzip
22 Requires:       php(core) >= %{php_min_version}
23 Requires:       php(pcre)
24 Requires:       php-%{name} = %{version}-%{release}
25 Requires:       webapps
26 BuildArch:      noarch
27 BuildRoot:      %{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
35 # skip pear deps
36 %define         _noautoreq_pear .*Minify/Loader.php FirePHPCore/FirePHP.class.php
37
38 %description
39 Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules
40 for High Performance Web Sites.
41
42 It combines multiple CSS or Javascript files, removes unnecessary
43 whitespace and comments, and serves them with gzip encoding and
44 optimal client-side cache headers.
45
46 %package -n php-%{name}
47 Summary:        Minify Classes
48 Group:          Applications/WWW
49 Requires:       php(core) >= %{php_min_version}
50 Requires:       php(ctype)
51 Requires:       php(date)
52 Requires:       php(mbstring)
53 Requires:       php(pcre)
54 Requires:       php(spl)
55 Requires:       php-dirs
56 Suggests:       php-firephp-FirePHPCore
57
58 %description -n php-%{name}
59 Minify Classes.
60
61 %package builder
62 Summary:        Minify URI Builder
63 Group:          Applications/WWW
64 Requires:       %{name} = %{version}-%{release}
65 Requires:       php(core) >= %{php_min_version}
66 Requires:       php(pcre)
67
68 %description builder
69 Minify URI Builder.
70
71 %package unit_tests
72 Summary:        Unit tests for Minify
73 Group:          Applications/WWW
74 Requires:       %{name} = %{version}-%{release}
75
76 %description unit_tests
77 Unit tests for Minify.
78
79 %prep
80 %setup -q
81 %undos -f php
82 %patch0 -p1
83 %patch1 -p1
84 %patch2 -p1
85 %patch3 -p1
86 %undos UPGRADING.txt
87
88 find -type f | xargs chmod a-x
89
90 # not needed for functionality
91 %{__rm} min/lib/Minify/YUI/CssCompressor.java
92 %{__rm} -r min/lib/MrClay
93
94 # php-firephp-FirePHPCore
95 %{__rm} min/lib/FirePHP.php
96
97 # cleanup backups after patching
98 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102 install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}}
103
104 cp -a min/*.php min/builder $RPM_BUILD_ROOT%{_appdir}
105 cp -a min/lib/* $RPM_BUILD_ROOT%{php_data_dir}
106
107 for config in config.php groupsConfig.php; do
108         mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}}
109         ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir}
110 done
111
112 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
113 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
114 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
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
122 %triggerin -- apache < 2.2.0, apache-base
123 %webapp_register httpd %{_webapp}
124
125 %triggerun -- apache < 2.2.0, apache-base
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
135 rm -rf $RPM_BUILD_ROOT
136
137 %preun
138 if [ "$1" = 0 ]; then
139         echo %{cachedir}/* | xargs rm -rf
140 fi
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
165 %{php_data_dir}/CSSmin.php
166 %{php_data_dir}/DooDigestAuth.php
167 %{php_data_dir}/JSMin.php
168 %{php_data_dir}/JSMinPlus.php
169 %{php_data_dir}/Minify.php
170 %{php_data_dir}/Minify
This page took 0.1737 seconds and 3 git commands to generate.