app-crypt/signify: add port (#1896)

This commit is contained in:
Leorize
2017-12-14 13:57:43 +07:00
committed by fbrosson
parent 52f4604600
commit 50fbc3441b
3 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,52 @@
From 3e4f5bdfdb0837c03338bb37c1d02e57a3d402f8 Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Thu, 14 Dec 2017 14:19:01 +0700
Subject: Add Haiku support
Disable pkg-config if flags has been provided
sha2: include endian.h
diff --git a/Makefile b/Makefile
index 3b188ac..1d13ece 100644
--- a/Makefile
+++ b/Makefile
@@ -148,17 +148,22 @@ $S: $(libbsd_INCLUDE)/bsd/bsd.h
else
+LIBBSD_DEPS :=
+ifdef LIBBSD_CFLAGS
+
+else
+
LIBBSD_PKG_VERSION := 0.7
LIBBSD_PKG_CHECK := $(shell pkg-config libbsd --atleast-version=$(LIBBSD_PKG_VERSION) && echo ok)
ifneq ($(strip $(LIBBSD_PKG_CHECK)),ok)
$(error libbsd is not installed or version is older than $(LIBBSD_PKG_VERSION))
endif
-LIBBSD_DEPS :=
LIBBSD_CFLAGS := $(shell pkg-config libbsd --cflags)
LIBBSD_LDFLAGS := $(shell pkg-config libbsd --libs)
endif
+endif
# In order to use libwaive, we need libseccomp and making sure that the
# Git submodule corresponding to libwaive is properly checked out.
diff --git a/sha2.c b/sha2.c
index 7bf187f..c284114 100644
--- a/sha2.c
+++ b/sha2.c
@@ -35,6 +35,7 @@
*/
#include <sys/types.h>
+#include <endian.h>
#include <bsd/string.h>
#include "sha2.h"
--
2.15.0

View File

@@ -0,0 +1,55 @@
SUMMARY="Cryptographically sign and verify files"
DESCRIPTION="OpenBSD tool to sign and verify signatures on files. \
Portable version"
HOMEPAGE="https://github.com/aperezdc/signify"
# Extracted with grep -i 'copyright (c)' *
COPYRIGHT="2013 Ted Unangst
1995 International Business Machines, Inc
1996 Internet Software Consortium
2015, 2016 Adrián Pérez de Castro
2000 Poul-Henning Kamp
1999, 2004 Marc Espie
2000, 2001 Aaron D. Gifford
2013, 2016 Marc Espie
2010 Damien Miller"
LICENSE="ISC"
REVISION="1"
SOURCE_URI="https://github.com/aperezdc/signify/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="1c690bf0e4283e0764a4a9dd784cb3debf4bb456b975b275dd1aaac7d5afe030"
PATCHES="signify-$portVersion.patchset"
ARCHITECTURES="?x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
signify$secondaryArchSuffix = $portVersion
cmd:signify$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:cc$secondaryArchSuffix
"
PATCH()
{
sed -e 's|bsd/||g' -i *.c *.h
}
BUILD()
{
make BZERO=libc LIBBSD_CFLAGS="-D_BSD_SOURCE" LIBBSD_LDFLAGS="-lbsd"
}
INSTALL()
{
install -d -m 755 "$binDir" "$manDir/man1"
install -t "$binDir" -m 755 signify
install -t "$manDir/man1" -m 644 signify.1
}