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
|
|
|
#
|
2022-08-12 12:34:06 +02:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
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.
|
|
|
|
|
2021-08-06 12:27:56 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
|
2015-03-27 11:35:30 +01:00
|
|
|
|
2022-05-16 22:30:08 +02:00
|
|
|
%define library_name libvarnishapi3
|
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
|
2021-08-06 12:27:56 +02:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if !0%{?_fillupdir:1}
|
|
|
|
%define _fillupdir %_localstatedir/adm/fillup-templates
|
|
|
|
%endif
|
2016-02-16 13:38:34 +01:00
|
|
|
Name: varnish
|
2022-11-09 18:25:08 +01:00
|
|
|
Version: 7.2.1
|
2011-04-15 10:09:03 +02:00
|
|
|
Release: 0
|
2018-03-19 23:26:28 +01:00
|
|
|
Summary: Accelerator for HTTP services
|
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
|
2021-08-06 12:27:56 +02:00
|
|
|
URL: https://varnish-cache.org/
|
2020-06-09 21:34:14 +02:00
|
|
|
#Git-Web: https://github.com/varnishcache/varnish-cache
|
2018-03-19 23:26:28 +01:00
|
|
|
Source: https://varnish-cache.org/_downloads/%name-%version.tgz
|
2015-03-27 11:35:30 +01:00
|
|
|
Source3: varnish.sysconfig
|
|
|
|
Source5: varnish.logrotate
|
|
|
|
Source7: varnish.service
|
|
|
|
Source8: varnishlog.service
|
2022-09-18 23:03:45 +02:00
|
|
|
Source9: varnish_reload_vcl
|
2019-08-26 14:35:16 +02:00
|
|
|
Patch2: uninit.patch
|
2022-05-16 22:11:26 +02:00
|
|
|
BuildRequires: libxslt-devel
|
2015-03-27 11:35:30 +01:00
|
|
|
BuildRequires: ncurses-devel
|
2022-05-16 22:11:26 +02:00
|
|
|
BuildRequires: pkgconfig(libpcre2-8)
|
2021-08-06 12:27:56 +02:00
|
|
|
BuildRequires: python3-Sphinx
|
|
|
|
BuildRequires: python3-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
|
2021-08-06 12:27:56 +02:00
|
|
|
Requires(pre): %_sbindir/groupadd
|
|
|
|
Requires(pre): %_sbindir/useradd
|
2010-09-24 01:07:49 +02:00
|
|
|
Recommends: logrotate
|
2012-02-09 00:28:53 +01:00
|
|
|
|
2010-09-24 01:07:49 +02:00
|
|
|
%description
|
2018-03-19 23:26:28 +01:00
|
|
|
Varnish is an HTTP accelerator. Often called Reverse Proxy, it is an
|
|
|
|
application that stores (caches) documents that have been requested
|
|
|
|
over the HTTP protocol.
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2018-03-19 23:26:28 +01:00
|
|
|
Based on certain criteria, the next client requesting the document is either
|
2010-09-24 01:07:49 +02:00
|
|
|
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
|
2018-03-19 23:26:28 +01:00
|
|
|
Varnish is an HTTP accelerator. Often called Reverse Proxy, it is an
|
|
|
|
application that stores (caches) documents that have been requested
|
|
|
|
over the HTTP protocol.
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2018-03-19 23:26:28 +01:00
|
|
|
Based on certain criteria, the next client requesting the document is either
|
2010-09-24 01:07:49 +02:00
|
|
|
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
|
2018-03-19 23:26:28 +01:00
|
|
|
Varnish is an HTTP accelerator. Often called Reverse Proxy, it is an
|
|
|
|
application that stores (caches) documents that have been requested
|
|
|
|
over the HTTP protocol.
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
This package holds the development files for varnish.
|
|
|
|
|
|
|
|
%prep
|
2019-03-27 12:53:50 +01:00
|
|
|
%autosetup -p1
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%build
|
2020-06-23 09:35:26 +02:00
|
|
|
%define _lto_cflags %nil
|
2022-05-16 22:19:45 +02:00
|
|
|
export CFLAGS="%optflags -fcommon -fstack-protector"
|
2016-08-18 10:46:22 +02:00
|
|
|
%ifarch %ix86
|
2018-03-19 23:26:28 +01:00
|
|
|
export CFLAGS="$CFLAGS -ffloat-store -fexcess-precision=standard"
|
2016-08-18 10:46:22 +02:00
|
|
|
%endif
|
2016-02-16 13:38:59 +01:00
|
|
|
%configure --disable-static --docdir="%_docdir/%name" \
|
2022-05-16 22:23:07 +02:00
|
|
|
--localstatedir="%_localstatedir/cache/"
|
|
|
|
%make_build V=1
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%install
|
2018-03-19 23:26:28 +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
|
2018-03-19 23:26:28 +01:00
|
|
|
mv "$b/%_bindir"/* "$b/%_sbindir/"
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##missing directories
|
2018-03-19 23:26:28 +01:00
|
|
|
install -dm 0755 "$b"/{%pkg_logdir,%pkg_home}
|
2021-08-06 12:27:56 +02:00
|
|
|
install -Dpm 0644 "%SOURCE5" "$b/%_sysconfdir/logrotate.d/varnish"
|
2010-09-24 01:07:49 +02:00
|
|
|
#
|
|
|
|
##init scripts
|
2021-08-06 12:27:56 +02:00
|
|
|
install -Dpm 0644 "%SOURCE3" "$b/%_fillupdir/sysconfig.%name"
|
|
|
|
install -Dpm 0644 "%SOURCE7" "$b/%_unitdir/varnish.service"
|
|
|
|
install -Dpm 0644 "%SOURCE8" "$b/%_unitdir/varnishlog.service"
|
2018-03-19 23:26:28 +01:00
|
|
|
mkdir -p "$b/%_sbindir"
|
|
|
|
ln -s service "$b/%_sbindir/rcvarnish"
|
|
|
|
ln -s service "$b/%_sbindir/rcvarnishlog"
|
2022-09-18 23:03:45 +02:00
|
|
|
install -Dpm 0755 "%SOURCE9" "$b/%_sbindir/varnish_reload_vcl"
|
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"
|
2019-09-17 13:29:58 +02:00
|
|
|
cp -a doc/changes.rst LICENSE README.rst "$b/%_docdir/%name/"
|
2010-09-24 01:07:49 +02:00
|
|
|
|
2018-03-19 23:26:28 +01:00
|
|
|
perl -i -pe 's{^#!/usr/bin/env python}{#!/usr/bin/python}g' \
|
2021-08-06 12:27:56 +02:00
|
|
|
"$b/%_datadir/varnish/vmodtool.py" "$b/%_datadir/varnish/vsctool.py"
|
2018-03-19 23:26:28 +01:00
|
|
|
|
2016-02-16 14:09:08 +01:00
|
|
|
%check
|
2020-09-17 10:41:58 +02:00
|
|
|
if ! %make_build check; then
|
2016-03-01 13:34:24 +01:00
|
|
|
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 || \
|
2018-03-19 23:26:28 +01:00
|
|
|
%_sbindir/groupadd -r varnish
|
2016-02-16 13:38:59 +01:00
|
|
|
%_bindir/getent passwd varnish >/dev/null || \
|
|
|
|
%_sbindir/useradd -g varnish -s /bin/false -r -c "user for Varnish" \
|
2018-03-19 23:26:28 +01:00
|
|
|
-d %pkg_home varnish
|
|
|
|
%service_add_pre varnish.service varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%post
|
2018-05-02 08:47:54 +02:00
|
|
|
%fillup_only
|
2018-03-19 23:26:28 +01:00
|
|
|
%service_add_post varnish.service varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%preun
|
2018-03-19 23:26:28 +01:00
|
|
|
%service_del_preun varnish.service varnishlog.service
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%postun
|
2018-03-19 23:26:28 +01:00
|
|
|
%service_del_postun varnish.service 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
|
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
|
2018-05-02 08:47:54 +02:00
|
|
|
%_fillupdir/sysconfig.%name
|
2016-02-16 13:38:59 +01:00
|
|
|
|
|
|
|
%files -n %library_name
|
2022-05-16 22:30:08 +02:00
|
|
|
%_libdir/libvarnishapi.so.3*
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%files devel
|
2018-05-02 08:47:54 +02:00
|
|
|
%_includedir/varnish/
|
2016-02-16 13:38:59 +01:00
|
|
|
%_datadir/aclocal/
|
|
|
|
%_libdir/pkgconfig/*
|
|
|
|
%_libdir/libvarnishapi.so
|
2010-09-24 01:07:49 +02:00
|
|
|
|
|
|
|
%changelog
|