|
@@ -1,7 +1,9 @@
|
|
|
|
+%bcond_with systemd
|
|
|
|
+
|
|
%define base_name squid
|
|
%define base_name squid
|
|
%define pkg_epoch 7
|
|
%define pkg_epoch 7
|
|
-%define pkg_version 4.10
|
|
|
|
-%define pkg_release 1%{?_dist_release}
|
|
|
|
|
|
+%define pkg_version 4.11
|
|
|
|
+%define pkg_release 1%{?_dist_release}%{?with_systemd:.systemd}
|
|
%define uid 23
|
|
%define uid 23
|
|
%define gid 23
|
|
%define gid 23
|
|
|
|
|
|
@@ -13,34 +15,39 @@ Name: %{base_name}
|
|
Epoch: %{pkg_epoch}
|
|
Epoch: %{pkg_epoch}
|
|
Version: %{pkg_version}
|
|
Version: %{pkg_version}
|
|
Release: %{pkg_release}
|
|
Release: %{pkg_release}
|
|
|
|
+Group: Applications/Services
|
|
|
|
+Vendor: Project Vine
|
|
|
|
+Distribution: Vine Linux
|
|
|
|
+
|
|
|
|
+License: GPLv2+
|
|
|
|
+URL: http://www.squid-cache.org
|
|
Source0: http://www.squid-cache.org/Versions/v4/%{base_name}-%{version}.tar.xz
|
|
Source0: http://www.squid-cache.org/Versions/v4/%{base_name}-%{version}.tar.xz
|
|
Source1: %{base_name}.init
|
|
Source1: %{base_name}.init
|
|
Source2: %{base_name}.logrotate
|
|
Source2: %{base_name}.logrotate
|
|
Source3: %{base_name}.sysconfig
|
|
Source3: %{base_name}.sysconfig
|
|
Source4: %{base_name}.pam
|
|
Source4: %{base_name}.pam
|
|
-License: GPLv2+
|
|
|
|
-Group: Applications/Services
|
|
|
|
-URL: http://www.squid-cache.org
|
|
|
|
|
|
+Source5: %{base_name}.service
|
|
|
|
+Source6: cache_swap.sh
|
|
|
|
|
|
Patch1: 0001-config.patch
|
|
Patch1: 0001-config.patch
|
|
Patch2: 0002-location.patch
|
|
Patch2: 0002-location.patch
|
|
Patch3: 0003-perlpath.patch
|
|
Patch3: 0003-perlpath.patch
|
|
|
|
|
|
|
|
+BuildRoot: %{_tmppath}/%{base_name}-%{version}-root
|
|
|
|
+BuildRequires: openldap-devel pam-devel openssl-devel krb5-devel
|
|
|
|
+BuildRequires: cyrus-sasl-devel libcap-devel libdb-devel
|
|
Requires: bash >= 2.0
|
|
Requires: bash >= 2.0
|
|
Requires(pre): shadow-utils
|
|
Requires(pre): shadow-utils
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%{?systemd_requires}
|
|
|
|
+%else
|
|
Requires(post): %{_syssbindir}/chkconfig
|
|
Requires(post): %{_syssbindir}/chkconfig
|
|
Requires(preun): %{_syssbindir}/chkconfig
|
|
Requires(preun): %{_syssbindir}/chkconfig
|
|
-BuildRequires: openldap-devel pam-devel openssl-devel krb5-devel
|
|
|
|
-BuildRequires: cyrus-sasl-devel libcap-devel libdb-devel
|
|
|
|
-BuildRoot: %{_tmppath}/%{base_name}-%{version}-root
|
|
|
|
|
|
+%endif
|
|
|
|
|
|
Conflicts: squid30
|
|
Conflicts: squid30
|
|
Obsoletes: squid-novm
|
|
Obsoletes: squid-novm
|
|
|
|
|
|
-Vendor: Project Vine
|
|
|
|
-Distribution: Vine Linux
|
|
|
|
-Packager: miyabi
|
|
|
|
-
|
|
|
|
%description
|
|
%description
|
|
Squid is a high-performance proxy caching server for Web clients,
|
|
Squid is a high-performance proxy caching server for Web clients,
|
|
supporting FTP, gopher, and HTTP data objects. Unlike traditional
|
|
supporting FTP, gopher, and HTTP data objects. Unlike traditional
|
|
@@ -66,6 +73,10 @@ Squid は、メインのサーバプログラム squid と、 Domain Name System
|
|
問い合わせプログラム (dnsserver) と、 FTP データを取得するプログラム
|
|
問い合わせプログラム (dnsserver) と、 FTP データを取得するプログラム
|
|
(ftpget) と、いくつかの管理用またはクライアントツールから成ります。
|
|
(ftpget) と、いくつかの管理用またはクライアントツールから成ります。
|
|
|
|
|
|
|
|
+
|
|
|
|
+%debug_package
|
|
|
|
+
|
|
|
|
+
|
|
%prep
|
|
%prep
|
|
%autosetup -p1
|
|
%autosetup -p1
|
|
|
|
|
|
@@ -120,6 +131,9 @@ LDFLAGS="$RPM_LD_FLAGS -pie -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel"
|
|
--with-openssl \
|
|
--with-openssl \
|
|
--with-pthreads \
|
|
--with-pthreads \
|
|
--disable-arch-native \
|
|
--disable-arch-native \
|
|
|
|
+%if %{with systemd}
|
|
|
|
+ --with-pidfile='/run/squid.pid' \
|
|
|
|
+%endif
|
|
--with-pic
|
|
--with-pic
|
|
|
|
|
|
%{__make} \
|
|
%{__make} \
|
|
@@ -154,7 +168,12 @@ mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/
|
|
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+install -Dpm644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service
|
|
|
|
+install -Dpm755 %{SOURCE6} ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/cache_swap.sh
|
|
|
|
+%else
|
|
install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initdir}/%{base_name}
|
|
install -m 755 %{SOURCE1} ${RPM_BUILD_ROOT}%{_initdir}/%{base_name}
|
|
|
|
+%endif
|
|
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{base_name}
|
|
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{base_name}
|
|
install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{base_name}
|
|
install -m 644 %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{base_name}
|
|
install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/%{base_name}
|
|
install -m 644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/%{base_name}
|
|
@@ -198,20 +217,34 @@ done
|
|
exit 0
|
|
exit 0
|
|
|
|
|
|
%post
|
|
%post
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_post %{name}.service
|
|
|
|
+%else
|
|
if ! /sbin/chkconfig %{base_name}; then
|
|
if ! /sbin/chkconfig %{base_name}; then
|
|
/sbin/chkconfig --add %{base_name}
|
|
/sbin/chkconfig --add %{base_name}
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
|
|
-if [ "$1" -eq "2" ]; then
|
|
|
|
- %{_initdir}/%{base_name} condrestart
|
|
|
|
-fi
|
|
|
|
|
|
|
|
%preun
|
|
%preun
|
|
-if [ "$1" -eq "0" ]; then
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_preun %{name}.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -eq "0" -o -x /bin/systemctl ]; then
|
|
%{_initdir}/%{base_name} stop
|
|
%{_initdir}/%{base_name} stop
|
|
rm -f %{_localstatedir}/log/%{base_name}/*
|
|
rm -f %{_localstatedir}/log/%{base_name}/*
|
|
/sbin/chkconfig --del %{base_name}
|
|
/sbin/chkconfig --del %{base_name}
|
|
fi
|
|
fi
|
|
|
|
+%endif
|
|
|
|
+
|
|
|
|
+%postun
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%systemd_postun_with_restart %{name}.service
|
|
|
|
+%else
|
|
|
|
+if [ "$1" -gt 1 ]; then
|
|
|
|
+ %{_initdir}/%{base_name} condrestart
|
|
|
|
+fi
|
|
|
|
+%endif
|
|
|
|
|
|
%triggerin -- samba-common
|
|
%triggerin -- samba-common
|
|
/usr/sbin/usermod -a -G wbpriv %{base_name} >/dev/null 2>&1 || \
|
|
/usr/sbin/usermod -a -G wbpriv %{base_name} >/dev/null 2>&1 || \
|
|
@@ -232,7 +265,13 @@ fi
|
|
%attr(0755,root,root) %{_sbindir}/%{base_name}
|
|
%attr(0755,root,root) %{_sbindir}/%{base_name}
|
|
%attr(0755,root,root) %{_bindir}/*
|
|
%attr(0755,root,root) %{_bindir}/*
|
|
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
|
+%attr(0644,root,root) %{_unitdir}/%{base_name}.service
|
|
|
|
+%dir %{_libexecdir}/%{base_name}
|
|
|
|
+%attr(0755,root,root) %{_libexecdir}/%{base_name}/*
|
|
|
|
+%else
|
|
%attr(0755,root,root) %{_initdir}/%{base_name}
|
|
%attr(0755,root,root) %{_initdir}/%{base_name}
|
|
|
|
+%endif
|
|
|
|
|
|
%attr(0755,root,root) %{_libdir}/%{base_name}/cachemgr.cgi
|
|
%attr(0755,root,root) %{_libdir}/%{base_name}/cachemgr.cgi
|
|
%attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/basic_*
|
|
%attr(4750,root,%{base_name}) %{_libdir}/%{base_name}/basic_*
|
|
@@ -278,6 +317,10 @@ fi
|
|
%{_sysconfdir}/%{base_name}/%{base_name}.conf.documented
|
|
%{_sysconfdir}/%{base_name}/%{base_name}.conf.documented
|
|
|
|
|
|
%changelog
|
|
%changelog
|
|
|
|
+* Thu Apr 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.11-1
|
|
|
|
+- new upstream release.
|
|
|
|
+- added systemd support (disabled as default).
|
|
|
|
+
|
|
* Mon Feb 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.10-1
|
|
* Mon Feb 10 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.10-1
|
|
- new upstream release.
|
|
- new upstream release.
|
|
|
|
|