nut: fix CGI setup
authorSebastian Kemper <sebastian_ml@gmx.net>
Wed, 27 Nov 2019 18:41:40 +0000 (19:41 +0100)
committerRosen Penev <rosenp@gmail.com>
Mon, 20 Jan 2020 05:21:51 +0000 (21:21 -0800)
This commit makes

 - the libgd dependency (as well as specifying libs and includes)
 - the configure argument "--with-cgi"

dependant on whether the package nut-web-cgi is selected.

nut-web-cgi is also added to PKG_CONFIG_DEPENDS.

Resolves: #10641

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
(cherry-picked from cdd660a41dbfb87c9a253a7ebf856d7b733b752f)

net/nut/Makefile

index 56cfd87a30622c84c9b30fb88f025b84a29f45a0..23eded10be36856d42d76b81e7b43bb0ff74cbd1 100644 (file)
@@ -26,7 +26,8 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_NUT_DRIVER_SNMP \
        CONFIG_NUT_DRIVER_USB \
        CONFIG_NUT_DRIVER_SERIAL \
-       CONFIG_NUT_SSL
+       CONFIG_NUT_SSL \
+       CONFIG_PACKAGE_nut-web-cgi
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -302,7 +303,7 @@ endef
 define Package/nut-web-cgi
        $(call Package/nut/Default)
        TITLE+= Web CGI interface
-       DEPENDS:=nut +nut-common +libgd
+       DEPENDS:=nut +nut-common +PACKAGE_nut-web-cgi:libgd
 endef
 
 define Package/nut-web-cgi/description
@@ -531,7 +532,7 @@ CONFIGURE_ARGS += \
        --without-powerman \
        --without-wrap \
        --with-hotplug-dir=/etc/hotplug \
-       --with-cgi \
+       --with$(if $(CONFIG_PACKAGE_nut-web-cgi),,out)-cgi \
        --without-ipmi \
        --without-freeipmi \
        --$(if $(CONFIG_NUT_SSL),with,without)-ssl $(if $(CONFIG_NUT_SSL),--with-openssl) \
@@ -539,7 +540,9 @@ CONFIGURE_ARGS += \
        --with-statepath=/var/run/nut \
        --with-drvpath=/lib/nut \
        --with-user=root \
-       --with-group=root
+       --with-group=root \
+       $(if $(CONFIG_PACKAGE_nut-web-cgi),--with-gd-includes="`pkg-config --cflags gdlib`") \
+       $(if $(CONFIG_PACKAGE_nut-web-cgi),--with-gd-libs="`pkg-config --libs gdlib`")
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib/pkgconfig