commit a3d2c43fbac6be0848e9388ccc96a27076a7b0ed
parent dc1a17d7d13315754d19b3feae7020441e3ab4cc
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date: Fri, 9 Sep 2022 21:51:07 +0200
update with systemd scripts
Diffstat:
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/rpmbuild/SPECS/gnunet.spec b/rpmbuild/SPECS/gnunet.spec
@@ -4,7 +4,7 @@
Name: gnunet
Version: 0.17.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Framework for secure peer-to-peer networking
License: AGPLv3
Group: Productivity/Networking/File-Sharing
@@ -44,6 +44,7 @@ BuildRequires: libsodium-devel
BuildRequires: sqlite-devel
BuildRequires: gnupg2
BuildRequires: libjose-devel
+BuildRequires: systemd-rpm-macros
Requires: libextractor
Requires: openssl
Requires: nss-util
@@ -190,16 +191,22 @@ getent group %{name}dns >/dev/null || /usr/sbin/groupadd -r %{name}dns
getent passwd %{name} >/dev/null || useradd -r -g %{name} -G %{name}dns -m -d %{gnunethome} %{gnunetuser} -c "GNUnet system account"
exit 0
+# The sed replacements can be removed for 0.17.6
%install
make install DESTDIR=%{buildroot}
+sed -i 's/\/usr\/lib/\/usr\/lib64/' "contrib/services/systemd/%{name}.service"
+sed -i 's/SYSTEM_ONLY/START_SYSTEM_SERVICE/' "contrib/conf/gnunet/gnunet-system.conf"
+sed -i 's/USER_ONLY/START_USER_SERVICE/' "contrib/conf/gnunet/gnunet-system.conf"
+install -Dm644 "contrib/services/systemd/%{name}.service" "%{buildroot}/%{_unitdir}/%{name}.service"
+sed -i 's/\/usr\/lib/\/usr\/lib64/' "contrib/services/systemd/%{name}-user.service"
+install -Dm644 "contrib/services/systemd/%{name}-user.service" "%{buildroot}/%{_userunitdir}/%{name}-user.service"
+install -Dm644 "contrib/conf/gnunet/gnunet-system.conf" %{buildroot}/%{_sysconfdir}/gnunet.conf
%check
#make check
%post
-mkdir -p /%{_sysconfdir}/%{name}
-touch /%{_sysconfdir}/%{name}/gnunet.conf
-mkdir -p ~/.config
+mkdir -p ~/.config/gnunet
touch ~/.config/gnunet.conf
%postun
@@ -601,6 +608,9 @@ touch ~/.config/gnunet.conf
%{_libdir}/libnss_gns4.so.2
%{_libdir}/libnss_gns6.so.2
%{_libdir}/pkgconfig/gnunetscalarproduct.pc
+%{_unitdir}/%{name}.service
+%{_userunitdir}/%{name}-user.service
+%{_sysconfdir}/gnunet.conf
%files devel
%{_libdir}/libgnunetblockgroup.so
@@ -915,6 +925,8 @@ touch ~/.config/gnunet.conf
%{_mandir}/man1/gnunet-ecc.1.gz
%changelog
+* Fri Sep 09 2022 Martin Schanzenbach <schanzen@gnunet.org> - 0.17.5
+- Add systemd scripts
* Sun Sep 04 2022 Martin Schanzenbach <schanzen@gnunet.org> - 0.17.5
- Version bump
* Fri Aug 12 2022 Martin Schanzenbach <schanzen@gnunet.org> - 0.17.4