From 50ac90a9cc4a2f0870c97a9f6b8ba41ea4ed068a Mon Sep 17 00:00:00 2001 From: Markus Stenberg Date: Tue, 28 Jun 2016 15:18:30 +0300 Subject: [PATCH] miniupnpd: Fix UUID dependency not to check outside the tree, and use uuid always. --- miniupnpd/Makefile | 7 +++--- miniupnpd/patches/100-no-ssl.patch | 12 ----------- miniupnpd/patches/101-no-ssl-uuid.patch | 25 ++++++++++++++++++++++ miniupnpd/patches/104-always-libuuid.patch | 20 +++++++++++++++++ 4 files changed, 49 insertions(+), 15 deletions(-) delete mode 100644 miniupnpd/patches/100-no-ssl.patch create mode 100644 miniupnpd/patches/101-no-ssl-uuid.patch create mode 100644 miniupnpd/patches/104-always-libuuid.patch diff --git a/miniupnpd/Makefile b/miniupnpd/Makefile index 0207036..fbbcfee 100644 --- a/miniupnpd/Makefile +++ b/miniupnpd/Makefile @@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/package.mk define Package/miniupnpd SECTION:=net CATEGORY:=Network - DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables + DEPENDS:=+iptables +libip4tc +IPV6:libip6tc +IPV6:ip6tables +libuuid TITLE:=Lightweight UPnP IGD, NAT-PMP & PCP daemon SUBMENU:=Firewall URL:=http://miniupnp.free.fr/ @@ -50,9 +50,10 @@ define Build/Prepare endef MAKE_FLAGS += \ - TEST=0 \ + TARGET_OPENWRT=1 TEST=0 \ LIBS="" \ - CC="$(TARGET_CC) -DIPTABLES_143 -lip4tc $(if $(CONFIG_IPV6),-lip6tc)" \ + CC="$(TARGET_CC) -DIPTABLES_143 \ + -lip4tc $(if $(CONFIG_IPV6),-lip6tc) -luuid" \ CONFIG_OPTIONS="$(if $(CONFIG_IPV6),--ipv6) --leasefile" \ -f Makefile.linux \ miniupnpd diff --git a/miniupnpd/patches/100-no-ssl.patch b/miniupnpd/patches/100-no-ssl.patch deleted file mode 100644 index 343e615..0000000 --- a/miniupnpd/patches/100-no-ssl.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/Makefile.linux -+++ b/Makefile.linux -@@ -147,7 +147,8 @@ LDLIBS += $(shell $(PKG_CONFIG) --static - LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack) - endif # ($(TEST),1) - --LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl) -+# n/a - we don't enable https server for IGD v2 anyway -+#LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl) - - TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o - diff --git a/miniupnpd/patches/101-no-ssl-uuid.patch b/miniupnpd/patches/101-no-ssl-uuid.patch new file mode 100644 index 0000000..03a4966 --- /dev/null +++ b/miniupnpd/patches/101-no-ssl-uuid.patch @@ -0,0 +1,25 @@ +We do not need to autodetect SSL/UUID; SSL we do not support, UUID we always do. + +diff --git a/miniupnpd/Makefile.linux b/miniupnpd/Makefile.linux +index 2d28126..01daeea 100644 +--- a/Makefile.linux ++++ b/Makefile.linux +@@ -153,14 +153,18 @@ LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libmnl) + LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libnetfilter_conntrack) + endif # ($(TEST),1) + ++ifeq ($(TARGET_OPENWRT),) ++# n/a - we don't enable https server for IGD v2 anyway in OpenWrt + LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l libssl) + ++# n/a - we hardcodedly support libuuid + TEST := $(shell $(PKG_CONFIG) --exists uuid && echo 1) + ifeq ($(TEST),1) + LDLIBS += $(shell $(PKG_CONFIG) --static --libs-only-l uuid) + else + $(info please install uuid-dev package / libuuid) + endif # ($(TEST),1) ++endif + + TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o + diff --git a/miniupnpd/patches/104-always-libuuid.patch b/miniupnpd/patches/104-always-libuuid.patch new file mode 100644 index 0000000..d6c0770 --- /dev/null +++ b/miniupnpd/patches/104-always-libuuid.patch @@ -0,0 +1,20 @@ +As it turns out, the 'magic' libuuid/bsd uuid check just checks +outside buildtree altogether for the uuid_generate. So we just +hardcode it. + +--- a/genconfig.sh ++++ b/genconfig.sh +@@ -367,12 +367,7 @@ case $FW in + esac + + # UUID API +-if grep uuid_create /usr/include/uuid.h > /dev/null 2>&1 ; then +- echo "#define BSD_UUID" >> ${CONFIGFILE} +-fi +-if grep uuid_generate /usr/include/uuid/uuid.h > /dev/null 2>&1 ; then +- echo "#define LIB_UUID" >> ${CONFIGFILE} +-fi ++echo "#define LIB_UUID" >> ${CONFIGFILE} + + # set V6SOCKETS_ARE_V6ONLY to 0 if it was not set above + if [ -z "$V6SOCKETS_ARE_V6ONLY" ] ; then