From patchwork Tue Apr 18 15:48:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 751880 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w6qL15Zsjz9s65 for ; Wed, 19 Apr 2017 01:48:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 16D20305C0; Tue, 18 Apr 2017 15:48:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ddShWHwxYh-P; Tue, 18 Apr 2017 15:48:36 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id B41D230B02; Tue, 18 Apr 2017 15:48:35 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 12B1E1BFBA2 for ; Tue, 18 Apr 2017 15:48:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DD0888513 for ; Tue, 18 Apr 2017 15:48:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aKmLzM0INkZh for ; Tue, 18 Apr 2017 15:48:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by fraxinus.osuosl.org (Postfix) with ESMTP id BC92288512 for ; Tue, 18 Apr 2017 15:48:30 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTP id 10EC4C137DAA1 for ; Tue, 18 Apr 2017 16:48:25 +0100 (IST) Received: from vriera-linux.le.imgtec.org (192.168.154.96) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 18 Apr 2017 16:48:28 +0100 From: Vicente Olivert Riera To: Date: Tue, 18 Apr 2017 16:48:14 +0100 Message-ID: <20170418154815.51039-1-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 X-Originating-IP: [192.168.154.96] Subject: [Buildroot] [PATCH 1/2] librhash: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Vicente Olivert Riera --- package/Config.in | 1 + package/librhash/Config.in | 23 +++++++++++++++ package/librhash/librhash.hash | 3 ++ package/librhash/librhash.mk | 64 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 package/librhash/Config.in create mode 100644 package/librhash/librhash.hash create mode 100644 package/librhash/librhash.mk diff --git a/package/Config.in b/package/Config.in index 4eaa95b..a7053a6 100644 --- a/package/Config.in +++ b/package/Config.in @@ -948,6 +948,7 @@ menu "Crypto" source "package/libmcrypt/Config.in" source "package/libmhash/Config.in" source "package/libnss/Config.in" + source "package/librhash/Config.in" source "package/libscrypt/Config.in" source "package/libsecret/Config.in" source "package/libsha1/Config.in" diff --git a/package/librhash/Config.in b/package/librhash/Config.in new file mode 100644 index 0000000..c3b552d --- /dev/null +++ b/package/librhash/Config.in @@ -0,0 +1,23 @@ +config BR2_PACKAGE_LIBRHASH + bool "librhash" + select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE + help + RHash is a console utility for calculation and verification of magnet + links and a wide range of hash sums like CRC32, MD4, MD5, SHA1, + SHA256, SHA512, SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent BTIH, + GOST R 34.11-94, RIPEMD-160, HAS-160, EDON-R, Whirlpool and Snefru. + + https://github.com/rhash/RHash + +if BR2_PACKAGE_LIBRHASH + +config BR2_PACKAGE_RHASH + bool "rhash binary" + depends on !BR2_STATIC_LIBS + help + Install rhash binary as well + +comment "rhash binary needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + +endif diff --git a/package/librhash/librhash.hash b/package/librhash/librhash.hash new file mode 100644 index 0000000..5efc3a6 --- /dev/null +++ b/package/librhash/librhash.hash @@ -0,0 +1,3 @@ +# From https://sourceforge.net/projects/rhash/files/rhash/1.3.4/ +md5 0b51010604659e9e99f6307b053ba13b rhash-1.3.4-src.tar.gz +sha1 411d8c7ba84fa9763bc49fa2fd3a7587712fd52c rhash-1.3.4-src.tar.gz diff --git a/package/librhash/librhash.mk b/package/librhash/librhash.mk new file mode 100644 index 0000000..79806c9 --- /dev/null +++ b/package/librhash/librhash.mk @@ -0,0 +1,64 @@ +################################################################################ +# +# librhash +# +################################################################################ + +LIBRHASH_VERSION = 1.3.4 +LIBRHASH_SOURCE = rhash-$(LIBRHASH_VERSION)-src.tar.gz +LIBRHASH_SITE = https://sourceforge.net/projects/rhash/files/rhash/$(LIBRHASH_VERSION) +LIBRHASH_LICENSE = MIT +LIBRHASH_LICENSE_FILES = COPYING +LIBRHASH_INSTALL_STAGING = YES + +ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y) +LIBRHASH_DEPENDENCIES += gettext +LIBRHASH_ADDCFLAGS += -DUSE_GETTEXT +LIBRHASH_ADDLDFLAGS += -lintl +endif + +ifeq ($(BR2_PACKAGE_OPENSSL)x$(BR2_STATIC_LIBS),yx) +LIBRHASH_DEPENDENCIES += openssl +LIBRHASH_ADDCFLAGS += -DOPENSSL_RUNTIME -rdynamic +LIBRHASH_ADDLDFLAGS += -ldl +endif + +ifeq ($(BR2_SHARED_STATIC_LIBS),y) +LIBRHASH_BUILD_TARGETS = lib-static lib-shared build-shared +LIBRHASH_INSTALL_TARGETS = install-lib-static install-lib-shared install-so-link +else ifeq ($(BR2_SHARED_LIBS),y) +LIBRHASH_BUILD_TARGETS = lib-shared build-shared +LIBRHASH_INSTALL_TARGETS = install-lib-shared install-so-link +else +LIBRHASH_BUILD_TARGETS = lib-static +LIBRHASH_INSTALL_TARGETS = install-lib-static +endif + +define LIBRHASH_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \ + ADDCFLAGS="$(LIBRHASH_ADDCFLAGS)" ADDLDFLAGS="$(LIBRHASH_ADDLDFLAGS)" \ + $(LIBRHASH_BUILD_TARGETS) +endef + +define LIBRHASH_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/librhash \ + DESTDIR="$(STAGING_DIR)" PREFIX="/usr" \ + $(LIBRHASH_INSTALL_TARGETS) install-headers +endef + +define LIBRHASH_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/librhash \ + DESTDIR="$(TARGET_DIR)" PREFIX="/usr" \ + $(LIBRHASH_INSTALL_TARGETS) +endef + +ifeq ($(BR2_PACKAGE_RHASH),y) +define LIBRHASH_INSTALL_RHASH_BINARY + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \ + DESTDIR="$(TARGET_DIR)" PREFIX="/usr" \ + install-shared +endef +LIBRHASH_POST_INSTALL_TARGET_HOOKS += LIBRHASH_INSTALL_RHASH_BINARY +endif + +$(eval $(generic-package))