]> git.pld-linux.org Git - packages/minify.git/blob - minify.spec
up to 3.0-273a08f
[packages/minify.git] / minify.spec
1 %define         php_min_version 5.2.1
2 %define         subver  273a08f
3 %include        /usr/lib/rpm/macros.php
4 Summary:        Combines, minifies, and caches JavaScript and CSS files on demand to speed up page loads
5 Name:           minify
6 Version:        3.0
7 Release:        2.6
8 License:        New BSD License
9 Group:          Applications/WWW
10 #Source0:       https://github.com/mrclay/minify/archive/%{version}/%{name}-%{version}.tar.gz
11 #Source0:       https://github.com/glensc/minify/archive/lessphp-dev3/%{name}-%{version}.tar.gz
12 Source0:        https://github.com/mrclay/minify/archive/%{subver}/%{name}-%{version}-%{subver}.tar.gz
13 # Source0-md5:  524e397b24721820b04a57dac4419875
14 Patch0:         paths.patch
15 Patch1:         pear-firephp.patch
16 Patch2:         yui-path.patch
17 Patch3:         contentfunc-params.patch
18 Source1:        apache.conf
19 Source2:        lighttpd.conf
20 URL:            https://github.com/mrclay/minify
21 BuildRequires:  phpab
22 BuildRequires:  rpmbuild(macros) >= 1.654
23 BuildRequires:  unzip
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 Requires:       php-yui-css-compressor
57 Suggests:       lessphp >= 0.4.0
58 Suggests:       php-firephp-FirePHPCore
59
60 %description -n php-%{name}
61 Minify Classes.
62
63 %package builder
64 Summary:        Minify URI Builder
65 Group:          Applications/WWW
66 Requires:       %{name} = %{version}-%{release}
67 Requires:       php(core) >= %{php_min_version}
68 Requires:       php(pcre)
69
70 %description builder
71 Minify URI Builder.
72
73 %package unit_tests
74 Summary:        Unit tests for Minify
75 Group:          Applications/WWW
76 Requires:       %{name} = %{version}-%{release}
77
78 %description unit_tests
79 Unit tests for Minify.
80
81 %prep
82 %setup -qc
83 mv %{name}-*/* .
84 %undos -f php
85 %patch0 -p1
86 %patch1 -p1
87 %patch2 -p1
88 %patch3 -p1
89 %undos UPGRADING.txt
90
91 find -type f | xargs chmod a-x
92
93 # not needed for functionality
94 %{__rm} -r lib/MrClay
95
96 # cleanup backups after patching
97 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
98
99 %build
100 phpab -n -e '*/tests/*' -o lib/Minify/autoload.php -b lib/Minify .
101
102 %install
103 rm -rf $RPM_BUILD_ROOT
104 install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_sysconfdir},%{_appdir},%{cachedir}}
105
106 cp -a *.php builder $RPM_BUILD_ROOT%{_appdir}
107 cp -a lib/* $RPM_BUILD_ROOT%{php_data_dir}
108
109 for config in config.php groupsConfig.php; do
110         mv $RPM_BUILD_ROOT{%{_appdir}/$config,%{_sysconfdir}}
111         ln -s %{_sysconfdir}/$config $RPM_BUILD_ROOT%{_appdir}
112 done
113
114 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
115 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
116 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
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
124 %triggerin -- apache < 2.2.0, apache-base
125 %webapp_register httpd %{_webapp}
126
127 %triggerun -- apache < 2.2.0, apache-base
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
137 rm -rf $RPM_BUILD_ROOT
138
139 %preun
140 if [ "$1" = 0 ]; then
141         echo %{cachedir}/* | xargs rm -rf
142 fi
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
167 %{php_data_dir}/DooDigestAuth.php
168 %{php_data_dir}/Minify.php
169 %{php_data_dir}/Minify
This page took 0.097765 seconds and 3 git commands to generate.