From 901a4dfe17d11cd22db44629b9747eabca5e5b68cb4856e9e0ee4b813b2c22b3 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Tue, 20 Feb 2018 07:30:53 +0000 Subject: [PATCH] Accepting request 578251 from home:adamm:branches:server:proxy - Spec file cleanup: + Drop unused fillup template - it's not used by systemd script + Drop %pretrans section which is only used to upgrade from version 3.4 of squid - no supported codestream has that version. + Drop explicit BR: on systemd-rpm-macros - Update squid.service systemd file + Don't need to use squid to manage squid anymore + Drop references to default config file, since it's default - Drop reference to nonexistent EnvironmentFile in the service file OBS-URL: https://build.opensuse.org/request/show/578251 OBS-URL: https://build.opensuse.org/package/show/server:proxy/squid?expand=0&rev=150 --- initialize_cache_if_needed.sh | 2 +- squid.changes | 13 +++++++++++++ squid.service | 7 +++---- squid.spec | 24 ------------------------ squid.sysconfig | 23 ----------------------- 5 files changed, 17 insertions(+), 52 deletions(-) delete mode 100644 squid.sysconfig diff --git a/initialize_cache_if_needed.sh b/initialize_cache_if_needed.sh index 85d4ddd..d46eed9 100644 --- a/initialize_cache_if_needed.sh +++ b/initialize_cache_if_needed.sh @@ -8,6 +8,6 @@ fi if ! test -d $CACHE_DIR; then echo "Initializing cache directories..." - exec /usr/sbin/squid -z -F --foreground -S -f /etc/squid/squid.conf + exec /usr/sbin/squid -z -F --foreground -S fi diff --git a/squid.changes b/squid.changes index 0df488c..2c672bb 100644 --- a/squid.changes +++ b/squid.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Feb 19 08:08:14 UTC 2018 - adam.majer@suse.de + +- Spec file cleanup: + + Drop unused fillup template - it's not used by systemd script + + Drop %pretrans section which is only used to upgrade from + version 3.4 of squid - no supported codestream has that version. + + Drop explicit BR: on systemd-rpm-macros +- Update squid.service systemd file + + Don't need to use squid to manage squid anymore + + Drop references to default config file, since it's default +- Drop reference to nonexistent EnvironmentFile in the service file + ------------------------------------------------------------------- Mon Jan 29 10:36:36 UTC 2018 - adam.majer@suse.de diff --git a/squid.service b/squid.service index ab3bd3f..66b1f14 100644 --- a/squid.service +++ b/squid.service @@ -1,14 +1,13 @@ [Unit] Description=Squid caching proxy +Documentation=man:squid(8) After=network.target named.service nss-lookup.service [Service] Type=forking -EnvironmentFile=-/etc/sysconfig/squid ExecStartPre=%{_libdir}/squid/initialize_cache_if_needed.sh -ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf -ExecReload=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf -k reconfigure -ExecStop=/usr/sbin/squid -F -f /etc/squid/squid.conf -k shutdown +ExecStart=/usr/sbin/squid -FC +ExecReload=/usr/bin/kill -HUP $MAINPID LimitNOFILE=4096 PIDFile=/run/squid.pid diff --git a/squid.spec b/squid.spec index e173b0f..4bf42d8 100644 --- a/squid.spec +++ b/squid.spec @@ -18,10 +18,6 @@ %define squidlibdir %{_libdir}/squid %define squidconfdir %{_sysconfdir}/squid -#Compat macro for new _fillupdir macro introduced in Nov 2017 -%if ! %{defined _fillupdir} - %define _fillupdir %{_localstatedir}/adm/fillup-templates -%endif Name: squid Version: 4.0.23 Release: 0 @@ -31,7 +27,6 @@ Group: Productivity/Networking/Web/Proxy Url: http://www.squid-cache.org Source0: http://www.squid-cache.org/Versions/v4/squid-%{version}.tar.xz Source1: http://www.squid-cache.org/Versions/v4/squid-%{version}.tar.xz.asc -Source4: squid.sysconfig Source5: pam.squid Source6: unsquid.pl Source7: %{name}.logrotate @@ -58,7 +53,6 @@ BuildRequires: pam-devel BuildRequires: pkgconfig BuildRequires: samba-winbind BuildRequires: sharutils -BuildRequires: systemd-rpm-macros BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(gssrpc) BuildRequires: pkgconfig(kdb) @@ -66,7 +60,6 @@ BuildRequires: pkgconfig(krb5) BuildRequires: pkgconfig(libsasl2) BuildRequires: pkgconfig(libxml-2.0) Requires: logrotate -Requires(post): %fillup_prereq Requires(pre): permissions Requires(pre): shadow Provides: http_proxy @@ -186,7 +179,6 @@ install -D -m 755 %{SOURCE15} %{buildroot}%{squidlibdir}/cache_dir.sed install -D -m 755 %{SOURCE16} %{buildroot}%{squidlibdir}/initialize_cache_if_needed.sh sed -i -e 's!%%{_libdir}!%{_libdir}!' %{buildroot}%{_unitdir}/%{name}.service ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} -install -Dpm 644 %{SOURCE4} %{buildroot}%{_fillupdir}/sysconfig.%{name} # Move the MIB definition to the proper place (and name) mkdir -p %{buildroot}%{_datadir}/snmp/mibs @@ -226,21 +218,6 @@ if [ "$1" -gt "1" ]; then fi fi -%pretrans -p --- Directory to symlink is not working in RPM so workaround it --- Occurs when updating from 3.4 to 3.5 -error_dir="%{_datadir}/%{name}/errors/" -bad_ones={"zh-cn","zh-tw"} -print("cleaning up old directories") -for i,f in pairs(bad_ones) do - pstat = posix.stat(error_dir..f) - if pstat and pstat.type == "directory" then - print ("moving away "..error_dir..f.." to "..error_dir..f .. ".rpmmoved") - --posix.rmdir(error_dir..f) - os.rename(error_dir..f, error_dir..f .. ".rpmmoved") - end -end - %post %set_permissions %{_sbindir}/basic_pam_auth %set_permissions %{_sbindir}/pinger @@ -340,7 +317,6 @@ end %{_sbindir}/url_lfs_rewrite %{_sbindir}/ext_time_quota_acl %{_sbindir}/rc%{name} -%{_fillupdir}/sysconfig.%{name} %dir %{_libdir}/%{name} %{_libdir}/%{name}/cachemgr.cgi diff --git a/squid.sysconfig b/squid.sysconfig deleted file mode 100644 index 04d68d1..0000000 --- a/squid.sysconfig +++ /dev/null @@ -1,23 +0,0 @@ -## Path: Network/WWW/Proxy/squid -## Description: squid webproxy options - -## Type: integer(1:) -## Default: "60" -# -# kill squid after this timeout in double-seconds with SIGTERM -# -SQUID_SHUTDOWN_TIMEOUT="60" - -## Type: text -## Default: "-sY" -# -# squid daemon start options -# -SQUID_START_OPTIONS="-sY" - -## Type: integer(1:) -## Default: "4096" -# -# default ulimit to set -# -SQUID_DEFAULT_ULIMT="4096"