udns: initial version 0.4
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 12 May 2017 13:58:23 +0000 (21:58 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Mon, 22 May 2017 01:56:56 +0000 (09:56 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
libs/udns/Makefile [new file with mode: 0644]
libs/udns/patches/0001-use-autotools.patch [new file with mode: 0644]

diff --git a/libs/udns/Makefile b/libs/udns/Makefile
new file mode 100644 (file)
index 0000000..4726c60
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2017 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=udns
+PKG_VERSION:=0.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.corpit.ru/mjt/udns
+PKG_LICENSE:=LGPL-2.1
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libudns
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=DNS Resolver Library
+  URL:=http://www.corpit.ru/mjt/udns.html
+endef
+
+define Package/libudns/description
+  UDNS is a stub DNS resolver library with ability to perform both syncronous
+  and asyncronous DNS queries.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib
+endef
+
+define Package/libudns/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libudns.so* $(1)/usr/lib/
+endef
+
+define udns-utility-template
+  define Package/udns-$(1)
+    SECTION:=utils
+    CATEGORY:=Utilities
+    TITLE:= $(2)
+    URL:=http://www.corpit.ru/mjt/udns.html
+    DEPENDS:=+libudns
+  endef
+
+  define Package/udns-$(1)/install
+       $(INSTALL_DIR) $$(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/$(1) $$(1)/usr/bin/
+  endef
+
+endef
+
+CONFIGURE_ARGS += $(DISABLE_IPV6)
+
+$(eval $(call udns-utility-template,dnsget,a simple DNS query tool))
+$(eval $(call udns-utility-template,rblcheck,a simple DNSBL lookups tool))
+$(eval $(call udns-utility-template,ex-rdns,a parallel rDNS resolver))
+
+$(eval $(call BuildPackage,libudns))
+$(eval $(call BuildPackage,udns-dnsget))
+$(eval $(call BuildPackage,udns-rblcheck))
+$(eval $(call BuildPackage,udns-ex-rdns))
diff --git a/libs/udns/patches/0001-use-autotools.patch b/libs/udns/patches/0001-use-autotools.patch
new file mode 100644 (file)
index 0000000..5da20d8
--- /dev/null
@@ -0,0 +1,78 @@
+--- a/dev/null 2017-05-06 19:04:40.272000000 +0800
++++ b/configure.ac     2017-05-13 20:56:26.761460807 +0800
+@@ -0,0 +1,56 @@
++# Copyright 2016 Yousong Zhou
++
++AC_PREREQ([2.67])
++AC_INIT([libudns], [0.4])
++AC_CONFIG_HEADERS([config.h])
++
++AM_INIT_AUTOMAKE([foreign])
++LT_INIT
++
++dnl Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++AC_PROG_LN_S
++AC_PROG_LIBTOOL
++
++dnl Checks for library functions.
++AC_CHECK_LIB(socket, connect)
++AC_CHECK_FUNCS([malloc memset socket])
++AC_CHECK_FUNCS([getopt poll])
++AC_CHECK_FUNCS([inet_pton inet_ntop],
++                         [AC_DEFINE([HAVE_INET_PTON_NTOP], [1], [Have inet_pton and inet_ntop])])
++
++AC_ARG_ENABLE(ipv6,
++  AC_HELP_STRING([--disable-ipv6],[disable IPv6 support]),
++  [case "${enable_ipv6}" in
++    no)
++      AC_MSG_NOTICE([disabling IPv6 at user request])
++      ipv6=no
++      ;;
++    yes)
++      ipv6=yes
++        force_ipv6=yes
++      ;;
++    *)
++      AC_MSG_ERROR([Invalid --enable-ipv6 argument \`$enable_ipv6'])
++      ;;
++    esac
++  ], [
++    dnl If nothing is specified, assume auto-detection.
++    ipv6=yes
++      force_ipv6=no
++  ]
++)
++
++if test "x$ipv6" = "xyes"; then
++  AC_CHECK_TYPE([struct sockaddr_in6],
++    [AC_DEFINE([HAVE_IPv6], [1], [Have ipv6 support])],
++    [if test "x$force_ipv6" = "xyes"; then
++      AC_MSG_ERROR([ipv6 support requested but cannot be fulfilled])
++     fi],
++    [#include <sys/socket.h>
++     #include <netinet/in.h>])
++fi
++
++AC_CONFIG_FILES([Makefile])
++AC_OUTPUT
+--- a/dev/null 2016-01-04 02:31:18.900000000 +0800
++++ b/Makefile.am      2016-02-22 20:12:01.938987311 +0800
+@@ -0,0 +1,16 @@
++# Copyright 2016 Yousong Zhou
++
++lib_LTLIBRARIES=libudns.la
++libudns_la_SOURCES= udns_dn.c udns_dntosp.c udns_parse.c udns_resolver.c udns_init.c \
++      udns_misc.c udns_XtoX.c \
++      udns_rr_a.c udns_rr_ptr.c udns_rr_mx.c udns_rr_txt.c udns_bl.c \
++      udns_rr_srv.c udns_rr_naptr.c udns_codes.c udns_jran.c
++include_HEADERS= udns.h
++
++bin_PROGRAMS = dnsget rblcheck ex-rdns
++dnsget_SOURCES = dnsget.c
++rblcheck_SOURCES = rblcheck.c
++ex_rdns_SOURCES = ex-rdns.c
++dnsget_LDADD = $(top_builddir)/libudns.la
++rblcheck_LDADD = $(top_builddir)/libudns.la
++ex_rdns_LDADD = $(top_builddir)/libudns.la