- Generate "atheme" user with sysusers mechanism
OBS-URL: https://build.opensuse.org/package/show/server:irc/atheme?expand=0&rev=87
This commit is contained in:
parent
3326dfbc2f
commit
9fa86c4f4d
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Feb 3 12:31:43 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
|
||||||
|
|
||||||
|
- Generate "atheme" user with sysusers mechanism
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 31 15:23:53 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
|
Mon Jan 31 15:23:53 UTC 2022 - Jan Engelhardt <jengelh@inai.de>
|
||||||
|
|
||||||
|
21
atheme.spec
21
atheme.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package atheme
|
# spec file for package atheme
|
||||||
#
|
#
|
||||||
# Copyright (c) 2022 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -35,13 +35,14 @@ BuildRequires: libopenssl-devel
|
|||||||
BuildRequires: openldap2-devel
|
BuildRequires: openldap2-devel
|
||||||
BuildRequires: pkg-config
|
BuildRequires: pkg-config
|
||||||
BuildRequires: systemd-rpm-macros
|
BuildRequires: systemd-rpm-macros
|
||||||
|
BuildRequires: sysuser-tools
|
||||||
BuildRequires: pkgconfig(libmowgli-2) >= 2.0.0.g185
|
BuildRequires: pkgconfig(libmowgli-2) >= 2.0.0.g185
|
||||||
BuildRequires: pkgconfig(libpcre)
|
BuildRequires: pkgconfig(libpcre)
|
||||||
BuildRequires: pkgconfig(libqrencode)
|
BuildRequires: pkgconfig(libqrencode)
|
||||||
|
%sysusers_requires
|
||||||
%define atheme_home /var/lib/atheme
|
%define atheme_home /var/lib/atheme
|
||||||
%define atheme_log /var/log/atheme
|
%define atheme_log /var/log/atheme
|
||||||
%define atheme_run /run/atheme
|
%define atheme_run /run/atheme
|
||||||
Requires(pre): shadow
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Atheme is a set of modular IRC services (NickServ, ChanServ, etc.)
|
Atheme is a set of modular IRC services (NickServ, ChanServ, etc.)
|
||||||
@ -98,7 +99,7 @@ b="%buildroot"
|
|||||||
mkdir -p "$b/%_docdir/%name"
|
mkdir -p "$b/%_docdir/%name"
|
||||||
install -m 0644 contrib/*.php contrib/*.pl TODO "$b/%_docdir/%name"
|
install -m 0644 contrib/*.php contrib/*.pl TODO "$b/%_docdir/%name"
|
||||||
|
|
||||||
mkdir -p "$b/%_unitdir" "$b/%_prefix/lib/tmpfiles.d"
|
mkdir -p "$b/%_unitdir" "$b/%_prefix/lib/tmpfiles.d" "$b/%_sysusersdir"
|
||||||
ln -s service "$b/%_sbindir/rcatheme"
|
ln -s service "$b/%_sbindir/rcatheme"
|
||||||
cat >"$b/%_unitdir/atheme.service" <<-EOF
|
cat >"$b/%_unitdir/atheme.service" <<-EOF
|
||||||
[Unit]
|
[Unit]
|
||||||
@ -113,6 +114,9 @@ EOF
|
|||||||
cat >"$b/%_prefix/lib/tmpfiles.d/atheme.conf" <<-EOF
|
cat >"$b/%_prefix/lib/tmpfiles.d/atheme.conf" <<-EOF
|
||||||
d /run/atheme 0755 atheme atheme -
|
d /run/atheme 0755 atheme atheme -
|
||||||
EOF
|
EOF
|
||||||
|
echo 'u atheme - "IRC services" %atheme_home' >system-user-atheme.conf
|
||||||
|
cp -a system-user-atheme.conf "$b/%_sysusersdir/"
|
||||||
|
%sysusers_generate_pre system-user-atheme.conf random system-user-atheme.conf
|
||||||
|
|
||||||
mv "$b/%_sysconfdir/%name"/*example "$b/%_docdir/%name/"
|
mv "$b/%_sysconfdir/%name"/*example "$b/%_docdir/%name/"
|
||||||
install -pm0644 "%{S:9}" "$b/%_sysconfdir/%name/atheme.conf"
|
install -pm0644 "%{S:9}" "$b/%_sysconfdir/%name/atheme.conf"
|
||||||
@ -121,13 +125,7 @@ mv "$b/%_sbindir/ecdsakeygen" "$b/%_sbindir/atheme-ecdsakeygen"
|
|||||||
mv "$b/%_sbindir/dbverify" "$b/%_sbindir/atheme-dbverify"
|
mv "$b/%_sbindir/dbverify" "$b/%_sbindir/atheme-dbverify"
|
||||||
%fdupes %buildroot/%_prefix
|
%fdupes %buildroot/%_prefix
|
||||||
|
|
||||||
%pre
|
%pre -f random.pre
|
||||||
/usr/bin/getent group atheme >/dev/null || \
|
|
||||||
/usr/sbin/groupadd -r atheme
|
|
||||||
/usr/bin/getent passwd atheme >/dev/null || \
|
|
||||||
/usr/sbin/useradd -r -g atheme -s /bin/false \
|
|
||||||
-c "Atheme IRC Services daemon" -d "%atheme_home" \
|
|
||||||
atheme
|
|
||||||
%service_add_pre atheme.service
|
%service_add_pre atheme.service
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -157,7 +155,8 @@ systemd-tmpfiles --create atheme.conf || :
|
|||||||
%dir %attr(750,atheme,atheme) %atheme_home
|
%dir %attr(750,atheme,atheme) %atheme_home
|
||||||
%dir %attr(750,atheme,atheme) %atheme_log
|
%dir %attr(750,atheme,atheme) %atheme_log
|
||||||
%_unitdir/*.service
|
%_unitdir/*.service
|
||||||
%_prefix/lib/tmpfiles.d/
|
%_tmpfilesdir/*
|
||||||
|
%_sysusersdir/*
|
||||||
|
|
||||||
%files -n %lname
|
%files -n %lname
|
||||||
%_libdir/libathemecore.so.1*
|
%_libdir/libathemecore.so.1*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user