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