forked from pool/varnish
use sysusers fragment from solanum
OBS-URL: https://build.opensuse.org/package/show/server:http/varnish?expand=0&rev=128
This commit is contained in:
parent
e0f1d84375
commit
afb54fef80
@ -1,2 +0,0 @@
|
|||||||
#Type Name ID GECOS Home directory Shell
|
|
||||||
u varnish - "User for Varnish" /var/lib/varnish -
|
|
15
varnish.spec
15
varnish.spec
@ -33,7 +33,6 @@ Group: Productivity/Networking/Web/Proxy
|
|||||||
URL: https://varnish-cache.org/
|
URL: https://varnish-cache.org/
|
||||||
#Git-Web: https://github.com/varnishcache/varnish-cache
|
#Git-Web: https://github.com/varnishcache/varnish-cache
|
||||||
Source: https://varnish-cache.org/_downloads/%name-%version.tgz
|
Source: https://varnish-cache.org/_downloads/%name-%version.tgz
|
||||||
Source2: %{name}-user.conf
|
|
||||||
Source3: varnish.sysconfig
|
Source3: varnish.sysconfig
|
||||||
Source5: varnish.logrotate
|
Source5: varnish.logrotate
|
||||||
Source7: varnish.service
|
Source7: varnish.service
|
||||||
@ -45,12 +44,13 @@ BuildRequires: ncurses-devel
|
|||||||
BuildRequires: python3-Sphinx
|
BuildRequires: python3-Sphinx
|
||||||
BuildRequires: python3-docutils
|
BuildRequires: python3-docutils
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
|
BuildRequires: systemd-rpm-macros
|
||||||
BuildRequires: sysuser-tools
|
BuildRequires: sysuser-tools
|
||||||
BuildRequires: xz
|
BuildRequires: xz
|
||||||
BuildRequires: pkgconfig(libpcre2-8)
|
BuildRequires: pkgconfig(libpcre2-8)
|
||||||
Requires: c_compiler
|
Requires: c_compiler
|
||||||
|
%sysusers_requires
|
||||||
Recommends: logrotate
|
Recommends: logrotate
|
||||||
%{?sysusers_requires}
|
|
||||||
%{?systemd_ordering}
|
%{?systemd_ordering}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -95,7 +95,6 @@ This package holds the development files for varnish.
|
|||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%sysusers_generate_pre %{SOURCE2} %{name} %{name}-user.conf
|
|
||||||
%define _lto_cflags %nil
|
%define _lto_cflags %nil
|
||||||
export CFLAGS="%optflags -fcommon -fstack-protector"
|
export CFLAGS="%optflags -fcommon -fstack-protector"
|
||||||
%ifarch %ix86
|
%ifarch %ix86
|
||||||
@ -116,7 +115,6 @@ install -dm 0755 "$b"/{%pkg_logdir,%pkg_home}
|
|||||||
install -Dpm 0644 "%SOURCE5" "$b/%_sysconfdir/logrotate.d/varnish"
|
install -Dpm 0644 "%SOURCE5" "$b/%_sysconfdir/logrotate.d/varnish"
|
||||||
#
|
#
|
||||||
##init scripts
|
##init scripts
|
||||||
install -Dpm 0644 "%SOURCE2" "$b/%_sysusersdir/%{name}-user.conf"
|
|
||||||
install -Dpm 0644 "%SOURCE3" "$b/%_fillupdir/sysconfig.%name"
|
install -Dpm 0644 "%SOURCE3" "$b/%_fillupdir/sysconfig.%name"
|
||||||
install -Dpm 0644 "%SOURCE7" "$b/%_unitdir/varnish.service"
|
install -Dpm 0644 "%SOURCE7" "$b/%_unitdir/varnish.service"
|
||||||
install -Dpm 0644 "%SOURCE8" "$b/%_unitdir/varnishlog.service"
|
install -Dpm 0644 "%SOURCE8" "$b/%_unitdir/varnishlog.service"
|
||||||
@ -137,6 +135,11 @@ cp -a doc/changes.rst LICENSE README.rst "$b/%_docdir/%name/"
|
|||||||
perl -i -pe 's{^#!/usr/bin/env python}{#!/usr/bin/python}g' \
|
perl -i -pe 's{^#!/usr/bin/env python}{#!/usr/bin/python}g' \
|
||||||
"$b/%_datadir/varnish/vmodtool.py" "$b/%_datadir/varnish/vsctool.py"
|
"$b/%_datadir/varnish/vmodtool.py" "$b/%_datadir/varnish/vsctool.py"
|
||||||
|
|
||||||
|
mkdir -p "$b/%_sysusersdir"
|
||||||
|
echo 'u - "user for Varnish" %pkg_home' >system-user-varnish.conf
|
||||||
|
cp -a system-user-varnish.conf "$b/%_sysusersdir/"
|
||||||
|
%sysusers_generate_pre system-user-varnish.conf random system-user-varnish.conf
|
||||||
|
|
||||||
%check
|
%check
|
||||||
if ! %make_build check; then
|
if ! %make_build check; then
|
||||||
x="$?"
|
x="$?"
|
||||||
@ -144,7 +147,7 @@ if ! %make_build check; then
|
|||||||
exit "$x"
|
exit "$x"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%pre -f %{name}.pre
|
%pre -f random.pre
|
||||||
%service_add_pre varnish.service varnishlog.service
|
%service_add_pre varnish.service varnishlog.service
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -175,7 +178,7 @@ fi
|
|||||||
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
%dir %attr(0750,varnish,varnish) %pkg_cachedir
|
||||||
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
%dir %attr(0750,varnish,varnish) %pkg_logdir
|
||||||
%_fillupdir/sysconfig.%name
|
%_fillupdir/sysconfig.%name
|
||||||
%_sysusersdir/%{name}-user.conf
|
%_sysusersdir/*
|
||||||
|
|
||||||
%files -n %library_name
|
%files -n %library_name
|
||||||
%_libdir/libvarnishapi.so.3*
|
%_libdir/libvarnishapi.so.3*
|
||||||
|
Loading…
Reference in New Issue
Block a user