whois: add package

Better a separate package than enabling it via busybox.
Special thanks to @neheb for the Makefile patches.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren 2020-11-18 10:22:58 -10:00
parent fd5cb376b5
commit 3f7542e4ce
5 changed files with 84 additions and 0 deletions

48
utils/whois/Makefile Normal file
View File

@ -0,0 +1,48 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=whois
PKG_VERSION:=5.5.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/w/whois
PKG_HASH:=3efa700dbf38d127c31b21af3176cd6e5a69f96a056be60ac1dcd13df7717393
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS:=perl/host
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/whois
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Intelligent WHOIS client
URL:=https://github.com/rfc1036/whois
endef
define Package/whois/description
This client is intelligent and can automatically select the appropriate whois
server for most queries.
The internal database is often more accurate than IANA's published one, but
please send me any information you have regarding domains and network resources
which are not correctly handled by the program.
endef
EXTRA_CFLAGS+=-DHAVE_GETOPT_LONG
MAKE_FLAGS += PERL=$(STAGING_DIR_HOSTPKG)/usr/bin/perl
define Package/whois/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/whois $(1)/usr/bin/whois
endef
$(eval $(call BuildPackage,whois))

View File

@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -56,8 +56,6 @@ DEFS += -DHAVE_ICONV
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'libxcrypt >= 4.1' || echo NO),)
-DEFS += -DHAVE_CRYPT_H -DHAVE_LINUX_CRYPT_GENSALT $(shell $(PKG_CONFIG) --cflags libcrypt)
-mkpasswd_LDADD += $(shell $(PKG_CONFIG) --libs libcrypt)
else ifdef HAVE_XCRYPT
DEFS += -DHAVE_XCRYPT_H -DHAVE_LINUX_CRYPT_GENSALT
mkpasswd_LDADD += -lxcrypt

View File

@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -43,8 +43,6 @@ $(error Please fix your build system to stop defining HAVE_LIBIDN!)
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'libidn2 >= 2.0.3' || echo NO),)
-whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn2)
-DEFS += -DHAVE_LIBIDN2 $(shell $(PKG_CONFIG) --cflags libidn2)
else ifeq ($(shell $(PKG_CONFIG) --exists 'libidn' || echo NO),)
whois_LDADD += $(shell $(PKG_CONFIG) --libs libidn)
DEFS += -DHAVE_LIBIDN $(shell $(PKG_CONFIG) --cflags libidn)

View File

@ -0,0 +1,11 @@
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ endif
CPPFLAGS += $(DEFS) $(INCLUDES)
##############################################################################
-all: Makefile.depend whois mkpasswd pos
+all: Makefile.depend whois pos
##############################################################################
%.o: %.c

3
utils/whois/test.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
whois --version | grep "$2"