miniupnpd: Fix UUID dependency not to check outside the tree, and use uuid always.
authorMarkus Stenberg <markus.stenberg@iki.fi>
Tue, 28 Jun 2016 12:18:30 +0000 (15:18 +0300)
committerMarkus Stenberg <markus.stenberg@iki.fi>
Tue, 28 Jun 2016 12:18:30 +0000 (15:18 +0300)
miniupnpd/Makefile
miniupnpd/patches/100-no-ssl.patch [deleted file]
miniupnpd/patches/101-no-ssl-uuid.patch [new file with mode: 0644]
miniupnpd/patches/104-always-libuuid.patch [new file with mode: 0644]

index 0207036fde3fa9085714a64f4e40610d5be28c31..fbbcfee4828b713da549d6f4b0456db7afcbffae 100644 (file)
@@ -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 (file)
index 343e615..0000000
+++ /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 (file)
index 0000000..03a4966
--- /dev/null
@@ -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 (file)
index 0000000..d6c0770
--- /dev/null
@@ -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