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
|
|
|
#
|
2016-02-16 13:38:34 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX 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/
|
|
|
|
#
|
|
|
|
|
2015-03-27 11:35:30 +01:00
|
|
|
|
2012-02-09 00:28:53 +01:00
|
|
|
%define library_name libvarnishapi1
|
2016-02-16 13:38:59 +01:00
|
|
|
%define pkg_home %_localstatedir/lib/%name
|
|
|
|
%define pkg_logdir %_localstatedir/log/%name
|
|
|
|
%define pkg_cachedir %_localstatedir/cache/%name
|
2016-02-16 13:38:34 +01:00
|
|
|
Name: varnish
|
|
|
|
Version: 4.1.1
|
2011-04-15 10:09:03 +02:00
|
|
|
Release: 0
|
2016-02-16 13:38:34 +01:00
|
|
|
Summary: High-performance HTTP accelerator
|
2012-02-09 00:28:53 +01:00
|
|
|
License: BSD-2-Clause
|
2010-09-24 01:07:49 +02:00
|
|
|
Group: Productivity/Networking/Web/Proxy
|
2016-02-16 13:38:59 +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
|
2016-02-16 13:38:59 +01:00
|
|
|
Source: https://repo.varnish-cache.org/source/%name-%version.tar.gz
|
2015-03-27 11:35:30 +01:00
|
|
|
Source3: varnish.sysconfig
|
|
|
|
Source5: varnish.logrotate
|
|
|
|
Source7: varnish.service
|
|
|
|
Source8: varnishlog.service
|
|
|
|
BuildRequires: libxslt
|
|
|
|
BuildRequires: ncurses-devel
|
|
|
|
BuildRequires: pcre-devel
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: python-docutils
|
2016-02-16 13:38:34 +01:00
|
|
|
BuildRequires: readline-devel
|
|
|
|
BuildRequires: systemd-rpm-macros
|
2015-03-27 11:35:30 +01:00
|
|
|
BuildRequires: xz
|
2016-02-16 13:38:34 +01:00
|
|
|
Requires: c_compiler
|
2016-02-16 13:38:59 +01:00
|
|
|
BuildRoot: %_tmppath/%name-%version-build
|
|
|
|
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-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.
|
|
|
|
|
2016-02-16 13:38:59 +01:00
|
|
|
%package -n %library_name
|
2010-09-24 01:07:49 +02:00
|
|
|
Summary: Shared libraries for Varnish
|
2015-03-27 11:35:30 +01:00
|
|
|
Group: Productivity/Networking/Web/Proxy
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2016-02-16 13:38:59 +01: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
|
|
|
|
Summary: Development files for Varnish
|
2015-03-27 11:35:30 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2016-02-16 13:38:59 +01:00
|
|
|
Requires: %name = %version
|
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
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%build
|
2016-02-16 13:38:59 +01:00
|
|
|
export CFLAGS="%optflags -fstack-protector"
|
|
|
|
%configure --disable-static --docdir="%_docdir/%name" \
|
2016-02-16 13:40:47 +01:00
|
|
|
--localstatedir="%_localstatedir/cache/" \
|
2016-02-16 14:09:08 +01:00
|
|
|
--disable-silent-rules \
|
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
|
2016-02-16 13:38:59 +01:00
|
|
|
b="%buildroot";
|
2015-03-27 19:14:08 +01:00
|
|
|
%make_install
|
2011-06-29 14:26:44 +02:00
|
|
|
# There is no use for them to normal users
|
2016-02-16 13:38:59 +01:00
|
|
|
mv "$b/%_bindir"/* "$b/%_sbindir/";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##missing directories
|
2016-02-16 13:38:59 +01:00
|
|
|
install -dm 0755 "$b"/{%pkg_logdir,%pkg_home};
|
2016-02-16 13:40:47 +01:00
|
|
|
install -Dpm 0644 "%{S:5}" "$b/%_sysconfdir/logrotate.d/varnish";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##init scripts
|
2016-02-16 13:40:47 +01:00
|
|
|
install -Dpm 0644 "%{S:3}" "$b%_localstatedir/adm/fillup-templates/sysconfig.%name";
|
|
|
|
install -Dpm 0644 "%{S:7}" "$b/%_unitdir/varnish.service";
|
|
|
|
install -Dpm 0644 "%{S:8}" "$b/%_unitdir/varnishlog.service";
|
2016-02-16 13:38:59 +01:00
|
|
|
mkdir -p "$b/%_sbindir";
|
|
|
|
ln -s service "$b/%_sbindir/rcvarnish";
|
|
|
|
ln -s service "$b/%_sbindir/rcvarnishlog";
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##config files
|
2016-02-16 13:38:59 +01:00
|
|
|
mkdir -p "$b/%_sysconfdir/%name"
|
|
|
|
cp "$b/%_docdir/%name/example.vcl" "$b/%_sysconfdir/%name/vcl.conf"
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2016-02-16 13:40:47 +01:00
|
|
|
find "$b" -type f -name "*.la" -delete -print
|
2016-02-16 13:38:59 +01:00
|
|
|
mkdir -p "$b/%pkg_logdir"
|
|
|
|
mkdir -p "$b/%_docdir/%name"
|
|
|
|
cp -a ChangeLog LICENSE README "$b/%_docdir/%name/"
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2016-02-16 14:09:08 +01:00
|
|
|
%check
|
2016-03-01 13:34:24 +01:00
|
|
|
if ! make %{?_smp_mflags} check; then
|
|
|
|
x="$?"
|
|
|
|
cat bin/varnishtest/test-suite.log
|
|
|
|
exit "$x"
|
|
|
|
fi
|
2016-02-16 14:09:08 +01:00
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%pre
|
2016-02-16 13:38:59 +01: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-28 15:47:45 +01:00
|
|
|
%service_add_pre varnish.service
|
|
|
|
%service_add_pre varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%post
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_add_post varnish.service
|
|
|
|
%service_add_post varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%preun
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_del_preun varnish.service
|
|
|
|
%service_del_preun varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%postun
|
2012-02-28 15:47:45 +01:00
|
|
|
%service_del_postun varnish.service
|
|
|
|
%service_del_postun varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2016-02-16 13:38:59 +01:00
|
|
|
%post -n %library_name -p /sbin/ldconfig
|
|
|
|
%postun -n %library_name -p /sbin/ldconfig
|
2016-02-16 13:40:47 +01:00
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%files
|
2012-02-09 00:28:53 +01:00
|
|
|
%defattr(-,root,root)
|
2016-02-16 13:38:59 +01:00
|
|
|
%_unitdir/*.service
|
|
|
|
%config(noreplace) %_sysconfdir/logrotate.d/varnish
|
|
|
|
%dir %attr(0750,root,varnish) %_sysconfdir/%name/
|
|
|
|
%config(noreplace) %attr(0640,root,varnish) %_sysconfdir/%name/vcl.conf
|
|
|
|
%_libdir/varnish
|
|
|
|
%_sbindir/varnish*
|
|
|
|
%_sbindir/rcvarnish*
|
|
|
|
%_mandir/man*/*
|
|
|
|
%_docdir/%name/
|
|
|
|
%_datadir/%name/
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_home
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
|
|
|
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
|
|
|
%_localstatedir/adm/fillup-templates/sysconfig.%name
|
|
|
|
|
|
|
|
%files -n %library_name
|
2010-09-24 01:07:49 +02:00
|
|
|
%defattr(-,root,root,-)
|
2016-02-16 13:38:59 +01:00
|
|
|
%_libdir/libvarnishapi.so.1*
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root,-)
|
2016-02-16 13:38:59 +01:00
|
|
|
%_includedir/varnish
|
|
|
|
%_datadir/aclocal/
|
|
|
|
%_libdir/pkgconfig/*
|
|
|
|
%_libdir/libvarnishapi.so
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%changelog
|