summaryrefslogtreecommitdiffstats
path: root/pkgs/tools
diff options
context:
space:
mode:
authorJoachim Schiele <js@lastlog.de>2017-03-03 17:38:33 +0100
committerGitHub <noreply@github.com>2017-03-03 17:38:33 +0100
commitd6b0c87bda75b0b8ccc6b8591767e5774847c48b (patch)
tree46a1c487ab8635c0cf5301355052071e1c35be7f /pkgs/tools
parent6c99a31c89caae36aca6658cf236c118d9a5de95 (diff)
tlspool: init at 20170123 (#23437)
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/networking/tlspool/configvar-fix.patch36
-rw-r--r--pkgs/tools/networking/tlspool/default.nix60
-rw-r--r--pkgs/tools/networking/tlspool/fixing-rpath.patch36
3 files changed, 132 insertions, 0 deletions
diff --git a/pkgs/tools/networking/tlspool/configvar-fix.patch b/pkgs/tools/networking/tlspool/configvar-fix.patch
new file mode 100644
index 000000000000..424fef20dcfd
--- /dev/null
+++ b/pkgs/tools/networking/tlspool/configvar-fix.patch
@@ -0,0 +1,36 @@
+From 8561789ba70ae5d741992b143ee288b8e11a5e2b Mon Sep 17 00:00:00 2001
+From: joachim schiele <js@lastlog.de>
+Date: Wed, 1 Mar 2017 15:15:22 +0100
+Subject: [PATCH] fix to
+ https://github.com/arpa2/tlspool/issues/58#issuecomment-283333738
+
+---
+ tool/Makefile | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/tool/Makefile b/tool/Makefile
+index 9a15012..0f655e9 100644
+--- a/tool/Makefile
++++ b/tool/Makefile
+@@ -38,7 +38,6 @@ pgp11genkey_LIBS = $(P11KIT_LIBS) -lcrypto
+
+ configvar_CFLAGS = $(tlspool_CFLAGS)
+ configvar_LDFLAGS = $(tlspool_LDFLAGS)
+-configvar_LIBS = $(tlspool_LIBS)
+
+ P11KIT_CFLAGS = $(shell pkg-config --cflags p11-kit-1)
+ P11KIT_LIBS = $(shell pkg-config --libs p11-kit-1)
+@@ -96,8 +95,8 @@ have_db: have_db.c
+ pgp11_genkey: pgp11_genkey.c
+ gcc -std=gnu11 $(CFLAGS) $(pgp11genkey_CFLAGS) -o "$@" "$<" $(pgp11genkey_LIBS)
+
+-configvar: configvar.c $(configvar_LIBS)
+- gcc -std=gnu11 $(CFLAGS) $(configvar_CFLAGS) $(configvar_LDFLAGS) $(configvar_CFLAGS) -o "$@" "$<" $(configvar_LIBS)
++configvar: configvar.c
++ gcc -std=gnu11 $(CFLAGS) $(configvar_CFLAGS) $(configvar_LDFLAGS) $(configvar_CFLAGS) -o "$@" "$<"
+
+ $(tlspool_LIBS):
+ $(MAKE) -C ../lib `basename $(tlspool_LIBS)`
+--
+2.12.0
+
diff --git a/pkgs/tools/networking/tlspool/default.nix b/pkgs/tools/networking/tlspool/default.nix
new file mode 100644
index 000000000000..2a43358a5e1a
--- /dev/null
+++ b/pkgs/tools/networking/tlspool/default.nix
@@ -0,0 +1,60 @@
+{ pkgs, stdenv, fetchFromGitHub, unzip, libtool, pkgconfig, git, p11_kit,
+ libtasn1, db, openldap, libmemcached, cyrus_sasl, openssl, softhsm, bash,
+ python, libkrb5, quickder, unbound, ldns, gnupg, gnutls-kdh,
+ useSystemd ? true, systemd, swig
+}:
+
+let
+ pname = "tlspool";
+ version = "20170123";
+in
+
+stdenv.mkDerivation rec {
+ name = "${pname}-${version}";
+ src = fetchFromGitHub {
+ owner = "arpa2";
+ repo = "tlspool";
+ rev = "90cfa0758b02849114ba6373f280a4f2d3e534bf";
+ sha256 = "1qyq6da5bsgb8y9f3jhfrnhbvjns4k80lpkrydkvfx83bg494370";
+ };
+
+ propagatedBuildInputs = [ python softhsm openldap p11_kit.dev p11_kit.out gnupg ];
+ buildInputs = [ unbound pkgconfig unzip git libtasn1 db libmemcached cyrus_sasl openssl bash quickder
+ libkrb5 ldns libtool swig pkgs.pythonPackages.pip gnutls-kdh ]
+ ++ stdenv.lib.optional useSystemd systemd;
+
+ phases = [ "unpackPhase" "patchPhase" "postPatchPhase" "buildPhase" "installPhase" ];
+
+ patches = [ ./fixing-rpath.patch ./configvar-fix.patch ];
+
+ postPatchPhase = ''
+ substituteInPlace etc/tlspool.conf \
+ --replace "dnssec_rootkey ../etc/root.key" "dnssec_rootkey $out/etc/root.key" \
+ --replace "pkcs11_path /usr/local/lib/softhsm/libsofthsm2.so" "pkcs11_path ${softhsm}/lib/softhsm/libsofthsm2.so"
+ substituteInPlace lib/Makefile \
+ --replace "DESTDIR=\$(DESTDIR) PREFIX=\$(PREFIX)" "DESTDIR=\$(DESTDIR) PREFIX=\$(PREFIX) SWIG=${swig}/bin/swig"
+ '';
+
+ buildPhase = ''
+ make clean
+ make DESTDIR=$out PREFIX=/ all
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin $out/lib $out/sbin $out/man $out/etc/tlspool/ $out/include/${pname}/pulleyback
+ mkdir -p $out/${python.sitePackages}/tlspool
+ mkdir -p $out/bdb
+ make DESTDIR=$out PREFIX=/ install
+ cp -R etc/* $out/etc/tlspool/
+ cp include/tlspool/*.h $out/include/${pname}
+ cp pulleyback/*.h $out/include/${pname}/pulleyback/
+ cp src/*.h $out/include/${pname}
+ '';
+
+ meta = with stdenv.lib; {
+ description = "A supercharged TLS daemon that allows for easy, strong and consistent deployment";
+ license = licenses.bsd2;
+ homepage = https://www.tlspool.org;
+ maintainers = with maintainers; [ leenaars qknight ];
+ };
+}
diff --git a/pkgs/tools/networking/tlspool/fixing-rpath.patch b/pkgs/tools/networking/tlspool/fixing-rpath.patch
new file mode 100644
index 000000000000..6a434f3e4008
--- /dev/null
+++ b/pkgs/tools/networking/tlspool/fixing-rpath.patch
@@ -0,0 +1,36 @@
+From 8082f050794f771d1afb8e5c3d08862fc633922b Mon Sep 17 00:00:00 2001
+From: joachim schiele <js@lastlog.de>
+Date: Wed, 1 Mar 2017 13:12:19 +0100
+Subject: [PATCH] RPATH is back
+ https://github.com/arpa2/tlspool/issues/58#issuecomment-283318767
+
+---
+ tool/Makefile | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/tool/Makefile b/tool/Makefile
+index c1e6ce9..9a15012 100644
+--- a/tool/Makefile
++++ b/tool/Makefile
+@@ -18,9 +18,17 @@ LIBS =
+
+ PREFIX = /usr/local
+
++DIR := ${CURDIR}
++LIBDIR := ""
++ifndef DESTDIR
++ LIBDIR=$(DIR)/../lib/
++else
++ LIBDIR=$(DESTDIR)/lib
++endif
++
+ tlspool_CFLAGS =
+ tlspool_LIBS = ../lib/libtlspool.so
+-tlspool_LDFLAGS = -L ../lib -ltlspool
++tlspool_LDFLAGS = -L ../lib -ltlspool -Wl,-rpath,$(LIBDIR)
+
+ donai_CFLAGS = -DDONAI_ONLY_TEXTPROC
+ donai_SRC = ../src/donai.c
+--
+2.11.1
+