summary refs log tree commit diff
path: root/pkgs/tools/security
diff options
context:
space:
mode:
authorThomas Strobel <ts468@cam.ac.uk>2014-10-14 00:48:23 +0200
committerThomas Strobel <ts468@cam.ac.uk>2014-10-14 09:03:50 +0200
commitd206122ade6ddf6c3a4836e6d57f46c6c898fa9c (patch)
tree5702bed2b21dad371e17be156c08d5e9cde4bb3e /pkgs/tools/security
parente17781f8b1a10e40f4ec110e01610c8afaae4c38 (diff)
downloadnixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar.gz
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar.bz2
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar.lz
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar.xz
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.tar.zst
nixpkgs-d206122ade6ddf6c3a4836e6d57f46c6c898fa9c.zip
Add package: opencryptoki
Make tpm-tools depend on opencryptoki as well.
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r--pkgs/tools/security/opencryptoki/default.nix38
-rw-r--r--pkgs/tools/security/tpm-tools/default.nix4
2 files changed, 40 insertions, 2 deletions
diff --git a/pkgs/tools/security/opencryptoki/default.nix b/pkgs/tools/security/opencryptoki/default.nix
new file mode 100644
index 00000000000..9ea9c2f4892
--- /dev/null
+++ b/pkgs/tools/security/opencryptoki/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, openssl, trousers, automake, autoconf, libtool, bison, flex }:
+
+stdenv.mkDerivation rec {
+  version = "3.2";
+  name = "opencryptoki-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/opencryptoki/opencryptoki/v${version}/opencryptoki-v${version}.tgz";
+    sha256 = "06r6zp299vxdspl6k65myzgjv0bihg7kc500v7s4jd3mcrkngd6h";
+  };
+
+  buildInputs = [ automake autoconf libtool openssl trousers bison flex ];
+
+  preConfigure = ''
+    substituteInPlace configure.in --replace "chown" "true"
+    substituteInPlace configure.in --replace "chgrp" "true"
+    sh bootstrap.sh --prefix=$out
+  '';
+
+  configureFlags = [ "--disable-ccatok" "--disable-icatok" ];
+
+  makeFlags = "DESTDIR=$(out)";
+
+  # work around the build script of opencryptoki
+  postInstall = ''
+    cp -r $out/$out/* $out
+    rm -r $out/nix
+    '';
+
+  meta = with stdenv.lib; {
+    description = "PKCS#11 implementation for Linux";
+    homepage    = http://opencryptoki.sourceforge.net/;
+    license     = licenses.cpl10;
+    maintainers = [ maintainers.tstrobel ];
+    platforms   = platforms.unix;
+  };
+}
+
diff --git a/pkgs/tools/security/tpm-tools/default.nix b/pkgs/tools/security/tpm-tools/default.nix
index 6e7ff75a6a4..a17bff9e32c 100644
--- a/pkgs/tools/security/tpm-tools/default.nix
+++ b/pkgs/tools/security/tpm-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, trousers, openssl }:
+{ stdenv, fetchurl, trousers, openssl, opencryptoki }:
 
 let
   version = "1.3.8";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "10za1gi89vi9m2lmm7jfzs281h55x1sbbm2bdgdh692ljpq4zsv6";
   };
 
-  buildInputs = [ trousers openssl ];
+  buildInputs = [ trousers openssl opencryptoki ];
 
   meta = with stdenv.lib; {
     description = "Management tools for TPM hardware";