summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--security/nettle/DESCR23
-rw-r--r--security/nettle/Makefile25
-rw-r--r--security/nettle/PLIST44
-rw-r--r--security/nettle/buildlink3.mk12
-rw-r--r--security/nettle/distinfo9
-rw-r--r--security/nettle/patches/patch-Makefile.in67
-rw-r--r--security/nettle/patches/patch-config.make.in17
-rw-r--r--security/nettle/patches/patch-testsuite_Makefile.in26
-rw-r--r--security/nettle/patches/patch-tools_Makefile.in37
9 files changed, 260 insertions, 0 deletions
diff --git a/security/nettle/DESCR b/security/nettle/DESCR
new file mode 100644
index 00000000000..4e96fca776d
--- /dev/null
+++ b/security/nettle/DESCR
@@ -0,0 +1,23 @@
+Nettle is a cryptographic library that is designed to fit easily in more
+or less any context: In crypto toolkits for object-oriented languages
+(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
+kernel space. In most contexts, you need more than the basic
+cryptographic algorithms, you also need some way to keep track of available
+algorithms, their properties and variants. You often have some algorithm
+selection process, often dictated by a protocol you want to implement.
+
+And as the requirements of applications differ in subtle and not so
+subtle ways, an API that fits one application well can be a pain to use
+in a different context. And that is why there are so many different
+cryptographic libraries around.
+
+Nettle tries to avoid this problem by doing one thing, the low-level
+crypto stuff, and providing a simple but general interface to it.
+In particular, Nettle doesn't do algorithm selection. It doesn't do
+memory allocation. It doesn't do any I/O.
+
+The idea is that one can build several application and context specific
+interfaces on top of Nettle, and share the code, test cases, benchmarks,
+documentation, etc. Examples are the Nettle module for the Pike
+language, and LSH, which both use an object-oriented abstraction on top
+of the library.
diff --git a/security/nettle/Makefile b/security/nettle/Makefile
new file mode 100644
index 00000000000..faee5861659
--- /dev/null
+++ b/security/nettle/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+DISTNAME= nettle-2.1
+CATEGORIES= devel security
+MASTER_SITES= http://www.lysator.liu.se/~nisse/archive/ \
+ ftp://ftp.lysator.liu.se/pub/security/lsh/
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://www.lysator.liu.se/~nisse/nettle/
+COMMENT= Cryptographic library
+LICENSE= gnu-gpl-v2
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+USE_LANGUAGES= c
+USE_LIBTOOL= yes
+USE_TOOLS+= gmake m4
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS+= --disable-openssl
+
+INFO_FILES= yes
+TEST_TARGET= check
+
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/security/nettle/PLIST b/security/nettle/PLIST
new file mode 100644
index 00000000000..fedcb409e7d
--- /dev/null
+++ b/security/nettle/PLIST
@@ -0,0 +1,44 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+bin/nettle-lfib-stream
+bin/pkcs1-conv
+bin/sexp-conv
+include/nettle/aes.h
+include/nettle/arcfour.h
+include/nettle/arctwo.h
+include/nettle/asn1.h
+include/nettle/base16.h
+include/nettle/base64.h
+include/nettle/bignum.h
+include/nettle/blowfish.h
+include/nettle/buffer.h
+include/nettle/camellia.h
+include/nettle/cast128.h
+include/nettle/cbc.h
+include/nettle/ctr.h
+include/nettle/des-compat.h
+include/nettle/des.h
+include/nettle/dsa.h
+include/nettle/hmac.h
+include/nettle/knuth-lfib.h
+include/nettle/macros.h
+include/nettle/md2.h
+include/nettle/md4.h
+include/nettle/md5-compat.h
+include/nettle/md5.h
+include/nettle/memxor.h
+include/nettle/nettle-meta.h
+include/nettle/nettle-stdint.h
+include/nettle/nettle-types.h
+include/nettle/pgp.h
+include/nettle/pkcs1.h
+include/nettle/realloc.h
+include/nettle/rsa-compat.h
+include/nettle/rsa.h
+include/nettle/serpent.h
+include/nettle/sexp.h
+include/nettle/sha.h
+include/nettle/twofish.h
+include/nettle/yarrow.h
+info/nettle.info
+lib/libhogweed.la
+lib/libnettle.la
diff --git a/security/nettle/buildlink3.mk b/security/nettle/buildlink3.mk
new file mode 100644
index 00000000000..4643ca1eae3
--- /dev/null
+++ b/security/nettle/buildlink3.mk
@@ -0,0 +1,12 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+BUILDLINK_TREE+= libnettle
+
+.if !defined(LIBNETTLE_BUILDLINK3_MK)
+LIBNETTLE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libnettle+= nettle>=2.1
+BUILDLINK_PKGSRCDIR.libnettle?= ../../security/nettle
+.endif # LIBNETTLE_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -libnettle
diff --git a/security/nettle/distinfo b/security/nettle/distinfo
new file mode 100644
index 00000000000..30795712daf
--- /dev/null
+++ b/security/nettle/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+SHA1 (nettle-2.1.tar.gz) = 15f660ef6cfd62c1c3302f68055f194913de0dfb
+RMD160 (nettle-2.1.tar.gz) = 56bd66654e8320abb12812d0fa1b79733bc62094
+Size (nettle-2.1.tar.gz) = 965345 bytes
+SHA1 (patch-Makefile.in) = 398a39012453940ab6c65307402bed71e2515069
+SHA1 (patch-config.make.in) = 0bf3d2729b97883b41374a1ea3d5286fd2554e98
+SHA1 (patch-testsuite_Makefile.in) = 38498777821eba9a5d303e6d7848addf5da06700
+SHA1 (patch-tools_Makefile.in) = 262d59cb6e642e6ad4c8bec2e166fc18367d91d7
diff --git a/security/nettle/patches/patch-Makefile.in b/security/nettle/patches/patch-Makefile.in
new file mode 100644
index 00000000000..163872427e0
--- /dev/null
+++ b/security/nettle/patches/patch-Makefile.in
@@ -0,0 +1,67 @@
+$NetBSD: patch-Makefile.in,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+Use LIBTOOL.
+
+--- Makefile.in.orig 2010-07-25 19:30:13.000000000 +0000
++++ Makefile.in
+@@ -14,13 +14,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = $(INSTALL_PROGRAM) -s
+ MKDIR_P = @MKDIR_P@
+
+-SUBDIRS = tools testsuite examples
++SUBDIRS = tools testsuite
+
+ include config.make
+
+ PRE_CPPFLAGS = -I.
+ # FIXME: Add configuration of LIBEXT?
+-LIBTARGETS = libnettle.a @IF_HOGWEED@ libhogweed.a
++LIBTARGETS = libnettle.la @IF_HOGWEED@ libhogweed.la
+ SHLIBTARGETS = $(LIBNETTLE_FORLINK) @IF_HOGWEED@ $(LIBHOGWEED_FORLINK)
+
+ TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) \
+@@ -138,19 +138,17 @@ hogweed_OBJS = $(hogweed_SOURCES:.c=.$(O
+ hogweed_PURE_OBJS = $(hogweed_OBJS:.$(OBJEXT)=.p$(OBJEXT))
+
+ # FIXME: Do we really need to delete the archive first?
+-libnettle.a: $(nettle_OBJS)
+- -rm -f $@
+- $(AR) $(ARFLAGS) $@ $(nettle_OBJS)
+- $(RANLIB) $@
++libnettle.la: $(nettle_OBJS)
++ ${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o libnettle.la \
++ ${nettle_OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info 4:0
+
+ # FIXME: Do we really need to delete the archive first?
+-libhogweed.a: $(hogweed_OBJS)
+- -rm -f $@
+- $(AR) $(ARFLAGS) $@ $(hogweed_OBJS)
+- $(RANLIB) $@
++libhogweed.la: $(hogweed_OBJS)
++ ${LIBTOOL} --mode=link ${CC} ${LDFLAGS} -o libhogweed.la \
++ ${hogweed_OBJS:.o=.lo} -rpath ${PREFIX}/lib -version-info 4:0
+
+ .c.$(OBJEXT):
+- $(COMPILE) $(CCPIC_MAYBE) -c $< \
++ ${LIBTOOL} --mode=compile --tag=CC $(COMPILE) $(CCPIC_MAYBE) -c $< \
+ && $(DEP_PROCESS)
+
+ # Rules building shared libraries
+@@ -200,7 +198,7 @@ des.$(OBJEXT): des.c des.h $(des_headers
+ .asm.$(OBJEXT):
+ $(M4) $(srcdir)/asm.m4 machine.m4 config.m4 \
+ $< >$*.s
+- $(COMPILE) $(CCPIC_MAYBE) -c $*.s
++ ${LIBTOOL} --mode=compile --tag=CC $(COMPILE) $(CCPIC_MAYBE) -c $*.s
+ echo "$@ : $< $(srcdir)/asm.m4 machine.m4 config.m4" >$@.d
+
+ .asm.p$(OBJEXT):
+@@ -266,7 +264,7 @@ install-here: install-info install-heade
+ install-static: $(LIBTARGETS)
+ $(MKDIR_P) $(DESTDIR)$(libdir)
+ for f in $(LIBTARGETS); do \
+- $(INSTALL_DATA) $$f $(DESTDIR)$(libdir) ; \
++ ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} $$f $(DESTDIR)$(libdir) ; \
+ done
+
+ install-shared-nettle: $(LIBNETTLE_FORLINK)
diff --git a/security/nettle/patches/patch-config.make.in b/security/nettle/patches/patch-config.make.in
new file mode 100644
index 00000000000..725e5ccbb6c
--- /dev/null
+++ b/security/nettle/patches/patch-config.make.in
@@ -0,0 +1,17 @@
+$NetBSD: patch-config.make.in,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+Use LIBTOOL.
+
+--- config.make.in.orig 2011-04-26 08:41:17.000000000 +0000
++++ config.make.in
+@@ -63,8 +63,8 @@ infodir = @infodir@
+
+ COMPILE = $(CC) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(CCPIC) $(DEP_FLAGS)
+ COMPILE_CXX = $(CXX) $(PRE_CPPFLAGS) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(CCPIC) $(DEP_FLAGS)
+-LINK = $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
+-LINK_CXX = $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
++LINK = ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
++LINK_CXX = ${LIBTOOL} --mode=link $(CXX) $(CXXFLAGS) $(PRE_LDFLAGS) $(LDFLAGS)
+
+ # Default rule. Must be here, since config.make is included before the
+ # usual targets.
diff --git a/security/nettle/patches/patch-testsuite_Makefile.in b/security/nettle/patches/patch-testsuite_Makefile.in
new file mode 100644
index 00000000000..75b4d8126dc
--- /dev/null
+++ b/security/nettle/patches/patch-testsuite_Makefile.in
@@ -0,0 +1,26 @@
+$NetBSD: patch-testsuite_Makefile.in,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+Use LIBTOOL.
+
+--- testsuite/Makefile.in.orig 2011-04-26 08:29:38.000000000 +0000
++++ testsuite/Makefile.in
+@@ -62,8 +62,8 @@ all: $(TARGETS) $(EXTRA_TARGETS)
+ # to use suffix rules to build the test executables. So we use an
+ # explicit rule for each and every executable.
+
+-LIB_HOGWEED = @IF_HOGWEED@ -lhogweed
+-TEST_OBJS = testutils.$(OBJEXT) $(LIB_HOGWEED) -lnettle $(LIBS)
++LIB_HOGWEED = @IF_HOGWEED@ ../libhogweed.la
++TEST_OBJS = testutils.$(OBJEXT) $(LIB_HOGWEED) ../libnettle.la $(LIBS)
+
+ .PHONY: test-rules
+ test-rules:
+@@ -81,7 +81,7 @@ test-rules:
+ include $(srcdir)/.test-rules.make
+
+ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) \
+- ../libnettle.a @IF_HOGWEED@ ../libhogweed.a
++ ../libnettle.la @IF_HOGWEED@ ../libhogweed.la
+
+ check: $(TS_ALL) $(srcdir)/run-tests
+ LD_LIBRARY_PATH=../.lib srcdir="$(srcdir)" \
diff --git a/security/nettle/patches/patch-tools_Makefile.in b/security/nettle/patches/patch-tools_Makefile.in
new file mode 100644
index 00000000000..d376f197100
--- /dev/null
+++ b/security/nettle/patches/patch-tools_Makefile.in
@@ -0,0 +1,37 @@
+$NetBSD: patch-tools_Makefile.in,v 1.1.1.1 2011/04/26 08:59:33 adam Exp $
+
+Use LIBTOOL.
+
+--- tools/Makefile.in.orig 2010-07-25 19:30:14.000000000 +0000
++++ tools/Makefile.in
+@@ -32,15 +32,15 @@ SOURCES = $(sexp_conv_SOURCES) nettle-lf
+ DISTFILES = $(SOURCES) Makefile.in getopt.h input.h misc.h output.h parse.h
+
+ sexp_conv_OBJS = $(sexp_conv_SOURCES:.c=.$(OBJEXT))
+-sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.a
+- $(LINK) $(sexp_conv_OBJS) -lnettle $(LIBS) -o $@
++sexp-conv$(EXEEXT): $(sexp_conv_OBJS) ../libnettle.la
++ $(LINK) $(sexp_conv_OBJS) ../libnettle.la $(LIBS) -o $@
+
+-nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.a
+- $(LINK) nettle-lfib-stream.$(OBJEXT) -lnettle $(LIBS) -o $@
++nettle-lfib-stream$(EXEEXT): nettle-lfib-stream.$(OBJEXT) ../libnettle.la
++ $(LINK) nettle-lfib-stream.$(OBJEXT) ../libnettle.la $(LIBS) -o $@
+
+ pkcs1_conv_OBJS = $(pkcs1_conv_SOURCES:.c=.$(OBJEXT))
+-pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.a ../libhogweed.a
+- $(LINK) $(pkcs1_conv_OBJS) -lhogweed -lnettle $(LIBS) -o $@
++pkcs1-conv$(EXEEXT): $(pkcs1_conv_OBJS) ../libnettle.la ../libhogweed.la
++ $(LINK) $(pkcs1_conv_OBJS) ../libhogweed.la ../libnettle.la $(LIBS) -o $@
+
+ .c.$(OBJEXT):
+ $(COMPILE) -c $< && $(DEP_PROCESS)
+@@ -55,7 +55,7 @@ check:
+ install: $(TARGETS)
+ $(MKDIR_P) $(DESTDIR)$(bindir)
+ for f in $(TARGETS) ; do \
+- $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir) ; \
++ ${LIBTOOL} --mode=install $(INSTALL_PROGRAM) $$f $(DESTDIR)$(bindir) ; \
+ done
+
+ uninstall: