1 |
%define major 1 |
2 |
%define libname %mklibname varnish %{major} |
3 |
%define develname %mklibname varnish -d |
4 |
|
5 |
Summary: Varnish is a high-performance HTTP accelerator |
6 |
Name: varnish |
7 |
Version: 3.0.3 |
8 |
Release: %mkrel 6 |
9 |
License: BSD |
10 |
Group: System/Servers |
11 |
URL: http://www.varnish-cache.org/ |
12 |
Source0: http://repo.varnish-cache.org/source/varnish-%{version}.tar.gz |
13 |
Source1: varnish.init |
14 |
Source2: varnishlog.init |
15 |
Source3: varnishncsa.init |
16 |
Source4: varnish.logrotate |
17 |
Source5: varnish.sysconfig |
18 |
Source6: default.vcl |
19 |
Patch0: varnish.varnishtest_debugflag.patch |
20 |
Patch1: varnish-3.0.3-link.patch |
21 |
Patch2: varnish-3.0.3-automake-1.13.patch |
22 |
BuildRequires: ncurses-devel |
23 |
BuildRequires: libxslt-proc |
24 |
BuildRequires: pcre-devel |
25 |
BuildRequires: groff |
26 |
# Varnish actually needs gcc installed to work. It uses the C compiler |
27 |
# at runtime to compile the VCL configuration files. This is by design. |
28 |
Requires: gcc |
29 |
Requires(post): systemd >= %{systemd_required_version} |
30 |
|
31 |
%description |
32 |
This is the Varnish high-performance HTTP accelerator. Documentation wiki and |
33 |
additional information about Varnish is available on the following web site: |
34 |
http://www.varnish-cache.org/ |
35 |
|
36 |
%package -n %{libname} |
37 |
Summary: Shared libraries for varnish |
38 |
Group: System/Libraries |
39 |
|
40 |
%description -n %{libname} |
41 |
Varnish is a high-performance HTTP accelerator. |
42 |
|
43 |
This package provides the shared libraries for varnish. |
44 |
|
45 |
%package -n %{develname} |
46 |
Summary: Development headers and libraries for varnish |
47 |
Group: Development/C |
48 |
Requires: %{libname} = %{version} |
49 |
Provides: %{name}-devel = %{version}-%{release} |
50 |
|
51 |
%description -n %{develname} |
52 |
Varnish is a high-performance HTTP accelerator. |
53 |
|
54 |
This package provides the development files for varnish. |
55 |
|
56 |
%prep |
57 |
%setup -q |
58 |
%patch0 -p1 |
59 |
%patch1 -p0 |
60 |
%patch2 -p0 |
61 |
|
62 |
# Hack to get 32- and 64-bits tests run concurrently on the same build machine |
63 |
case `uname -m` in |
64 |
ppc64 | s390x | x86_64 | sparc64 ) |
65 |
sed -i ' |
66 |
s,9001,9011,g; |
67 |
s,9080,9090,g; |
68 |
s,9081,9091,g; |
69 |
s,9082,9092,g; |
70 |
s,9180,9190,g; |
71 |
' bin/varnishtest/*.c bin/varnishtest/tests/*vtc |
72 |
;; |
73 |
*) |
74 |
;; |
75 |
esac |
76 |
|
77 |
mkdir examples |
78 |
cp bin/varnishd/default.vcl etc/zope-plone.vcl examples |
79 |
|
80 |
mkdir -p Mandriva |
81 |
cp %{SOURCE1} Mandriva/varnish.init |
82 |
cp %{SOURCE2} Mandriva/varnishlog.init |
83 |
cp %{SOURCE3} Mandriva/varnishncsa.init |
84 |
cp %{SOURCE4} Mandriva/varnish.logrotate |
85 |
cp %{SOURCE5} Mandriva/varnish.sysconfig |
86 |
cp %{SOURCE6} Mandriva/default.vcl |
87 |
|
88 |
%build |
89 |
autoreconf -fi |
90 |
|
91 |
%configure2_5x \ |
92 |
--disable-static \ |
93 |
--localstatedir=/var/lib |
94 |
|
95 |
# We have to remove rpath - not allowed in Fedora |
96 |
# (This problem only visible on 64 bit arches) |
97 |
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; |
98 |
s|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool |
99 |
|
100 |
%make |
101 |
|
102 |
%install |
103 |
|
104 |
%makeinstall_std INSTALL="install -p" |
105 |
|
106 |
install -d %{buildroot}%{_initrddir} |
107 |
install -d %{buildroot}%{_sysconfdir}/sysconfig |
108 |
install -d %{buildroot}%{_sysconfdir}/varnish |
109 |
install -d %{buildroot}%{_sysconfdir}/logrotate.d |
110 |
install -d %{buildroot}/var/lib/varnish |
111 |
install -d %{buildroot}/var/log/varnish |
112 |
|
113 |
install -m0755 Mandriva/varnish.init %{buildroot}%{_initrddir}/varnish |
114 |
install -m0755 Mandriva/varnishlog.init %{buildroot}%{_initrddir}/varnishlog |
115 |
install -m0755 Mandriva/varnishncsa.init %{buildroot}%{_initrddir}/varnishncsa |
116 |
|
117 |
install -m0644 Mandriva/varnish.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/varnish |
118 |
install -m0644 Mandriva/varnish.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/varnish |
119 |
install -m0644 Mandriva/default.vcl %{buildroot}%{_sysconfdir}/varnish/default.vcl |
120 |
|
121 |
# cleanup |
122 |
find %{buildroot}/%{_libdir}/ -name '*.la' -exec rm -f {} ';' |
123 |
|
124 |
mkdir -p %{buildroot}%{_tmpfilesdir} |
125 |
cat <<EOF > %{buildroot}%{_tmpfilesdir}/%{name}.conf |
126 |
d /run/varnish 0755 varnish varnish |
127 |
EOF |
128 |
|
129 |
%pre |
130 |
getent group varnish >/dev/null || groupadd -r varnish |
131 |
getent passwd varnish >/dev/null || \ |
132 |
useradd -r -g varnish -d /var/lib/varnish -s /sbin/nologin \ |
133 |
-c "Varnish http accelerator user" varnish |
134 |
exit 0 |
135 |
|
136 |
%post |
137 |
%_tmpfilescreate %{name} |
138 |
/sbin/chkconfig --add varnish |
139 |
/sbin/chkconfig --add varnishlog |
140 |
/sbin/chkconfig --add varnishncsa |
141 |
|
142 |
%preun |
143 |
if [ $1 -lt 1 ]; then |
144 |
/sbin/service varnish stop > /dev/null 2>&1 |
145 |
/sbin/service varnishlog stop > /dev/null 2>&1 |
146 |
/sbin/service varnishncsa stop > /dev/null 2>&1 |
147 |
/sbin/chkconfig --del varnish |
148 |
/sbin/chkconfig --del varnishlog |
149 |
/sbin/chkconfig --del varnishncsa |
150 |
fi |
151 |
|
152 |
%files |
153 |
%doc INSTALL README ChangeLog examples |
154 |
%config(noreplace) %{_sysconfdir}/sysconfig/varnish |
155 |
%config(noreplace) %{_sysconfdir}/logrotate.d/varnish |
156 |
%dir %{_sysconfdir}/varnish |
157 |
%config(noreplace) %{_sysconfdir}/varnish/default.vcl |
158 |
%{_tmpfilesdir}/%{name}.conf |
159 |
%{_initrddir}/varnish |
160 |
%{_initrddir}/varnishlog |
161 |
%{_initrddir}/varnishncsa |
162 |
%{_sbindir}/* |
163 |
%{_bindir}/* |
164 |
%attr(0755,varnish,varnish) %dir /var/lib/varnish |
165 |
%attr(0755,varnish,varnish) %dir /var/log/varnish |
166 |
%{_mandir}/man1/*.1* |
167 |
%{_mandir}/man7/*.7* |
168 |
%dir %{_libdir}/varnish |
169 |
%{_libdir}/varnish/libvarnish.so |
170 |
%{_libdir}/varnish/libvarnishcompat.so |
171 |
%{_libdir}/varnish/libvcl.so |
172 |
%{_libdir}/varnish/libvgz.so |
173 |
%dir %{_libdir}/varnish/vmods |
174 |
%{_libdir}/varnish/vmods/libvmod_std.so |
175 |
%{_mandir}/man3/vmod_std.3* |
176 |
|
177 |
%files -n %{libname} |
178 |
%doc LICENSE |
179 |
%{_libdir}/lib*.so.%{major}* |
180 |
|
181 |
%files -n %{develname} |
182 |
%{_libdir}/lib*.so |
183 |
%dir %{_includedir}/varnish |
184 |
%{_includedir}/varnish/*.h |
185 |
%{_libdir}/pkgconfig/*.pc |