diff mbox series

[bug#51739,1/3] gnu: Add realmd.

Message ID ioyrzAc-JgqevdUX06bX9ZEgFZXfRoXCZQPDVnzEcz51TbVIz7cKJlEcDiD4C9tdsJc72kfHlKEN5mcxlym701nPPUGwtld5p7mdCRrZ1g4=@protonmail.com
State Accepted
Headers show
Series [bug#51739,1/3] gnu: Add realmd. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

phodina Nov. 10, 2021, 3:04 a.m. UTC
* gnu/packages/admin.scm (realmd): New variable.
* gnu/packages/patches/realmd-remove-distro-detection.patch: New file.
* gnu/local.mk: Add patch.

--
2.33.1

Comments

Leo Famulari Nov. 10, 2021, 10:33 p.m. UTC | #1
On Wed, Nov 10, 2021 at 03:04:19AM +0000, phodina via Guix-patches via wrote:
> * gnu/packages/admin.scm (realmd): New variable.
> * gnu/packages/patches/realmd-remove-distro-detection.patch: New file.
> * gnu/local.mk: Add patch.

Thanks!

> +    (license license:lgpl2.1)))

I think it is lgpl2.1+, based on the license headers.

> diff --git a/gnu/packages/patches/realmd-remove-distro-detection.patch b/gnu/packages/patches/realmd-remove-distro-detection.patch
> new file mode 100644
> index 0000000000..ad39e25fe1
> --- /dev/null
> +++ b/gnu/packages/patches/realmd-remove-distro-detection.patch
> @@ -0,0 +1,77 @@
> +From 6e69d6784caa1fdeba1ba4b7ed3dc58fcd631275 Mon Sep 17 00:00:00 2001
> +From: Petr Hodina <phodina@protonmail.com>
> +Date: Sat, 2 Oct 2021 20:08:52 +0200
> +Subject: [PATCH] Remove distro detection

Can you add a comment to the patch explaining its purpose?

> +-	AC_MSG_ERROR([Couldn't detect the distro to configure for. Specify one with --with-distro])

Do we need to pass "--with-distro=guix" or something?
Ludovic Courtès Dec. 1, 2021, 4:42 p.m. UTC | #2
Hi,

phodina <phodina@protonmail.com> skribis:

> * gnu/packages/admin.scm (realmd): New variable.
> * gnu/packages/patches/realmd-remove-distro-detection.patch: New file.
> * gnu/local.mk: Add patch.

[...]

> +    (synopsis
> +     "DBus service for configuring kerberos and other online identities")
> +    (description
> +     "Dbus system service that manages discovery and enrollment in
> +realms/domains like Active Directory or IPA.")

Could you improve on it as per
<https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html>?

> +    (home-page "https://www.freedesktop.org/software/realmd/")
> +    (license license:lgpl2.1)))

Isn’t it ‘lgpl2.1+’?  This is the case unless the authors explicitly
omitted the “or any later version” wording.

> +-AC_ARG_WITH([distro],
> +-            [AS_HELP_STRING([--with-distro],
> +-                            [Configure for a specific distribution (eg: redhat)]
> +-                           )],
> +-            [DISTRO=$withval],
> +-            [DISTRO=])
> +-
> +-if test -z $DISTRO; then
> +-	AC_CHECK_FILE(/etc/redhat-release, [DISTRO="redhat"])
> +-	AC_CHECK_FILE(/etc/debian_version, [DISTRO="debian"])
> +-	AC_CHECK_FILE(/etc/SuSE-release, [DISTRO="suse"])
> +-
> +-	# Not customized for these yet
> +-	dnl AC_CHECK_FILE(/etc/gentoo-release, [DISTRO="gentoo"])
> +-	dnl AC_CHECK_FILE(/etc/slackware-version, [DISTRO="slackware"])
> +-
> +-fi
> +-
> +-if test -z $DISTRO; then
> +-	AC_MSG_ERROR([Couldn't detect the distro to configure for. Specify one with --with-distro])
> +-fi

Rather than adding this patch, I think you can do:

  #:configure-flags '("--with-distro=GNU Guix")

Could you send an updated patch?

Thanks,
Ludo’.
Ludovic Courtès Dec. 1, 2021, 4:43 p.m. UTC | #3
Oops I had overlooked this review.  At least we made the same
suggestions.  :-)

Ludo’.
phodina Dec. 2, 2021, 7:08 p.m. UTC | #4
Hi Ludo',

here's the updated patch.

You're assumption about --with-distro was right. The patch can be omitted by simple substitution and config argument.

The license is indeed lgpl2.1+.
phodina Dec. 2, 2021, 9:50 p.m. UTC | #5
Hi Leo,

thanks for the comments.

>> +         (add-before 'install 'fix-service> +           >(lambda* (#:key outputs #:allow-other-keys)> +             ;; >Don't copy config file> +             (substitute* "Makefile"> +               >((".*/service/realmd-.*") "")))))))
>Can you clarify what this does? It wasn't in earlier revisions >of thepatch.

So the whole reason why there was the patch attached is that realmd is querying the distro to use later specific config for the service. As suggested this can be overcome by using --with-distro.

However, it still tries to install the configuration file located in the sources under service/realmd-*.

There are files for debian, redhat and suse. Plus there is one labeled as default.

Since it also needs other packages such as samba, winbind, sssd, adcli and kfb5 the idea was to leave the configuration file up to a realmd service. Though that one is not yet implemented.

I'll probably refactor the comment as it's not that descriptive.

Petr
Leo Famulari Dec. 2, 2021, 10:24 p.m. UTC | #6
On Thu, Dec 02, 2021 at 09:50:02PM +0000, phodina via Guix-patches via wrote:
> I'll probably refactor the comment as it's not that descriptive.

Thanks, with that change the patch will be ready to push.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 05258ac054..611fe40c28 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1736,6 +1736,7 @@  dist_patch_DATA =					\
   %D%/packages/patches/rtags-separate-rct.patch			\
   %D%/packages/patches/racket-minimal-backport-1629887.patch    \
   %D%/packages/patches/racket-minimal-sh-via-rktio.patch	\
+  %D%/packages/patches/realmd-remove-distro-detection.patch \
   %D%/packages/patches/remake-impure-dirs.patch			\
   %D%/packages/patches/restic-0.9.6-fix-tests-for-go1.15.patch	\
   %D%/packages/patches/retroarch-LIBRETRO_DIRECTORY.patch	\
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index d24b068bd7..ef29fd5c98 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -128,6 +128,7 @@  (define-module (gnu packages admin)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages polkit)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
@@ -1533,6 +1534,45 @@  (define-public clusterssh
 over ssh connections.")
     (license license:gpl2+)))

+(define-public realmd
+  (package
+    (name "realmd")
+    (version "0.17.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/freedesktop/realmd")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1c6q2a86kk2f1akzc36nh52hfwsmmc0mbp6ayyjxj4zsyk9zx5bf"))
+              (patches (search-patches "realmd-remove-distro-detection.patch"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("glib-bin" ,glib "bin")
+       ("intltool" ,intltool)
+       ("pkg-config" ,pkg-config)
+       ("python" ,python)))
+    (inputs
+     `(("glib" ,glib)
+       ("mit-krb5" ,mit-krb5)
+       ("openldap" ,openldap)
+       ("polkit" ,polkit)))
+    (arguments
+     `(#:configure-flags '("--with-systemd-unit-dir=no"
+                           "--with-systemd-journal=no"
+                           "--disable-doc")))
+    (synopsis
+     "DBus service for configuring kerberos and other online identities")
+    (description
+     "Dbus system service that manages discovery and enrollment in
+realms/domains like Active Directory or IPA.")
+    (home-page "https://www.freedesktop.org/software/realmd/")
+    (license license:lgpl2.1)))
+
 (define-public rename
   (package
     (name "rename")
diff --git a/gnu/packages/patches/realmd-remove-distro-detection.patch b/gnu/packages/patches/realmd-remove-distro-detection.patch
new file mode 100644
index 0000000000..ad39e25fe1
--- /dev/null
+++ b/gnu/packages/patches/realmd-remove-distro-detection.patch
@@ -0,0 +1,77 @@ 
+From 6e69d6784caa1fdeba1ba4b7ed3dc58fcd631275 Mon Sep 17 00:00:00 2001
+From: Petr Hodina <phodina@protonmail.com>
+Date: Sat, 2 Oct 2021 20:08:52 +0200
+Subject: [PATCH] Remove distro detection
+
+
+diff --git a/configure.ac b/configure.ac
+index ee067d9..12a1214 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -24,33 +24,6 @@ AC_CONFIG_SRCDIR([service/realm-daemon.c])
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+ AM_MAINTAINER_MODE([enable])
+
+-# -----------------------------------------------------------------------------
+-# Distro Detection
+-
+-AC_ARG_WITH([distro],
+-            [AS_HELP_STRING([--with-distro],
+-                            [Configure for a specific distribution (eg: redhat)]
+-                           )],
+-            [DISTRO=$withval],
+-            [DISTRO=])
+-
+-if test -z $DISTRO; then
+-	AC_CHECK_FILE(/etc/redhat-release, [DISTRO="redhat"])
+-	AC_CHECK_FILE(/etc/debian_version, [DISTRO="debian"])
+-	AC_CHECK_FILE(/etc/SuSE-release, [DISTRO="suse"])
+-
+-	# Not customized for these yet
+-	dnl AC_CHECK_FILE(/etc/gentoo-release, [DISTRO="gentoo"])
+-	dnl AC_CHECK_FILE(/etc/slackware-version, [DISTRO="slackware"])
+-
+-fi
+-
+-if test -z $DISTRO; then
+-	AC_MSG_ERROR([Couldn't detect the distro to configure for. Specify one with --with-distro])
+-fi
+-
+-AC_SUBST(DISTRO)
+-
+ # -----------------------------------------------------------------------------
+ # Basic tools
+
+diff --git a/doc/internals/Makefile.am b/doc/internals/Makefile.am
+index 2acbfd8..4eba507 100644
+--- a/doc/internals/Makefile.am
++++ b/doc/internals/Makefile.am
+@@ -28,10 +28,8 @@ CLEANFILES += \
+
+ internals/realmd-internals.html: $(INTERNAL_DOCBOOK) $(INTERNAL_INCLUDES) $(INTERNAL_STATIC)
+ 	$(AM_V_GEN) mkdir -p internals && cp $(srcdir)/doc/internals/static/* internals/ && \
+-	$(XMLTO) html-nochunks -m $(srcdir)/$(INTERNAL_PARAMS) -o internals \
+-		--searchpath $(abs_builddir):$(abs_srcdir) $(srcdir)/$(INTERNAL_DOCBOOK)
++	#$(XMLTO) html-nochunks -m $(srcdir)/$(INTERNAL_PARAMS) -o internals \
++	#	--searchpath $(abs_builddir):$(abs_srcdir) $(srcdir)/$(INTERNAL_DOCBOOK)
+
+ render-images:
+-	for i in $(SVG_IMAGES:.svg=); do \
+-		inkscape --export-png=static/$$i.png $$i.svg; \
+-	done
++	true
+diff --git a/service/Makefile.am b/service/Makefile.am
+index c17bf3b..0988bf6 100644
+--- a/service/Makefile.am
++++ b/service/Makefile.am
+@@ -137,7 +137,6 @@ install-service:
+ 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(privatedir)
+ 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(localstatedir)/lib/realmd
+ 	$(INSTALL_PROGRAM) -d $(DESTDIR)$(cachedir)
+-	$(INSTALL_DATA) $(srcdir)/service/realmd-$(DISTRO).conf $(DESTDIR)$(privatedir)/realmd-distro.conf
+ uninstall-service:
+ 	rm -f $(DESTDIR)$(privatedir)/realmd-distro.conf
+
+--
+2.32.0
+