]>
Commit | Line | Data |
---|---|---|
aa9af101 ER |
1 | # TODO |
2 | # - make tests use secure dir, not /tmp, see varnish-2.0.6/bin/varnishtest | |
b8084133 | 3 | # - hungs ac builders: tests/a00009.vtc |
bc2dc646 | 4 | |
aa9af101 | 5 | # Conditional build: |
2bf7dafb ER |
6 | %bcond_without doc # build documentation |
7 | %bcond_without tests # build without tests. binds daemon on 127.0.0.1 9080, 9081, 9001 ports | |
a2cd7ef5 | 8 | %bcond_without source # build source package |
aa9af101 | 9 | |
4b603a01 | 10 | Summary: Varnish - a high-performance HTTP accelerator |
496ca552 | 11 | Summary(pl.UTF-8): Varnish - wydajny akcelerator HTTP |
fe8e4400 | 12 | Name: varnish |
897b832b | 13 | Version: 3.0.5 |
1388570a | 14 | Release: 3 |
44c9906d | 15 | License: BSD |
b8497be7 | 16 | Group: Networking/Daemons/HTTP |
bc2dc646 | 17 | Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz |
d4acec15 | 18 | # Source0-md5: 674d44775cc927aee4601edb37f60198 |
3c755ca1 | 19 | Source1: %{name}.init |
3415b5fe ER |
20 | Source3: %{name}ncsa.init |
21 | Source4: %{name}.sysconfig | |
7fa0d756 ER |
22 | Source5: %{name}ncsa.sysconfig |
23 | Source6: %{name}.logrotate | |
275af167 | 24 | Source8: %{name}.tmpfiles |
0ab06c2d | 25 | #Patch100: branch.diff |
c7e762f7 | 26 | Patch0: no-ccache.patch |
1388570a | 27 | Patch1: no-sysctl.patch |
4b603a01 | 28 | URL: http://www.varnish-cache.org/ |
fe8e4400 ER |
29 | BuildRequires: autoconf |
30 | BuildRequires: automake | |
3c755ca1 | 31 | BuildRequires: libstdc++-devel |
058a6b0d | 32 | BuildRequires: libtool >= 2:2.0 |
fe8e4400 | 33 | BuildRequires: ncurses-devel |
2bf7dafb ER |
34 | BuildRequires: pcre-devel |
35 | BuildRequires: pkgconfig | |
e3f01727 | 36 | BuildRequires: rpmbuild(macros) >= 1.647 |
2d5f323d | 37 | BuildRequires: sed >= 4.0 |
2bf7dafb ER |
38 | %if %{with doc} |
39 | BuildRequires: docutils | |
40 | BuildRequires: groff | |
41 | BuildRequires: libxslt-progs | |
42 | %endif | |
f2b10025 ER |
43 | Requires(postun): /usr/sbin/groupdel |
44 | Requires(postun): /usr/sbin/userdel | |
45 | Requires(pre): /bin/id | |
46 | Requires(pre): /usr/bin/getgid | |
47 | Requires(pre): /usr/sbin/groupadd | |
48 | Requires(pre): /usr/sbin/useradd | |
385fba6f | 49 | Requires: %{name}-libs = %{version}-%{release} |
b3053a9f | 50 | Requires: gcc |
b07db5cf | 51 | Requires: glibc-devel |
ce360eba | 52 | Requires: rc-scripts >= 0.4.1.26 |
7f25d5f7 | 53 | Suggests: vim-syntax-vcl |
fe8e4400 ER |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
55 | ||
3415b5fe ER |
56 | %define _localstatedir /var/run |
57 | ||
fe8e4400 | 58 | %description |
04ceadbc ER |
59 | The goal of the Varnish project is to develop a state-of-the-art, |
60 | high-performance HTTP accelerator. | |
fe8e4400 | 61 | |
04ceadbc ER |
62 | Varnish is targeted primarily at the FreeBSD 6 and Linux 2.6 |
63 | platforms, and will take full advantage of the advanced I/O features | |
64 | offered by these operating systems. | |
fe8e4400 | 65 | |
a4c50e19 | 66 | %description -l pl.UTF-8 |
4b603a01 JB |
67 | Celem projektu Varnish jest stworzenie wydajnego akceleratora HTTP. |
68 | ||
a4c50e19 JR |
69 | Varnish jest tworzony głównie z myślą o platformach FreeBSD 6 i Linux |
70 | 2.6 i będzie wykorzystywał w pełni zaawansowane możliwości we/we | |
4b603a01 JB |
71 | oferowane przez te systemy operacyjne. |
72 | ||
385fba6f ER |
73 | %package libs |
74 | Summary: Libraries for Varnish | |
75 | Group: Libraries | |
76 | Conflicts: varnish < 2.0.4-2 | |
77 | ||
78 | %description libs | |
79 | Libraies for Varnish. | |
80 | ||
fe8e4400 | 81 | %package devel |
04ceadbc | 82 | Summary: Header files for varnish library |
496ca552 | 83 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki varnish |
fe8e4400 | 84 | Group: Development/Libraries |
385fba6f | 85 | Requires: %{name}-libs = %{version}-%{release} |
fe8e4400 ER |
86 | |
87 | %description devel | |
04ceadbc | 88 | Header files for varnish library. |
fe8e4400 | 89 | |
a4c50e19 JR |
90 | %description devel -l pl.UTF-8 |
91 | Pliki nagłówkowe biblioteki varnish. | |
4b603a01 | 92 | |
fe8e4400 | 93 | %package static |
04ceadbc | 94 | Summary: Static varnish library |
496ca552 | 95 | Summary(pl.UTF-8): Statyczna biblioteka varnish |
fe8e4400 ER |
96 | Group: Development/Libraries |
97 | Requires: %{name}-devel = %{version}-%{release} | |
98 | ||
99 | %description static | |
04ceadbc | 100 | Static varnish library. |
fe8e4400 | 101 | |
a4c50e19 | 102 | %description static -l pl.UTF-8 |
4b603a01 JB |
103 | Statyczna biblioteka varnish. |
104 | ||
2d5f323d ER |
105 | %package source |
106 | Summary: Source code of Varnish for building VMODs | |
107 | Group: Documentation | |
108 | Requires: %{name}-devel = %{version}-%{release} | |
109 | ||
110 | %description source | |
111 | Source code of Varnish for building VMODs. | |
112 | ||
fe8e4400 ER |
113 | %prep |
114 | %setup -q | |
0ab06c2d | 115 | #%patch100 -p0 |
df5a136b | 116 | %patch0 -p1 |
1388570a | 117 | %patch1 -p1 |
fe8e4400 | 118 | |
c7bf7433 ER |
119 | %{__sed} -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac |
120 | #%{__sed} -i -e 's,$(srcdir)/,,' bin/varnishtest/Makefile.am | |
121 | ||
2d5f323d ER |
122 | %{__sed} -i -e '1s,^#!.*python,#!%{__python},' lib/libvmod_std/vmod.py |
123 | ||
fe8e4400 | 124 | %build |
04ceadbc | 125 | export CPPFLAGS="-I/usr/include/ncurses" |
c7e762f7 | 126 | %{__aclocal} -I m4 |
5c5d0dde ER |
127 | %{__libtoolize} |
128 | %{__autoheader} | |
129 | %{__automake} | |
130 | %{__autoconf} | |
d139300d | 131 | %configure \ |
bd83ec95 | 132 | %ifarch hppa s390 sparc ppc |
d139300d ER |
133 | --disable-jemalloc |
134 | %endif | |
135 | ||
fe8e4400 ER |
136 | %{__make} |
137 | ||
aa9af101 | 138 | %if %{with tests} |
aa9af101 ER |
139 | %{__make} check \ |
140 | LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs" | |
aa9af101 ER |
141 | %endif |
142 | ||
fe8e4400 ER |
143 | %install |
144 | rm -rf $RPM_BUILD_ROOT | |
145 | %{__make} install \ | |
aa9af101 | 146 | INSTALL="install -p" \ |
fe8e4400 ER |
147 | DESTDIR=$RPM_BUILD_ROOT |
148 | ||
a61398bc | 149 | # make dirs after make install to know which ones needs spec and which ones make install |
3415b5fe | 150 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{logrotate.d,rc.d/init.d,sysconfig},/var/{run,lib}/varnish} \ |
275af167 | 151 | $RPM_BUILD_ROOT/var/log/{archive/,}varnish \ |
e3f01727 | 152 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
a61398bc | 153 | |
aa9af101 | 154 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnish |
aa9af101 | 155 | install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnishncsa |
bc2dc646 ER |
156 | cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/varnish |
157 | cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/varnishncsa | |
158 | cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/logrotate.d/varnish | |
e3f01727 ER |
159 | cp -p %{SOURCE8} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
160 | touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/secret | |
275af167 | 161 | |
c7e762f7 ER |
162 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la |
163 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/vmods/*.la | |
164 | ||
a2cd7ef5 | 165 | %if %{with source} |
2d5f323d ER |
166 | # prepare tree for VMOD build |
167 | install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/{include,bin/{varnishtest,varnishd},lib/libvmod_std} | |
168 | for a in $RPM_BUILD_ROOT%{_includedir}/%{name}/*.h; do | |
169 | f=${a#$RPM_BUILD_ROOT} | |
170 | ln -s $f $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/include | |
171 | done | |
172 | ||
173 | # add extra headers | |
174 | cp -pn include/*.h $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/include | |
175 | cp -p bin/varnishd/*.h $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishd | |
176 | ||
177 | ln -s %{_bindir}/varnishtest $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishtest | |
ed17f473 | 178 | ln -s %{_sbindir}/varnishd $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishd |
2d5f323d ER |
179 | cp -p lib/libvmod_std/vmod.py $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/lib/libvmod_std |
180 | ||
181 | # add pkg config variable for eash access | |
e6c7854d | 182 | %{__sed} -i -e '/^vmoddir/a srcdir=%{_usrsrc}/%{name}-%{version}' \ |
2d5f323d | 183 | $RPM_BUILD_ROOT%{_pkgconfigdir}/varnishapi.pc |
a2cd7ef5 | 184 | %endif |
2d5f323d | 185 | |
fe8e4400 ER |
186 | %clean |
187 | rm -rf $RPM_BUILD_ROOT | |
188 | ||
189 | %post | |
fe8e4400 | 190 | /sbin/chkconfig --add varnish |
3415b5fe ER |
191 | /sbin/chkconfig --add varnishncsa |
192 | %service varnish restart | |
3415b5fe | 193 | %service varnishncsa restart |
fe8e4400 | 194 | |
f2b10025 ER |
195 | %pre |
196 | %groupadd -g 241 %{name} | |
197 | %useradd -u 241 -d /var/lib/%{name} -g %{name} -c "Varnishd User" %{name} | |
198 | ||
199 | %postun | |
f2b10025 ER |
200 | if [ "$1" = "0" ]; then |
201 | %userremove %{name} | |
202 | %groupremove %{name} | |
203 | fi | |
204 | ||
fe8e4400 ER |
205 | %preun |
206 | if [ "$1" = "0" ]; then | |
3415b5fe | 207 | %service -q varnish stop |
3415b5fe ER |
208 | %service -q varnishncsa stop |
209 | /sbin/chkconfig --del varnish | |
3415b5fe | 210 | /sbin/chkconfig --del varnishncsa |
fe8e4400 ER |
211 | fi |
212 | ||
385fba6f ER |
213 | %post libs -p /sbin/ldconfig |
214 | %postun libs -p /sbin/ldconfig | |
215 | ||
fe8e4400 ER |
216 | %files |
217 | %defattr(644,root,root,755) | |
e8f8a479 | 218 | %doc LICENSE README ChangeLog etc/*.vcl |
e3f01727 | 219 | %dir %attr(750,root,root) %{_sysconfdir}/%{name} |
f2b10025 | 220 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.vcl |
3c755ca1 | 221 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnish |
7fa0d756 | 222 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnishncsa |
e3f01727 | 223 | %ghost %attr(600,root,root) %{_sysconfdir}/%{name}/secret |
3415b5fe | 224 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/varnish |
3c755ca1 | 225 | %attr(754,root,root) /etc/rc.d/init.d/varnish |
3415b5fe | 226 | %attr(754,root,root) /etc/rc.d/init.d/varnishncsa |
fe8e4400 | 227 | %attr(755,root,root) %{_sbindir}/varnishd |
ef8763c4 ER |
228 | %attr(755,root,root) %{_bindir}/varnishadm |
229 | %attr(755,root,root) %{_bindir}/varnishhist | |
230 | %attr(755,root,root) %{_bindir}/varnishlog | |
231 | %attr(755,root,root) %{_bindir}/varnishncsa | |
232 | %attr(755,root,root) %{_bindir}/varnishreplay | |
233 | %attr(755,root,root) %{_bindir}/varnishsizes | |
234 | %attr(755,root,root) %{_bindir}/varnishstat | |
235 | %attr(755,root,root) %{_bindir}/varnishtest | |
236 | %attr(755,root,root) %{_bindir}/varnishtop | |
c7e762f7 ER |
237 | %dir %{_libdir}/%{name} |
238 | %attr(755,root,root) %{_libdir}/%{name}/libvarnish.so | |
239 | %attr(755,root,root) %{_libdir}/%{name}/libvarnishcompat.so | |
240 | %attr(755,root,root) %{_libdir}/%{name}/libvcl.so | |
241 | %attr(755,root,root) %{_libdir}/%{name}/libvgz.so | |
242 | %dir %{_libdir}/%{name}/vmods | |
243 | %attr(755,root,root) %{_libdir}/%{name}/vmods/libvmod_std.so | |
ef8763c4 ER |
244 | %{_mandir}/man1/varnishadm.1* |
245 | %{_mandir}/man1/varnishd.1* | |
246 | %{_mandir}/man1/varnishhist.1* | |
247 | %{_mandir}/man1/varnishlog.1* | |
248 | %{_mandir}/man1/varnishncsa.1* | |
249 | %{_mandir}/man1/varnishreplay.1* | |
250 | %{_mandir}/man1/varnishsizes.1* | |
251 | %{_mandir}/man1/varnishstat.1* | |
252 | %{_mandir}/man1/varnishtest.1* | |
253 | %{_mandir}/man1/varnishtop.1* | |
c7e762f7 ER |
254 | %{_mandir}/man3/vmod_std.3* |
255 | %{_mandir}/man7/varnish-cli.7* | |
256 | %{_mandir}/man7/varnish-counters.7* | |
ef8763c4 | 257 | %{_mandir}/man7/vcl.7* |
aa9af101 ER |
258 | %dir /var/lib/varnish |
259 | %dir /var/run/varnish | |
e3f01727 | 260 | %{systemdtmpfilesdir}/%{name}.conf |
fe8e4400 | 261 | |
00900405 ER |
262 | %dir %attr(751,root,root) /var/log/varnish |
263 | %dir %attr(750,root,root) /var/log/archive/varnish | |
264 | ||
385fba6f ER |
265 | %files libs |
266 | %defattr(644,root,root,755) | |
ef8763c4 ER |
267 | %attr(755,root,root) %{_libdir}/libvarnishapi.so.*.*.* |
268 | %ghost %{_libdir}/libvarnishapi.so.1 | |
385fba6f | 269 | |
fe8e4400 ER |
270 | %files devel |
271 | %defattr(644,root,root,755) | |
7c7d5b02 | 272 | %{_includedir}/varnish |
ef8763c4 ER |
273 | %{_libdir}/libvarnishapi.la |
274 | %{_libdir}/libvarnishapi.so | |
ef8763c4 | 275 | %{_pkgconfigdir}/varnishapi.pc |
fe8e4400 ER |
276 | |
277 | %files static | |
278 | %defattr(644,root,root,755) | |
ef8763c4 | 279 | %{_libdir}/libvarnishapi.a |
c7e762f7 ER |
280 | %{_libdir}/%{name}/libvarnish.a |
281 | %{_libdir}/%{name}/libvarnishcompat.a | |
282 | %{_libdir}/%{name}/libvcl.a | |
283 | %{_libdir}/%{name}/libvgz.a | |
284 | %{_libdir}/%{name}/vmods/libvmod_std.a | |
2d5f323d | 285 | |
a2cd7ef5 | 286 | %if %{with source} |
2d5f323d ER |
287 | %files source |
288 | %defattr(644,root,root,755) | |
289 | %{_usrsrc}/%{name}-%{version} | |
a2cd7ef5 | 290 | %endif |