From 40f1f4f6a3ac1ca06d6b0b23754bb7e67b8ffa877150302a9da99daf4d4f7865 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 17 Jan 2023 15:45:53 +0000 Subject: [PATCH 1/3] - Add groweb user for grommunio-web, grommunio-index OBS-URL: https://build.opensuse.org/package/show/server:mail/system-user-grommunio?expand=0&rev=3 --- debian.changelog | 5 ++++ debian.compat | 1 + debian.control | 16 ++++++++++++ debian.rules | 3 +++ debian.system-user-grommunio.install | 0 debian.system-user-grommunio.postinst | 7 ++++++ dummy.tgz | 3 +++ system-user-grommunio.changes | 5 ++++ system-user-grommunio.dsc | 10 ++++++++ system-user-grommunio.spec | 36 ++++++++++++++++++++++----- 10 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 debian.changelog create mode 100644 debian.compat create mode 100644 debian.control create mode 100644 debian.rules create mode 100644 debian.system-user-grommunio.install create mode 100644 debian.system-user-grommunio.postinst create mode 100644 dummy.tgz create mode 100644 system-user-grommunio.dsc diff --git a/debian.changelog b/debian.changelog new file mode 100644 index 0000000..22eb896 --- /dev/null +++ b/debian.changelog @@ -0,0 +1,5 @@ +system-user-grommunio (0-0) unstable; urgency=low + + * Initial package. + + -- Grommunio Mon, 25 Jan 2021 10:00:00 +0100 diff --git a/debian.compat b/debian.compat new file mode 100644 index 0000000..e243817 --- /dev/null +++ b/debian.compat @@ -0,0 +1 @@ +12 diff --git a/debian.control b/debian.control new file mode 100644 index 0000000..9d47c72 --- /dev/null +++ b/debian.control @@ -0,0 +1,16 @@ +Source: system-user-grommunio +Priority: optional +Section: mail +Maintainer: Grommunio +Standards-Version: 4.5.0 + +Package: system-user-grommunio +Architecture: all +Pre-Depends: ${misc:Pre-Depends} +Depends: adduser, ${misc:Depends} +Provides: system-user-groweb +Replaces: system-user-groweb +Conflicts: system-user-groweb +Description: System user and group grommunio + . + This package provides the grommunio account. diff --git a/debian.rules b/debian.rules new file mode 100644 index 0000000..953462f --- /dev/null +++ b/debian.rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +%: + dh $@ --parallel diff --git a/debian.system-user-grommunio.install b/debian.system-user-grommunio.install new file mode 100644 index 0000000..473a0f4 diff --git a/debian.system-user-grommunio.postinst b/debian.system-user-grommunio.postinst new file mode 100644 index 0000000..d4f80f1 --- /dev/null +++ b/debian.system-user-grommunio.postinst @@ -0,0 +1,7 @@ +#!/bin/sh +getent group grommunio >/dev/null || addgroup --system grommunio +getent passwd grommunio >/dev/null || \ + adduser --system grommunio --home / --no-create-home --disabled-password --ingroup grommunio +getent group groweb >/dev/null || addgroup --system groweb +getent passwd groweb >/dev/null || \ + adduser --system groweb --home / --no-create-home --disabled-password --ingroup groweb diff --git a/dummy.tgz b/dummy.tgz new file mode 100644 index 0000000..22632ba --- /dev/null +++ b/dummy.tgz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd211e6cbb3d0d7d6fe7c8c8389bb5d269df09692848663626636930e4246892 +size 231 diff --git a/system-user-grommunio.changes b/system-user-grommunio.changes index cef7593..58a53ad 100644 --- a/system-user-grommunio.changes +++ b/system-user-grommunio.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 17 15:45:41 UTC 2023 - Jan Engelhardt + +- Add groweb user for grommunio-web, grommunio-index + ------------------------------------------------------------------- Mon Jul 25 16:47:37 UTC 2022 - Jan Engelhardt diff --git a/system-user-grommunio.dsc b/system-user-grommunio.dsc new file mode 100644 index 0000000..f352e45 --- /dev/null +++ b/system-user-grommunio.dsc @@ -0,0 +1,10 @@ +Format: 1.0 +Source: system-user-grommunio +Architecture: all +Version: 3 +Maintainer: Grommunio +Homepage: https://grommunio.com +Standards-Version: 3.9.4 +# You need to update both .dsc and debian.control (*sigh* - Debian) +Build-Depends: + debhelper diff --git a/system-user-grommunio.spec b/system-user-grommunio.spec index eab756e..4ad5be0 100644 --- a/system-user-grommunio.spec +++ b/system-user-grommunio.spec @@ -1,7 +1,7 @@ # # spec file for package system-user-grommunio # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,30 +17,54 @@ Name: system-user-grommunio -Version: 2 +Version: 3 Release: 0 -Summary: System user and group grommunio +Summary: System users and groups for grommunio License: MIT Group: System/Fhs URL: https://grommunio.com/ BuildArch: noarch BuildRequires: systemd-rpm-macros +Obsoletes: system-user-groweb < %version-%release +Provides: system-user-groweb = %version-%release +%if 0%{?suse_version} BuildRequires: sysuser-tools %sysusers_requires +%else +Provides: group(grommunio) +Provides: group(groweb) +Provides: user(grommunio) +Provides: user(groweb) +Requires(pre): /usr/sbin/useradd +Requires(pre): /usr/sbin/groupadd +%endif %description -This package provides the grommunio account. +This package provides the system accounts for grommunio. %prep %build -echo 'u grommunio - "Grommunio administration"' >u.conf -%sysusers_generate_pre u.conf user +echo 'u grommunio - "user for grommunio administration"' >u.conf +echo 'u groweb - "user for grommunio-web"' >>u.conf +%if 0%{?suse_version} +%sysusers_generate_pre u.conf user system-user-grommunio.conf +%else +>user.pre +%endif %install install -Dpm0644 u.conf "%buildroot/%_sysusersdir/system-user-grommunio.conf" %pre -f user.pre +%if 0%{?suse_version} +getent group grommunio >/dev/null || %_sbindir/groupadd -r grommunio +getent passwd grommunio >/dev/null || %_sbindir/useradd -g grommunio -s /sbin/nologin \ + -r -c "user for grommunio administration" -d / grommunio +getent group groweb >/dev/null || %_sbindir/groupadd -r groweb +getent passwd groweb >/dev/null || %_sbindir/useradd -g groweb -s /sbin/nologin \ + -r -c "user for grommunio-web" -d / groweb +%endif %files %_sysusersdir/*.conf From 360c238c3b659864b8f2a3ed74c459513ee5bd12841b188c3d653aac829b322f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 17 Jan 2023 18:59:31 +0000 Subject: [PATCH 2/3] mention that tgz OBS-URL: https://build.opensuse.org/package/show/server:mail/system-user-grommunio?expand=0&rev=4 --- dummy.tgz => dummy_for_debtransform.tgz | 0 system-user-grommunio.spec | 1 + 2 files changed, 1 insertion(+) rename dummy.tgz => dummy_for_debtransform.tgz (100%) diff --git a/dummy.tgz b/dummy_for_debtransform.tgz similarity index 100% rename from dummy.tgz rename to dummy_for_debtransform.tgz diff --git a/system-user-grommunio.spec b/system-user-grommunio.spec index 4ad5be0..c425967 100644 --- a/system-user-grommunio.spec +++ b/system-user-grommunio.spec @@ -23,6 +23,7 @@ Summary: System users and groups for grommunio License: MIT Group: System/Fhs URL: https://grommunio.com/ +Source: dummy_for_debtransform.tgz BuildArch: noarch BuildRequires: systemd-rpm-macros Obsoletes: system-user-groweb < %version-%release From 409cc57d9514c68637600159c441116eb47690bdabe02900b1cf290b10f5b271 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 18 Jan 2023 08:39:24 +0000 Subject: [PATCH 3/3] getent for the non-SUSE case OBS-URL: https://build.opensuse.org/package/show/server:mail/system-user-grommunio?expand=0&rev=5 --- system-user-grommunio.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-user-grommunio.spec b/system-user-grommunio.spec index c425967..d3bea08 100644 --- a/system-user-grommunio.spec +++ b/system-user-grommunio.spec @@ -58,7 +58,7 @@ echo 'u groweb - "user for grommunio-web"' >>u.conf install -Dpm0644 u.conf "%buildroot/%_sysusersdir/system-user-grommunio.conf" %pre -f user.pre -%if 0%{?suse_version} +%if !0%{?suse_version} getent group grommunio >/dev/null || %_sbindir/groupadd -r grommunio getent passwd grommunio >/dev/null || %_sbindir/useradd -g grommunio -s /sbin/nologin \ -r -c "user for grommunio administration" -d / grommunio