SHA256
1
0
forked from pool/guix

Accepting request 1145855 from home:jaimeMF:branches:devel:languages:misc

- Create the users and group with systemd-sysusers. It automatically gives the
  Provides tag required for RPM 4.19.

OBS-URL: https://build.opensuse.org/request/show/1145855
OBS-URL: https://build.opensuse.org/package/show/devel:languages:misc/guix?expand=0&rev=52
This commit is contained in:
Jonathan Brielmaier 2024-02-14 20:47:18 +00:00 committed by Git OBS Bridge
parent 94f50a0976
commit d0904bf698
3 changed files with 21 additions and 8 deletions

7
guix-user.conf Normal file
View File

@ -0,0 +1,7 @@
#Type Name ID GECOS Home directory Shell
g guixbuild -
u guix-builder1 -:guixbuild "Guix builder 1" /var/empty /sbin/nologin
u guix-builder2 -:guixbuild "Guix builder 2" /var/empty /sbin/nologin
u guix-builder3 -:guixbuild "Guix builder 3" /var/empty /sbin/nologin
u guix-builder4 -:guixbuild "Guix builder 4" /var/empty /sbin/nologin
u guix-builder5 -:guixbuild "Guix builder 5" /var/empty /sbin/nologin

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Feb 10 21:12:36 UTC 2024 - Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
- Create the users and group with systemd-sysusers. It automatically gives the
Provides tag required for RPM 4.19.
-------------------------------------------------------------------
Mon Jan 2 13:51:22 UTC 2023 - Jonathan Brielmaier <jbrielmaier@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package guix
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2023 Jonathan Brielmaier <j.brielmaier@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@ -45,6 +45,7 @@ Source12: aarch64-linux-guile-2.0.14.tar.xz
Source13: aarch64-linux-guile-2.0.14.tar.xz.sig
Source20: run_guix_daemon.sh
Source21: run_guix_publish.sh
Source22: %{name}-user.conf
BuildRequires: gcc-c++
BuildRequires: gnutls-guile
BuildRequires: guile-charting
@ -62,10 +63,12 @@ BuildRequires: libgit2-devel
BuildRequires: pkgconfig
BuildRequires: shepherd
BuildRequires: systemd-rpm-macros
BuildRequires: sysuser-tools
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(libgcrypt)
BuildRequires: pkgconfig(sqlite3)
%sysusers_requires
Requires: gnutls-guile
Requires: guile
Requires: guile-gcrypt
@ -100,6 +103,7 @@ cp %{SOURCE6} gnu/packages/bootstrap/armhf-linux/guile-2.0.11.tar.xz
cp %{SOURCE12} gnu/packages/bootstrap/aarch64-linux/guile-2.0.14.tar.xz
%build
%sysusers_generate_pre %{SOURCE22} %{name} %{name}-user.conf
export GUILE_WARN_DEPRECATED
%configure \
--disable-silent-rules \
@ -121,14 +125,9 @@ install -m 0755 -t %{buildroot}%{_bindir} %{SOURCE20}
install -m 0755 -t %{buildroot}%{_bindir} %{SOURCE21}
sed -i 's@^ExecStart=.*@ExecStart=/usr/bin/run_guix_daemon.sh@' %{buildroot}%{_unitdir}/guix-daemon.service
sed -i 's@^ExecStart=.*@ExecStart=/usr/bin/run_guix_publish.sh@' %{buildroot}%{_unitdir}/guix-publish.service
install -D -m 0644 %{SOURCE22} %{buildroot}%{_sysusersdir}/%{name}-user.conf
%pre
%{_sbindir}/groupadd -r %{guix_builder_group} >/dev/null 2>/dev/null || :
for i in `seq 1 5`; do
%{_sbindir}/useradd -r -o -g %{guix_builder_group} -G %{guix_builder_group} \
-u $((60+$i)) -c "Guix builder $i" -s /sbin/nologin \
-d %{_localstatedir}/empty guix-builder$i 2> /dev/null || :
done
%pre -f %{name}.pre
%service_add_pre guix-daemon.service
%service_add_pre guix-publish.service
@ -175,5 +174,6 @@ done
%{_unitdir}/gnu-store.mount
%attr(755,root,root) %dir /gnu
%attr(775,root,%{guix_builder_group}) %dir /gnu/store
%{_sysusersdir}/%{name}-user.conf
%changelog