From 22d125bfabcfa9d29495ed8bef874f7c122dd2ec Mon Sep 17 00:00:00 2001
From: TQ Hirsch <thequux@upstandinghackers.com>
Date: Tue, 22 Apr 2014 15:04:26 +0200
Subject: [PATCH] Added NetBSD and OpenBSD ports

---
 contrib/netbsd/DESCR             |  1 +
 contrib/netbsd/Makefile          | 32 ++++++++++++++++
 contrib/netbsd/PLIST             | 11 ++++++
 contrib/netbsd/distinfo          |  5 +++
 contrib/openbsd/Makefile         | 65 ++++++++++++++++++++++++++++++++
 contrib/openbsd/distinfo         |  2 +
 contrib/openbsd/pkg/DESCR        |  1 +
 contrib/openbsd/pkg/PFRAG.shared |  2 +
 contrib/openbsd/pkg/PLIST        | 15 ++++++++
 9 files changed, 134 insertions(+)
 create mode 100644 contrib/netbsd/DESCR
 create mode 100644 contrib/netbsd/Makefile
 create mode 100644 contrib/netbsd/PLIST
 create mode 100644 contrib/netbsd/distinfo
 create mode 100644 contrib/openbsd/Makefile
 create mode 100644 contrib/openbsd/distinfo
 create mode 100644 contrib/openbsd/pkg/DESCR
 create mode 100644 contrib/openbsd/pkg/PFRAG.shared
 create mode 100644 contrib/openbsd/pkg/PLIST

diff --git a/contrib/netbsd/DESCR b/contrib/netbsd/DESCR
new file mode 100644
index 0000000..59725d8
--- /dev/null
+++ b/contrib/netbsd/DESCR
@@ -0,0 +1 @@
+Parser combinators! In C!
diff --git a/contrib/netbsd/Makefile b/contrib/netbsd/Makefile
new file mode 100644
index 0000000..b780e41
--- /dev/null
+++ b/contrib/netbsd/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD$
+VERSION=		1.0.0-rc3
+DISTNAME=		hammer-${VERSION}
+DISTFILES=		v${VERSION}${EXTRACT_SUFX}
+CATEGORIES=		devel
+LICENSE=		gnu-gpl-v2
+MASTER_SITES=		https://github.com/UpstandingHackers/hammer/archive/
+MAINTAINER=		thequux@upstandinghackers.com
+HOMEPAGE=		http://github.com/UpstandingHackers/hammer
+COMMENT=		Parser combinator library in C
+
+USE_TOOLS+=		gtar
+USE_LANGUAGES=		c c++
+#TOOLS_GTAR=		${TOOL_GTAR}
+FETCH_USING:=		fetch
+EXTRACT_USING=		gtar
+BUILD_DEPENDS+=         scons-[0-9]*:../../devel/scons
+
+FIND_PREFIX:=           SCONSDIR=scons
+.include "../../mk/find-prefix.mk"
+
+SCONS_ARGS=		--variant=opt DESTDIR=${DESTDIR} prefix=${PREFIX}
+
+do-build:
+	cd ${WRKSRC} && ${SCONSDIR}/bin/scons ${SCONS_ARGS}
+
+do-install:
+	cd ${WRKSRC} && ${SCONSDIR}/bin/scons ${SCONS_ARGS} install
+
+
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/contrib/netbsd/PLIST b/contrib/netbsd/PLIST
new file mode 100644
index 0000000..1efea54
--- /dev/null
+++ b/contrib/netbsd/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD$
+include/hammer/internal.h
+include/hammer/allocator.h
+include/hammer/parsers/parser_internal.h
+include/hammer/backends/regex.h
+include/hammer/backends/contextfree.h
+include/hammer/glue.h
+include/hammer/hammer.h
+lib/libhammer.so
+lib/libhammer.a
+lib/pkgconfig/libhammer.pc
diff --git a/contrib/netbsd/distinfo b/contrib/netbsd/distinfo
new file mode 100644
index 0000000..fab0de0
--- /dev/null
+++ b/contrib/netbsd/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+SHA1 (v1.0.0-rc3.tar.gz) = 3e578d7f0e0a201aea7707c6041e48ec10ed7609
+RMD160 (v1.0.0-rc3.tar.gz) = c5863519d945dd63444bc478d0dac9abdc2a9a4b
+Size (v1.0.0-rc3.tar.gz) = 1335437 bytes
diff --git a/contrib/openbsd/Makefile b/contrib/openbsd/Makefile
new file mode 100644
index 0000000..da6fa26
--- /dev/null
+++ b/contrib/openbsd/Makefile
@@ -0,0 +1,65 @@
+# $OpenBSD: Makefile.template,v 1.67 2013/07/10 15:22:23 bcallah Exp $
+COMMENT =		parser combinators in C
+
+HAMMER_VERSION=1.0.0-rc3
+DISTNAME =		v${HAMMER_VERSION}
+PKGNAME =		hammer-${HAMMER_VERSION}
+
+# for any port that creates shared libraries.
+# both libtool and cmake handle this automatically.
+# for libtool-based ports, have a look at WRKBUILD/shared_libs.log
+#SHARED_LIBS =		???
+
+CATEGORIES =		devel
+MODULES=		devel/scons
+
+HOMEPAGE =		https://github.com/UpstandingHackers/hammer
+
+MAINTAINER =		TQ Hirsch <thequux@upstandinghackers.com>
+
+# License GPLv2
+PERMIT_PACKAGE_CDROM =	Yes
+PERMIT_PACKAGE_FTP =	Yes
+PERMIT_DISTFILES_FTP =	Yes
+
+# "make port-lib-depends-check" can help
+#WANTLIB =		???
+
+# where the source files and patches can be fetched
+#
+MASTER_SITES =		https://github.com/UpstandingHackers/hammer/archive/
+DIST_SUBDIR =		hammer-${HAMMER_VERSION}
+
+WRKDIST=		${WRKDIR}/${PKGNAME}
+
+#MODULES =		???
+TEST_DEPENDS = 		devel/glib2
+#BUILD_DEPENDS =		scons
+#RUN_DEPENDS =		???
+#LIB_DEPENDS =		???
+#TEST_DEPENDS =		???
+
+#MAKE_FLAGS =		???
+#DESTDIRNAME = 		DESTIR_IGNOREME
+#FAKE_FLAGS =		???
+#TEST_FLAGS =		???
+
+# build/configuration variables
+#
+#MODSCONS_ENV+=		DESTDIR=${DESTDIR} prefix=${PREFIX}
+MODSCONS_ENV+=		prefix=${TRUEPREFIX}
+MODSCONS_OPTS+=		--variant=opt
+
+#ALL_TARGET =		???
+#INSTALL_TARGET =	???
+#TEST_TARGET =		???
+
+MODSCONS_TEST_TARGET = \
+	${SETENV} ${MAKE_ENV} ${MODSCONS_BIN} -C ${WRKSRC} \
+		${MODSCONS_ENV} ${MODSCONS_FLAGS} ${TEST_TARGET}
+
+do-test:
+	@$(MODSCONS_TEST_TARGET)
+
+
+.include <bsd.port.mk>
diff --git a/contrib/openbsd/distinfo b/contrib/openbsd/distinfo
new file mode 100644
index 0000000..20f404d
--- /dev/null
+++ b/contrib/openbsd/distinfo
@@ -0,0 +1,2 @@
+SHA256 (hammer-1.0.0-rc3/v1.0.0-rc3.tar.gz) = AUAEvOeyX0LXqduL+0SxsfxYcsKGKRp3XbtdwLOkHTk=
+SIZE (hammer-1.0.0-rc3/v1.0.0-rc3.tar.gz) = 1335437
diff --git a/contrib/openbsd/pkg/DESCR b/contrib/openbsd/pkg/DESCR
new file mode 100644
index 0000000..dc561d8
--- /dev/null
+++ b/contrib/openbsd/pkg/DESCR
@@ -0,0 +1 @@
+Parser combinators in C.
diff --git a/contrib/openbsd/pkg/PFRAG.shared b/contrib/openbsd/pkg/PFRAG.shared
new file mode 100644
index 0000000..8e29a23
--- /dev/null
+++ b/contrib/openbsd/pkg/PFRAG.shared
@@ -0,0 +1,2 @@
+@comment $OpenBSD$
+lib/libhammer.so
diff --git a/contrib/openbsd/pkg/PLIST b/contrib/openbsd/pkg/PLIST
new file mode 100644
index 0000000..53901ee
--- /dev/null
+++ b/contrib/openbsd/pkg/PLIST
@@ -0,0 +1,15 @@
+@comment $OpenBSD$
+%%SHARED%%
+include/hammer/
+include/hammer/allocator.h
+include/hammer/backends/
+include/hammer/backends/contextfree.h
+include/hammer/backends/regex.h
+include/hammer/glue.h
+include/hammer/hammer.h
+include/hammer/internal.h
+include/hammer/parsers/
+include/hammer/parsers/parser_internal.h
+lib/libhammer.a
+lib/pkgconfig/
+lib/pkgconfig/libhammer.pc
-- 
GitLab