Various spec file tweaks and cache_swap script optimization

Resolves: #1784383 - Add BuildRequires: systemd-rpm-macros
Resolves: #1783757 - Build with ./configure --with-pidfile=/run/squid.pid
Resolves: #1783768 - Optimize cache_swap.sh cache_dir search
This commit is contained in:
Lubos Uhliarik 2019-12-17 14:28:48 +01:00
parent 251ebfccea
commit f2f206eb62
2 changed files with 15 additions and 7 deletions

View File

@ -5,8 +5,7 @@ fi
SQUID_CONF=${SQUID_CONF:-"/etc/squid/squid.conf"}
CACHE_SWAP=`sed -e 's/#.*//g' $SQUID_CONF | \
grep cache_dir | awk '{ print $3 }'`
CACHE_SWAP=`grep '^[[:blank:]]*cache_dir' $SQUID_CONF | awk '{ print $3 }'`
init_cache_dirs=0
for adir in $CACHE_SWAP; do

View File

@ -2,7 +2,7 @@
Name: squid
Version: 4.9
Release: 2%{?dist}
Release: 3%{?dist}
Summary: The Squid proxy caching server
Epoch: 7
# See CREDITS for breakdown of non GPLv2+ code
@ -34,7 +34,8 @@ Patch203: squid-3.0.STABLE1-perlpath.patch
Patch204: squid-3.5.9-include-guards.patch
Patch205: squid-4.0.21-large-acl.patch
Requires: bash >= 2.0
# cache_swap.sh
Requires: bash grep gawk
# for httpd conf file - cachemgr script alias
Requires: httpd-filesystem
Requires(pre): shadow-utils
@ -65,6 +66,9 @@ BuildRequires: perl-generators
BuildRequires: pkgconfig(cppunit)
# For verifying downloded src tarball
BuildRequires: gnupg2
# for _tmpfilesdir and _unitdir macro
# see https://docs.fedoraproject.org/en-US/packaging-guidelines/Systemd/#_packaging
BuildRequires: systemd-rpm-macros
# Old NetworkManager expects the dispatcher scripts in a different place
@ -110,7 +114,7 @@ sed -i 's|@SYSCONFDIR@/squid.conf.documented|%{_pkgdocdir}/squid.conf.documented
--datadir=%{_datadir}/squid \
--sysconfdir=%{_sysconfdir}/squid \
--with-logdir='%{_localstatedir}/log/squid' \
--with-pidfile='%{_localstatedir}/run/squid.pid' \
--with-pidfile='/run/squid.pid' \
--disable-dependency-tracking \
--enable-eui \
--enable-follow-x-forwarded-for \
@ -189,7 +193,7 @@ install -m 644 $RPM_BUILD_ROOT/squid.httpd.tmp $RPM_BUILD_ROOT%{_sysconfdir}/htt
install -m 755 %{SOURCE6} $RPM_BUILD_ROOT%{_prefix}/lib/NetworkManager/dispatcher.d/20-squid
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/squid
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/spool/squid
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/squid
mkdir -p $RPM_BUILD_ROOT/run/squid
chmod 644 contrib/url-normalizer.pl contrib/user-agents.pl
iconv -f ISO88591 -t UTF8 ChangeLog -o ChangeLog.tmp
mv -f ChangeLog.tmp ChangeLog
@ -225,7 +229,7 @@ rm -f $RPM_BUILD_ROOT/squid.httpd.tmp
%attr(755,root,root) %dir %{_libdir}/squid
%attr(770,squid,root) %dir %{_localstatedir}/log/squid
%attr(750,squid,squid) %dir %{_localstatedir}/spool/squid
%attr(755,squid,squid) %dir %{_localstatedir}/run/squid
%attr(755,squid,squid) %dir /run/squid
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/httpd/conf.d/squid.conf
%config(noreplace) %attr(640,root,squid) %{_sysconfdir}/squid/squid.conf
@ -291,6 +295,11 @@ fi
%changelog
* Tue Dec 17 2019 Lubos Uhliarik <luhliari@redhat.com> - 7:4.9-3
- Resolves: #1784383 - Add BuildRequires: systemd-rpm-macros
- Resolves: #1783757 - Build with ./configure --with-pidfile=/run/squid.pid
- Resolves: #1783768 - Optimize cache_swap.sh cache_dir search
* Mon Nov 11 2019 Lubos Uhliarik <luhliari@redhat.com> - 7:4.9-2
- new version 4.9
- verify src taball signature by default in prep section