2 # - make tests use secure dir, not /tmp, see varnish-2.0.6/bin/varnishtest
3 # - hungs ac builders: tests/a00009.vtc
4 # - some -l missing: /usr/lib64/libvcl.so.1.0.0
7 %bcond_without tests # build without tests. binds daemon on 127.0.0.1 9080, 9081, 9001 ports
9 Summary: Varnish - a high-performance HTTP accelerator
10 Summary(pl.UTF-8): Varnish - wydajny akcelerator HTTP
15 Group: Networking/Daemons/HTTP
16 Source0: http://repo.varnish-cache.org/source/%{name}-%{version}.tar.gz
17 # Source0-md5: 2d2f227da36a2a240c475304c717b8e3
19 Source3: %{name}ncsa.init
20 Source4: %{name}.sysconfig
21 Source5: %{name}ncsa.sysconfig
22 Source6: %{name}.logrotate
24 #Patch100: branch.diff
25 Patch0: %{name}-build.patch
26 URL: http://www.varnish-cache.org/
27 BuildRequires: autoconf
28 BuildRequires: automake
30 BuildRequires: libstdc++-devel
31 BuildRequires: libtool >= 2:1.5
32 BuildRequires: rpmbuild(macros) >= 1.583
33 BuildRequires: ncurses-devel
34 Requires(postun): /usr/sbin/groupdel
35 Requires(postun): /usr/sbin/userdel
36 Requires(pre): /bin/id
37 Requires(pre): /usr/bin/getgid
38 Requires(pre): /usr/sbin/groupadd
39 Requires(pre): /usr/sbin/useradd
40 Requires: %{name}-libs = %{version}-%{release}
43 Requires: rc-scripts >= 0.4.1.26
44 Suggests: vim-syntax-vcl
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define _localstatedir /var/run
49 # TODO: find reasons http://pastebin.com/ZNq1KDPG
50 %define skip_post_check_so libvcl.so.1.0.0
53 The goal of the Varnish project is to develop a state-of-the-art,
54 high-performance HTTP accelerator.
56 Varnish is targeted primarily at the FreeBSD 6 and Linux 2.6
57 platforms, and will take full advantage of the advanced I/O features
58 offered by these operating systems.
60 %description -l pl.UTF-8
61 Celem projektu Varnish jest stworzenie wydajnego akceleratora HTTP.
63 Varnish jest tworzony głównie z myślą o platformach FreeBSD 6 i Linux
64 2.6 i będzie wykorzystywał w pełni zaawansowane możliwości we/we
65 oferowane przez te systemy operacyjne.
68 Summary: Libraries for Varnish
70 Conflicts: varnish < 2.0.4-2
76 Summary: Header files for varnish library
77 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki varnish
78 Group: Development/Libraries
79 Requires: %{name}-libs = %{version}-%{release}
82 Header files for varnish library.
84 %description devel -l pl.UTF-8
85 Pliki nagłówkowe biblioteki varnish.
88 Summary: Static varnish library
89 Summary(pl.UTF-8): Statyczna biblioteka varnish
90 Group: Development/Libraries
91 Requires: %{name}-devel = %{version}-%{release}
94 Static varnish library.
96 %description static -l pl.UTF-8
97 Statyczna biblioteka varnish.
105 export CPPFLAGS="-I/usr/include/ncurses"
112 %ifarch hppa s390 sparc ppc
116 %{__sed} -i -e '/CURSES_LIBS = / s,-lcurses,-ltinfo &,' bin/varnish{hist,stat,top,sizes}/Makefile
122 LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs"
126 rm -rf $RPM_BUILD_ROOT
129 INSTALL="install -p" \
130 DESTDIR=$RPM_BUILD_ROOT
132 # make dirs after make install to know which ones needs spec and which ones make install
133 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/{logrotate.d,rc.d/init.d,sysconfig},/var/{run,lib}/varnish} \
134 $RPM_BUILD_ROOT/var/log/{archive/,}varnish
136 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnish
137 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/varnishncsa
138 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/sysconfig/varnish
139 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/varnishncsa
140 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/logrotate.d/varnish
141 cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/default.vcl
144 rm -rf $RPM_BUILD_ROOT
147 /sbin/chkconfig --add varnish
148 /sbin/chkconfig --add varnishncsa
149 %service varnish restart
150 %service varnishncsa restart
153 %groupadd -g 241 %{name}
154 %useradd -u 241 -d /var/lib/%{name} -g %{name} -c "Varnishd User" %{name}
157 if [ "$1" = "0" ]; then
163 if [ "$1" = "0" ]; then
164 %service -q varnish stop
165 %service -q varnishncsa stop
166 /sbin/chkconfig --del varnish
167 /sbin/chkconfig --del varnishncsa
170 %post libs -p /sbin/ldconfig
171 %postun libs -p /sbin/ldconfig
174 %defattr(644,root,root,755)
175 %doc LICENSE README ChangeLog etc/*.vcl
176 %dir %{_sysconfdir}/%{name}
177 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.vcl
178 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnish
179 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/varnishncsa
180 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/varnish
181 %attr(754,root,root) /etc/rc.d/init.d/varnish
182 %attr(754,root,root) /etc/rc.d/init.d/varnishncsa
183 %attr(755,root,root) %{_sbindir}/varnishd
184 %attr(755,root,root) %{_bindir}/varnish*
187 %dir /var/lib/varnish
188 %dir /var/run/varnish
190 %dir %attr(751,root,root) /var/log/varnish
191 %dir %attr(750,root,root) /var/log/archive/varnish
194 %defattr(644,root,root,755)
195 %attr(755,root,root) %{_libdir}/libvarnish*.so.*.*.*
196 %attr(755,root,root) %ghost %{_libdir}/libvarnish*.so.1
197 %attr(755,root,root) %{_libdir}/libvcl.so.*.*.*
198 %attr(755,root,root) %ghost %{_libdir}/libvcl.so.1
201 %defattr(644,root,root,755)
202 %{_includedir}/varnish
203 %attr(755,root,root) %{_libdir}/*.so
205 %{_pkgconfigdir}/*.pc
208 %defattr(644,root,root,755)