From a479add233682d0a633b8203b9416772dc6ca341dad8ef807f0667021ed49d10 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 3 Feb 2024 14:41:52 +0000 Subject: [PATCH] - Generate "boinc" user with sysusers mechanism OBS-URL: https://build.opensuse.org/package/show/network/boinc-client?expand=0&rev=116 --- boinc-client.changes | 5 +++++ boinc-client.spec | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/boinc-client.changes b/boinc-client.changes index 0651d9e..249c9e2 100644 --- a/boinc-client.changes +++ b/boinc-client.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Feb 3 12:56:03 UTC 2024 - Jan Engelhardt + +- Employ %sysuser macros to generate "boinc" user + ------------------------------------------------------------------- Thu Jan 4 21:22:29 UTC 2024 - Aaron Puchert diff --git a/boinc-client.spec b/boinc-client.spec index a6b8d4e..c8f2875 100644 --- a/boinc-client.spec +++ b/boinc-client.spec @@ -36,7 +36,7 @@ Name: boinc-client %define rel_name %{name}_release %define minor_version 7.24 -Version: %{minor_version}.1 +Version: %minor_version.1 Release: 0 Summary: Client for Berkeley Open Infrastructure for Network Computing License: GPL-3.0-or-later OR LGPL-3.0-or-later @@ -45,7 +45,6 @@ URL: https://boinc.berkeley.edu/ #Git-Clone: https://github.com/BOINC/boinc Source0: https://github.com/BOINC/boinc/archive/client_release/%{minor_version}/%{version}.tar.gz -Source2: boinc-sysusers Source3: README.SUSE Source4: sysconfig.%{name} Source5: boinc-logrotate @@ -71,12 +70,13 @@ BuildRequires: libtool BuildRequires: openssl-devel BuildRequires: pkg-config BuildRequires: sqlite3-devel +BuildRequires: sysuser-tools BuildRequires: xorg-x11-libXmu-devel BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(xcb) BuildRequires: pkgconfig(xcb-util) BuildRequires: pkgconfig(xi) -Requires(pre): shadow +%sysusers_requires Requires: ca-certificates-mozilla Recommends: boinc-client-lang = %{version} Recommends: logrotate @@ -198,6 +198,16 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %install %make_install +mkdir -p "%buildroot/%_sysusersdir" +cat >system-user-boinc.conf <<-EOF + g boinc - + u boinc -:boinc "BOINC Client" /var/lib/boinc + # Several BOINC applications want to use the GPU for computations. + m boinc render +EOF +cp -a system-user-boinc.conf "%buildroot/%_sysusersdir/" +%sysusers_generate_pre system-user-boinc.conf random system-user-boinc.conf + %if %{with manager} for i in clientgui locale; do %else @@ -246,9 +256,6 @@ sed -i \ # Remove {buildroot}/etc/sysconfig/boinc-client, it is added by %%fillup_and_insserv rm -f %{buildroot}%{_sysconfdir}/sysconfig/%{name} -# Install sysusers config -install -Dm0644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf - # Install init and create symlink for rcboinc install -dm0755 %{buildroot}%{_sbindir} install -D -m0644 %{SOURCE20} %{buildroot}%{_unitdir}/%{name}.service @@ -285,7 +292,7 @@ find %{buildroot}/%{_datadir}/locale/ -name "BOINC-Manager.mo" -delete %fdupes -s %{buildroot} -%pre +%pre -f random.pre # fix replacing old sysconfig file (r21) if [ -f %{_sysconfdir}/sysconfig/%{name} ]; then if ! grep -q "BOINC_BOINC_USR" %{_sysconfdir}/sysconfig/boinc-client; then @@ -332,7 +339,7 @@ fi %{_unitdir}/%{name}.service %{_sbindir}/rc%{name} %{_fillupdir}/sysconfig.%{name} -%{_sysusersdir}/%{name}.conf +%_sysusersdir/* %attr(-,boinc,boinc) %{boinc_dir}/ %files -n %{name}-lang -f BOINC-Client.lang