package/proftpd: add mod_cap option
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 7 Mar 2020 23:27:35 +0000 (00:27 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 8 Mar 2020 13:54:04 +0000 (14:54 +0100)
Add an option to enable or disable mod_cap and select libcap accordingly
instead of using bundled libcap which raise a build failure with headers
< 4.3 due to PR_CAP_AMBIENT and will be removed in version 1.3.7:
https://github.com/proftpd/proftpd/commit/8c845703fcf2c7978614784126bd074ffc4477f9

Fixes:
 - http://autobuild.buildroot.org/results/4d680d8204bdf1f3deec2c3eeb9a2d9e6eabe4d5

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/proftpd/Config.in
package/proftpd/proftpd.mk

index edec37c8dd92cee5b6d034943ceee5639469fdba..4a544f0c509650402a2d194fc6b3226ef8feb7d1 100644 (file)
@@ -8,6 +8,12 @@ config BR2_PACKAGE_PROFTPD
 
 if BR2_PACKAGE_PROFTPD
 
+config BR2_PACKAGE_PROFTPD_MOD_CAP
+       bool "mod_cap support"
+       select BR2_PACKAGE_LIBCAP
+       help
+         Compile ProFTPD with mod_cap support
+
 config BR2_PACKAGE_PROFTPD_MOD_REWRITE
        bool "mod_rewrite support"
        help
index 02dd0e825efbda48ec78e777ea01b12c3a38777c..946a37d69e20469ddc168237c55dd917cce08d85 100644 (file)
@@ -25,6 +25,13 @@ PROFTPD_CONF_OPTS = \
        --with-gnu-ld \
        --without-openssl-cmdline
 
+ifeq ($(BR2_PACKAGE_PROFTPD_MOD_CAP),y)
+PROFTPD_CONF_OPTS += --enable-cap
+PROFTPD_DEPENDENCIES += libcap
+else
+PROFTPD_CONF_OPTS += --disable-cap
+endif
+
 ifeq ($(BR2_PACKAGE_PROFTPD_MOD_REWRITE),y)
 PROFTPD_MODULES += mod_rewrite
 endif
@@ -85,12 +92,6 @@ define PROFTPD_USE_LLU
 endef
 PROFTPD_PRE_CONFIGURE_HOOKS += PROFTPD_USE_LLU
 
-define PROFTPD_MAKENAMES
-       $(MAKE1) CC="$(HOSTCC)" CFLAGS="" LDFLAGS="" -C $(@D)/lib/libcap _makenames
-endef
-
-PROFTPD_POST_CONFIGURE_HOOKS = PROFTPD_MAKENAMES
-
 PROFTPD_MAKE = $(MAKE1)
 
 # install Perl based scripts in target