2 # - make tests use secure dir, not /tmp, see varnish-2.0.6/bin/varnishtest
3 # - hungs ac builders: tests/a00009.vtc
6 %bcond_without doc # build documentation
7 %bcond_without tests # build without tests. binds daemon on 127.0.0.1 9080, 9081, 9001 ports
8 %bcond_without source # build source package
10 Summary: Varnish - a high-performance HTTP accelerator
11 Summary(pl.UTF-8): Varnish - wydajny akcelerator HTTP
16 Group: Networking/Daemons/HTTP
17 Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz
18 # Source0-md5: 674d44775cc927aee4601edb37f60198
20 Source3: %{name}ncsa.init
21 Source4: %{name}.sysconfig
22 Source5: %{name}ncsa.sysconfig
23 Source6: %{name}.logrotate
24 Source8: %{name}.tmpfiles
25 #Patch100: branch.diff
26 Patch0: no-ccache.patch
27 Patch1: no-sysctl.patch
28 URL: http://www.varnish-cache.org/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 BuildRequires: libstdc++-devel
32 BuildRequires: libtool >= 2:2.0
33 BuildRequires: ncurses-devel
34 BuildRequires: pcre-devel
35 BuildRequires: pkgconfig
36 BuildRequires: rpmbuild(macros) >= 1.647
37 BuildRequires: sed >= 4.0
39 BuildRequires: docutils
41 BuildRequires: libxslt-progs
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
49 Requires: %{name}-libs = %{version}-%{release}
52 Requires: rc-scripts >= 0.4.1.26
53 Suggests: vim-syntax-vcl
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define _localstatedir /var/run
59 The goal of the Varnish project is to develop a state-of-the-art,
60 high-performance HTTP accelerator.
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.
66 %description -l pl.UTF-8
67 Celem projektu Varnish jest stworzenie wydajnego akceleratora HTTP.
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
71 oferowane przez te systemy operacyjne.
74 Summary: Libraries for Varnish
76 Conflicts: varnish < 2.0.4-2
82 Summary: Header files for varnish library
83 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki varnish
84 Group: Development/Libraries
85 Requires: %{name}-libs = %{version}-%{release}
88 Header files for varnish library.
90 %description devel -l pl.UTF-8
91 Pliki nagłówkowe biblioteki varnish.
94 Summary: Static varnish library
95 Summary(pl.UTF-8): Statyczna biblioteka varnish
96 Group: Development/Libraries
97 Requires: %{name}-devel = %{version}-%{release}
100 Static varnish library.
102 %description static -l pl.UTF-8
103 Statyczna biblioteka varnish.
106 Summary: Source code of Varnish for building VMODs
108 Requires: %{name}-devel = %{version}-%{release}
111 Source code of Varnish for building VMODs.
119 %{__sed} -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac
120 #%{__sed} -i -e 's,$(srcdir)/,,' bin/varnishtest/Makefile.am
122 %{__sed} -i -e '1s,^#!.*python,#!%{__python},' lib/libvmod_std/vmod.py
125 export CPPFLAGS="-I/usr/include/ncurses"
132 %ifarch hppa s390 sparc ppc
140 LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs"
144 rm -rf $RPM_BUILD_ROOT
146 INSTALL="install -p" \
147 DESTDIR=$RPM_BUILD_ROOT
149 # make dirs after make install to know which ones needs spec and which ones make install
150 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{logrotate.d,rc.d/init.d,sysconfig},/var/{run,lib}/varnish} \
151 $RPM_BUILD_ROOT/var/log/{archive/,}varnish \
152 $RPM_BUILD_ROOT%{systemdtmpfilesdir}
154 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnish
155 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnishncsa
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
159 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
160 touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/secret
162 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
163 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/vmods/*.la
166 # prepare tree for VMOD build
167 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/{include,bin/{varnishtest,varnishd},lib/libvmod_std}
170 cp -pn include/*.h $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/include
171 cp -p bin/varnishd/*.h $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishd
173 for a in $RPM_BUILD_ROOT%{_includedir}/%{name}/*.h; do
174 f=${a#$RPM_BUILD_ROOT}
175 ln -sf $f $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/include
178 ln -s %{_bindir}/varnishtest $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishtest
179 ln -s %{_sbindir}/varnishd $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/bin/varnishd
180 cp -p lib/libvmod_std/vmod.py $RPM_BUILD_ROOT%{_usrsrc}/%{name}-%{version}/lib/libvmod_std
182 # add pkg config variable for eash access
183 %{__sed} -i -e '/^vmoddir/a srcdir=%{_usrsrc}/%{name}-%{version}' \
184 $RPM_BUILD_ROOT%{_pkgconfigdir}/varnishapi.pc
188 rm -rf $RPM_BUILD_ROOT
191 /sbin/chkconfig --add varnish
192 /sbin/chkconfig --add varnishncsa
193 %service varnish restart
194 %service varnishncsa restart
197 %groupadd -g 241 %{name}
198 %useradd -u 241 -d /var/lib/%{name} -g %{name} -c "Varnishd User" %{name}
201 if [ "$1" = "0" ]; then
207 if [ "$1" = "0" ]; then
208 %service -q varnish stop
209 %service -q varnishncsa stop
210 /sbin/chkconfig --del varnish
211 /sbin/chkconfig --del varnishncsa
214 %post libs -p /sbin/ldconfig
215 %postun libs -p /sbin/ldconfig
218 %defattr(644,root,root,755)
219 %doc LICENSE README ChangeLog etc/*.vcl
220 %dir %attr(750,root,root) %{_sysconfdir}/%{name}
221 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.vcl
222 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnish
223 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnishncsa
224 %ghost %attr(600,root,root) %{_sysconfdir}/%{name}/secret
225 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/varnish
226 %attr(754,root,root) /etc/rc.d/init.d/varnish
227 %attr(754,root,root) /etc/rc.d/init.d/varnishncsa
228 %attr(755,root,root) %{_sbindir}/varnishd
229 %attr(755,root,root) %{_bindir}/varnishadm
230 %attr(755,root,root) %{_bindir}/varnishhist
231 %attr(755,root,root) %{_bindir}/varnishlog
232 %attr(755,root,root) %{_bindir}/varnishncsa
233 %attr(755,root,root) %{_bindir}/varnishreplay
234 %attr(755,root,root) %{_bindir}/varnishsizes
235 %attr(755,root,root) %{_bindir}/varnishstat
236 %attr(755,root,root) %{_bindir}/varnishtest
237 %attr(755,root,root) %{_bindir}/varnishtop
238 %dir %{_libdir}/%{name}
239 %attr(755,root,root) %{_libdir}/%{name}/libvarnish.so
240 %attr(755,root,root) %{_libdir}/%{name}/libvarnishcompat.so
241 %attr(755,root,root) %{_libdir}/%{name}/libvcl.so
242 %attr(755,root,root) %{_libdir}/%{name}/libvgz.so
243 %dir %{_libdir}/%{name}/vmods
244 %attr(755,root,root) %{_libdir}/%{name}/vmods/libvmod_std.so
245 %{_mandir}/man1/varnishadm.1*
246 %{_mandir}/man1/varnishd.1*
247 %{_mandir}/man1/varnishhist.1*
248 %{_mandir}/man1/varnishlog.1*
249 %{_mandir}/man1/varnishncsa.1*
250 %{_mandir}/man1/varnishreplay.1*
251 %{_mandir}/man1/varnishsizes.1*
252 %{_mandir}/man1/varnishstat.1*
253 %{_mandir}/man1/varnishtest.1*
254 %{_mandir}/man1/varnishtop.1*
255 %{_mandir}/man3/vmod_std.3*
256 %{_mandir}/man7/varnish-cli.7*
257 %{_mandir}/man7/varnish-counters.7*
258 %{_mandir}/man7/vcl.7*
259 %dir /var/lib/varnish
260 %dir /var/run/varnish
261 %{systemdtmpfilesdir}/%{name}.conf
263 %dir %attr(751,root,root) /var/log/varnish
264 %dir %attr(750,root,root) /var/log/archive/varnish
267 %defattr(644,root,root,755)
268 %attr(755,root,root) %{_libdir}/libvarnishapi.so.*.*.*
269 %ghost %{_libdir}/libvarnishapi.so.1
272 %defattr(644,root,root,755)
273 %{_includedir}/varnish
274 %{_libdir}/libvarnishapi.la
275 %{_libdir}/libvarnishapi.so
276 %{_pkgconfigdir}/varnishapi.pc
279 %defattr(644,root,root,755)
280 %{_libdir}/libvarnishapi.a
281 %{_libdir}/%{name}/libvarnish.a
282 %{_libdir}/%{name}/libvarnishcompat.a
283 %{_libdir}/%{name}/libvcl.a
284 %{_libdir}/%{name}/libvgz.a
285 %{_libdir}/%{name}/vmods/libvmod_std.a
289 %defattr(644,root,root,755)
290 %{_usrsrc}/%{name}-%{version}