2010-09-24 01:07:49 +02:00
|
|
|
#
|
2012-09-24 05:20:34 +02:00
|
|
|
# spec file for package varnish
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
2011-04-15 10:09:03 +02:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
Name: varnish
|
2012-02-09 00:28:53 +01:00
|
|
|
%define library_name libvarnishapi1
|
2012-09-24 05:20:34 +02:00
|
|
|
Version: 3.0.3
|
2011-04-15 10:09:03 +02:00
|
|
|
Release: 0
|
2012-02-09 00:28:53 +01:00
|
|
|
Summary: Varnish is a high-performance HTTP accelerator
|
|
|
|
License: BSD-2-Clause
|
2010-09-24 01:07:49 +02:00
|
|
|
Group: Productivity/Networking/Web/Proxy
|
2012-02-09 00:28:53 +01:00
|
|
|
URL: http://varnish-cache.org/
|
|
|
|
|
2013-11-01 19:55:27 +01:00
|
|
|
#Git-Clone: git://git.varnish-cache.org/varnish-cache
|
|
|
|
#Git-Web: https://varnish-cache.org/trac/browser
|
2012-02-18 01:56:34 +01:00
|
|
|
#DL-URL: http://downloads.sf.net/varnish/%name-%version.tar.bz2
|
2013-11-01 19:55:27 +01:00
|
|
|
Source: %name-%version.tar.xz
|
2012-09-24 05:20:34 +02:00
|
|
|
Source2: varnish.init
|
|
|
|
Source3: varnish.sysconfig
|
2012-02-09 00:28:53 +01:00
|
|
|
Source4: vcl.conf
|
|
|
|
Source5: varnish.logrotate
|
2012-09-24 05:20:34 +02:00
|
|
|
Source6: varnishlog.init
|
2012-02-18 01:56:34 +01:00
|
|
|
Source7: varnish.service
|
|
|
|
Source8: varnishlog.service
|
2013-10-05 00:47:06 +02:00
|
|
|
Patch1: varnish-disable-pcrejit.diff
|
2013-11-01 19:55:27 +01:00
|
|
|
Patch2: 0001-Make-up-our-mind-Any-req.-we-receive-from-the-client.patch
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2011-04-15 10:09:03 +02:00
|
|
|
BuildRoot: %_tmppath/%name-%version-build
|
2011-04-16 00:38:17 +02:00
|
|
|
BuildRequires: libxslt, ncurses-devel, pcre-devel
|
2012-02-09 00:28:53 +01:00
|
|
|
BuildRequires: pkgconfig, xz
|
2011-06-29 14:26:44 +02:00
|
|
|
Prereq(post): %_sbindir/useradd %_sbindir/groupadd
|
2011-04-16 00:59:54 +02:00
|
|
|
%if 0%{?suse_version} >= 1010
|
2010-09-24 01:07:49 +02:00
|
|
|
Recommends: logrotate
|
|
|
|
%endif
|
2012-02-29 08:32:57 +01:00
|
|
|
%if 0%{?suse_version} >= 1210
|
2012-02-28 15:47:45 +01:00
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
|
|
|
%endif
|
2011-06-29 14:26:44 +02:00
|
|
|
%define pkg_home %_localstatedir/lib/%name
|
|
|
|
%define pkg_logdir %_localstatedir/log/%name
|
|
|
|
%define pkg_cachedir %_localstatedir/cache/%name
|
2011-05-10 16:18:49 +02:00
|
|
|
Requires: c_compiler
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%description
|
|
|
|
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
|
|
|
|
Proxy) is an application that stores (caches) documents that have been
|
|
|
|
requested over the HTTP protocol.
|
|
|
|
|
|
|
|
Based on certain criteria the next client requesting the document is either
|
|
|
|
given the cached document, or a "fresh" document requested from a backend
|
|
|
|
server. The purpose of this is to minimize the requests going to the backend
|
|
|
|
server(s) by serving the same document to potentially many users.
|
|
|
|
|
2011-06-29 14:26:44 +02:00
|
|
|
%package -n %library_name
|
2010-09-24 01:07:49 +02:00
|
|
|
Group: Productivity/Networking/Web/Proxy
|
|
|
|
Summary: Shared libraries for Varnish
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2011-06-29 14:26:44 +02:00
|
|
|
%description -n %library_name
|
2010-09-24 01:07:49 +02:00
|
|
|
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
|
|
|
|
Proxy) is an application that stores (caches) documents that have been
|
|
|
|
requested over the HTTP protocol.
|
|
|
|
|
|
|
|
Based on certain criteria the next client requesting the document is either
|
|
|
|
given the cached document, or a "fresh" document requested from a backend
|
|
|
|
server. The purpose of this is to minimize the requests going to the backend
|
|
|
|
server(s) by serving the same document to potentially many users.
|
|
|
|
|
|
|
|
This package holds the shared libraries for varnish.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Group: Development/Libraries/C and C++
|
2011-06-29 14:26:44 +02:00
|
|
|
Requires: %name = %version
|
2010-09-24 01:07:49 +02:00
|
|
|
Summary: Development files for Varnish
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%description devel
|
|
|
|
Varnish is an HTTP accelerator. An HTTP accelerator (often called Reverse
|
|
|
|
Proxy) is an application that stores (caches) documents that have been
|
|
|
|
requested over the HTTP protocol.
|
|
|
|
|
|
|
|
Based on certain criteria the next client requesting the document is either
|
|
|
|
given the cached document, or a "fresh" document requested from a backend
|
|
|
|
server. The purpose of this is to minimize the requests going to the backend
|
|
|
|
server(s) by serving the same document to potentially many users.
|
|
|
|
|
|
|
|
This package holds the development files for varnish.
|
|
|
|
|
|
|
|
%prep
|
2011-06-29 14:26:44 +02:00
|
|
|
%setup -q
|
2013-11-01 19:55:27 +01:00
|
|
|
%patch -P 1 -P 2 -p1
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%build
|
2013-10-21 15:31:46 +02:00
|
|
|
export CFLAGS="%optflags -fstack-protector"
|
2011-04-27 18:15:53 +02:00
|
|
|
%configure --disable-static \
|
|
|
|
--localstatedir=%_localstatedir/cache/ \
|
2010-09-24 01:07:49 +02:00
|
|
|
--enable-developer-warnings
|
2011-06-29 14:26:44 +02:00
|
|
|
make %{?_smp_mflags}
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%install
|
2012-02-28 16:45:40 +01:00
|
|
|
b="%buildroot";
|
2012-09-24 05:29:35 +02:00
|
|
|
make install DESTDIR="%buildroot";
|
2011-06-29 14:26:44 +02:00
|
|
|
# There is no use for them to normal users
|
2012-02-28 16:45:40 +01:00
|
|
|
mv "$b/%_bindir"/* "$b/%_sbindir/";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##missing directories
|
2012-02-28 16:45:40 +01:00
|
|
|
install -dm 0755 "$b"/{%pkg_logdir,%pkg_home};
|
|
|
|
install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##init scripts
|
2012-02-28 16:45:40 +01:00
|
|
|
install -Dpm 0644 "%{S:3}" "$b/var/adm/fillup-templates/sysconfig.%name";
|
|
|
|
install -Dpm 0755 "%{S:2}" "$b/%_initddir/varnish";
|
|
|
|
install -Dpm 0755 "%{S:6}" "$b/%_initddir/varnishlog";
|
|
|
|
%if 0%{?_unitdir:1}
|
|
|
|
install -Dpm 0644 "%{S:7}" "$b/%_unitdir/varnish.service";
|
|
|
|
install -Dpm 0644 "%{S:8}" "$b/%_unitdir/varnishlog.service";
|
|
|
|
%endif
|
|
|
|
mkdir -p "$b/%_sbindir";
|
|
|
|
ln -s "%_initddir/varnish" "$b/%_sbindir/rcvarnish";
|
|
|
|
ln -s "%_initddir/varnishlog" "$b/%_sbindir/rcvarnishlog";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##config files
|
2012-02-28 16:45:40 +01:00
|
|
|
install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf";
|
|
|
|
install -Dpm 0644 %{S:4} "$b/%_sysconfdir/%name/vcl.conf.example";
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2012-02-28 16:45:40 +01:00
|
|
|
find "$b" -type f -name "*.la" -delete
|
|
|
|
mkdir -p "$b/%pkg_logdir"
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%pre
|
2011-06-29 14:26:44 +02:00
|
|
|
%_bindir/getent group varnish >/dev/null || \
|
|
|
|
%_sbindir/groupadd -r varnish || :
|
|
|
|
%_bindir/getent passwd varnish >/dev/null || \
|
|
|
|
%_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
|
|
|
|
-d %pkg_home varnish || :
|
2012-02-29 08:32:57 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_add_pre varnish.service
|
|
|
|
%service_add_pre varnishlog.service
|
2012-02-28 16:45:40 +01:00
|
|
|
%endif
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%post
|
2012-02-18 01:56:34 +01:00
|
|
|
%fillup_and_insserv varnish
|
|
|
|
%fillup_and_insserv varnishlog
|
2012-02-29 08:32:57 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_add_post varnish.service
|
|
|
|
%service_add_post varnishlog.service
|
2012-02-28 16:45:40 +01:00
|
|
|
%endif
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%preun
|
2012-02-18 01:56:34 +01:00
|
|
|
%stop_on_removal varnish
|
|
|
|
%stop_on_removal varnishlog
|
2012-02-29 08:32:57 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_del_preun varnish.service
|
|
|
|
%service_del_preun varnishlog.service
|
2012-02-28 16:45:40 +01:00
|
|
|
%endif
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%postun
|
2012-09-24 05:29:35 +02:00
|
|
|
# Does sysv+systemd not very much conflict? But rpmlint wants to have it...
|
2012-02-18 01:56:34 +01:00
|
|
|
%restart_on_update varnish
|
|
|
|
%restart_on_update varnishlog
|
2012-02-29 08:32:57 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_del_postun varnish.service
|
|
|
|
%service_del_postun varnishlog.service
|
2012-02-28 16:45:40 +01:00
|
|
|
%endif
|
2011-06-29 14:26:44 +02:00
|
|
|
%insserv_cleanup
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2011-06-29 14:26:44 +02:00
|
|
|
%post -n %library_name -p /sbin/ldconfig
|
|
|
|
%postun -n %library_name -p /sbin/ldconfig
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%files
|
2012-02-09 00:28:53 +01:00
|
|
|
%defattr(-,root,root)
|
2012-02-18 01:56:34 +01:00
|
|
|
%_initddir/varnish
|
|
|
|
%_initddir/varnishlog
|
2012-02-28 16:45:40 +01:00
|
|
|
%if 0%{?_unitdir:1}
|
2012-02-28 15:47:45 +01:00
|
|
|
%_unitdir
|
2012-02-28 16:45:40 +01:00
|
|
|
%endif
|
2012-02-09 00:28:53 +01:00
|
|
|
%config(noreplace) %_sysconfdir/logrotate.d/varnish
|
|
|
|
%dir %attr(0750,root,varnish) %_sysconfdir/%name/
|
|
|
|
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf
|
|
|
|
%config %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf.example
|
|
|
|
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/default.vcl
|
|
|
|
%_libdir/varnish
|
|
|
|
%_sbindir/varnish*
|
2012-02-28 16:45:40 +01:00
|
|
|
%_sbindir/rcvarnish*
|
2012-02-09 00:28:53 +01:00
|
|
|
%_mandir/man*/*
|
|
|
|
%doc ChangeLog LICENSE README
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_home
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%if 0%{?suse_version}
|
2012-02-09 00:28:53 +01:00
|
|
|
%_localstatedir/adm/fillup-templates/sysconfig.%name
|
2010-09-24 01:07:49 +02:00
|
|
|
%else
|
2011-06-29 14:26:44 +02:00
|
|
|
%config(noreplace) %_sysconfdir/sysconfig/%name
|
2010-09-24 01:07:49 +02:00
|
|
|
%doc redhat/README.redhat
|
|
|
|
%endif
|
|
|
|
|
2011-06-29 14:26:44 +02:00
|
|
|
%files -n %library_name
|
2010-09-24 01:07:49 +02:00
|
|
|
%defattr(-,root,root,-)
|
2012-02-09 00:28:53 +01:00
|
|
|
%_libdir/libvarnishapi.so.1*
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root,-)
|
2012-02-09 00:28:53 +01:00
|
|
|
%_includedir/varnish
|
2011-06-29 14:26:44 +02:00
|
|
|
%_libdir/pkgconfig/*
|
2012-02-09 00:28:53 +01:00
|
|
|
%_libdir/libvarnishapi.so
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%changelog
|