diff --git a/DEVELOPERS b/DEVELOPERS index 18197347a1..9e9c8a5a0f 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1205,6 +1205,7 @@ F: package/lua* F: package/lynis/ F: package/lzlib/ F: package/moarvm/ +F: package/opendoas/ F: package/perl* F: package/pkg-perl.mk F: package/pkg-luarocks.mk diff --git a/package/Config.in b/package/Config.in index f12112c1d6..fedff0e22d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2747,6 +2747,7 @@ comment "Utilities" source "package/lowdown/Config.in" source "package/minisign/Config.in" source "package/neofetch/Config.in" + source "package/opendoas/Config.in" source "package/pdmenu/Config.in" source "package/pinentry/Config.in" source "package/qprint/Config.in" diff --git a/package/opendoas/Config.in b/package/opendoas/Config.in new file mode 100644 index 0000000000..f359ed576f --- /dev/null +++ b/package/opendoas/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_OPENDOAS + bool "opendoas" + depends on BR2_USE_MMU # fork() + select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC + help + OpenDoas: a portable version of OpenBSD's doas command. + doas is a minimal replacement for the venerable sudo. + + https://github.com/Duncaen/OpenDoas diff --git a/package/opendoas/opendoas.hash b/package/opendoas/opendoas.hash new file mode 100644 index 0000000000..ada1835f59 --- /dev/null +++ b/package/opendoas/opendoas.hash @@ -0,0 +1,3 @@ +# Locally computed +sha256 6da058a0e70b7543bc60624389b0b00b686189ec933828c522bf8b2600495a67 opendoas-6.8.2.tar.gz +sha256 293e7f2bc3a06396b200956cd660cd101bdb3c109f31c9ab6f2547f2105b38af LICENSE diff --git a/package/opendoas/opendoas.mk b/package/opendoas/opendoas.mk new file mode 100644 index 0000000000..06626508f4 --- /dev/null +++ b/package/opendoas/opendoas.mk @@ -0,0 +1,60 @@ +################################################################################ +# +# opendoas +# +################################################################################ + +OPENDOAS_VERSION = 6.8.2 +OPENDOAS_SITE = $(call github,Duncaen,OpenDoas,v$(OPENDOAS_VERSION)) +OPENDOAS_LICENSE = ISC +OPENDOAS_LICENSE_FILES = LICENSE + +OPENDOAS_DEPENDENCIES = host-bison + +# Those options looks like autotools ones, but this package has a +# handwritten "configure" script that mimic a subset of autotools. +# This is why this package uses the generic-package infra. See: +# https://github.com/Duncaen/OpenDoas/blob/v6.8.2/configure +OPENDOAS_CONF_OPTS = \ + --target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-shadow + +ifeq ($(BR2_PACKAGE_LIBXCRYPT),y) +OPENDOAS_DEPENDENCIES += libxcrypt +endif + +ifeq ($(BR2_PACKAGE_LINUX_PAM),y) +define OPENDOAS_INSTALL_PAM_CONF + $(INSTALL) -D -m 0644 $(@D)/pam.d__doas__linux $(TARGET_DIR)/etc/pam.d/doas +endef + +OPENDOAS_DEPENDENCIES += linux-pam +OPENDOAS_CONF_OPTS += --with-pam +else +OPENDOAS_CONF_OPTS += --without-pam +endif + +define OPENDOAS_CONFIGURE_CMDS + (cd $(@D) && \ + $(TARGET_CONFIGURE_OPTS) ./configure $(OPENDOAS_CONF_OPTS)) +endef + +define OPENDOAS_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ + CC="$(TARGET_CC)" \ + YACC="$(HOST_DIR)/bin/bison -y" +endef + +define OPENDOAS_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/doas $(TARGET_DIR)/usr/bin/doas + $(OPENDOAS_INSTALL_PAM_CONF) +endef + +# NOTE: Even though this package has a "configure" script, it is not +# generated using autotools, so we have to use the generic package +# infrastructure. +$(eval $(generic-package))