From d62b2ad53a9f19609d2a918fa2be7916f4355196 Mon Sep 17 00:00:00 2001 From: Alexandre Detiste Date: Jan 05 2023 22:57:33 +0000 Subject: cleaner packaging using systemd macros --- diff --git a/apt-cacher-ng.conf b/apt-cacher-ng.conf new file mode 100644 index 0000000..ccf413f --- /dev/null +++ b/apt-cacher-ng.conf @@ -0,0 +1 @@ +u apt-cacher-ng - "Apt-cacher proxy" /var/lib/apt-cacher-ng diff --git a/apt-cacher-ng.spec b/apt-cacher-ng.spec index c78f8b8..0747493 100644 --- a/apt-cacher-ng.spec +++ b/apt-cacher-ng.spec @@ -10,6 +10,7 @@ License: BSD-4-Clause URL: http://www.unix-ag.uni-kl.de/~bloch/acng/ Source0: http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/%{name}_%{version}.orig.tar.xz Source1: http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/%{name}_%{version}-%{debian_release}.debian.tar.xz +Source2: apt-cacher-ng.conf Patch0: supacng.patch Provides: bundled(sha1-hollerbach) @@ -82,12 +83,8 @@ sed -i '/^Remap-uburep/s/;/# ;/' %{buildroot}%{_sysconfdir}/apt-cacher-ng/acng.c sed -i '/^Remap-kxlrep/s/;/# ;/' %{buildroot}%{_sysconfdir}/apt-cacher-ng/acng.conf %pre -# the "tmpfiles_create_package" macro should be able to do all of this -getent group apt-cacher-ng > /dev/null || groupadd -r apt-cacher-ng -getent passwd apt-cacher-ng > /dev/null || useradd -r -d %{_sharedstatedir}/apt-cacher-ng -g apt-cacher-ng -s /sbin/nologin -c "Apt-cacher proxy" apt-cacher-ng -mkdir -p /run/apt-cacher-ng -chown apt-cacher-ng:apt-cacher-ng /run/apt-cacher-ng -chmod 755 /run/apt-cacher-ng +%sysusers_create %{name} +%tmpfiles_create %{name} %post %systemd_post apt-cacher-ng.service @@ -100,11 +97,10 @@ chmod 755 /run/apt-cacher-ng %files %license COPYING -%doc TODO %{_docdir}/%{name}/ -%attr(755,apt-cacher-ng,apt-cacher-ng) %dir %{_var}/lib/apt-cacher-ng/ -%attr(700,apt-cacher-ng,apt-cacher-ng) %dir %{_var}/log/apt-cacher-ng/ -%attr(700,apt-cacher-ng,apt-cacher-ng) %dir %{_var}/cache/apt-cacher-ng/ +%dir %{_var}/lib/apt-cacher-ng/ +%attr(755,apt-cacher-ng,apt-cacher-ng) %dir %{_var}/log/apt-cacher-ng/ +%attr(755,apt-cacher-ng,apt-cacher-ng) %dir %{_var}/cache/apt-cacher-ng/ %exclude %{_sysconfdir}/avahi/services/%{name}.service %config(noreplace) %{_sysconfdir}/apt-cacher-ng/