about summary refs log tree commit diff
path: root/pkgs/development/python-modules/dkimpy/default.nix
blob: 177e697aab9f73a1b77b7d0cbe52d51b43be5bbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, fetchurl, openssl, makeWrapper, buildPythonApplication
, pytest, dnspython }:

buildPythonApplication rec {
  name = "${pname}-${version}";
  pname = "dkimpy";
  majorversion = "0.6";
  minorversion = "2";
  version = "${majorversion}.${minorversion}";

  src = fetchurl {
    url = "https://launchpad.net/${pname}/${majorversion}/${majorversion}.${minorversion}/+download/${name}.tar.gz";
    sha256 = "1hagz8qk0v4ijfbcdq4z28bpgr2mkpr498z76i1vam2d50chmakl";
  };

  buildInputs = [ pytest ];
  propagatedBuildInputs =  [ openssl dnspython ];

  patchPhase = ''
    substituteInPlace dknewkey.py --replace \
      /usr/bin/openssl ${openssl}/bin/openssl
  '';

  checkPhase = ''
    python ./test.py
  '';

  postInstall = ''
    mkdir -p $out/bin $out/libexec
    mv $out/bin/*.py $out/libexec
    makeWrapper "$out/libexec/dkimverify.py" $out/bin/dkimverify
    makeWrapper "$out/libexec/dkimsign.py" $out/bin/dkimsign
    makeWrapper "$out/libexec/arcverify.py" $out/bin/arcverify
    makeWrapper "$out/libexec/arcsign.py" $out/bin/arcsign
    makeWrapper "$out/libexec/dknewkey.py" $out/bin/dknewkey
  '';

  meta = with stdenv.lib; {
    description = "DKIM + ARC email signing/verification tools + Python module";
    longDescription = ''
      Python module that implements DKIM (DomainKeys Identified Mail) email
      signing and verification. It also provides a number of convєnient tools
      for command line signing and verification, as well as generating new DKIM
      records. This version also supports the experimental Authenticated
      Received Chain (ARC) protocol.
    '';
    homepage = https://launchpad.net/dkimpy;
    license = licenses.bsd3;
    maintainers = with maintainers; [ leenaars ];
  };
}