<commit_before>{ stdenv, fetchurl, makeWrapper
, perl, perlPackages, libassuan, libgcrypt
}:

stdenv.mkDerivation rec {
  name = "monkeysphere-${version}";
  version = "0.41";

  src = fetchurl {
    url = "http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monkeysphere/monkeysphere_${version}.orig.tar.gz";
    sha256 = "0jz7kwkwgylqprnl8bwvl084s5gjrilza77ln18i3f6x48b2y6li";
  };

  buildInputs = [ makeWrapper perl libassuan libgcrypt ];

  patches = [ ./monkeysphere.patch ];

  makeFlags = ''
    PREFIX=/
    DESTDIR=$(out)
  '';

  postInstall = ''
    wrapProgram $out/bin/openpgp2ssh --prefix PERL5LIB : \
      "${with perlPackages; stdenv.lib.makePerlPath [
        CryptOpenSSLRSA
        CryptOpenSSLBignum
      ]}"
    wrapProgram $out/bin/monkeysphere --prefix PERL5LIB :\
      "${with perlPackages; stdenv.lib.makePerlPath [
        CryptOpenSSLRSA
        CryptOpenSSLBignum
      ]}"
  '';

  meta = with stdenv.lib; {
    homepage = http://web.monkeysphere.info/;
    description = "Leverage the OpenPGP web of trust for SSH and TLS authentication";
    longDescription = ''
      The Monkeysphere project's goal is to extend OpenPGP's web of
      trust to new areas of the Internet to help us securely identify
      servers we connect to, as well as each other while we work online.
      The suite of Monkeysphere utilities provides a framework to
      transparently leverage the web of trust for authentication of
      TLS/SSL communications through the normal use of tools you are
      familiar with, such as your web browser0 or secure shell.
    '';
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = with maintainers; [ primeos ];
  };
}<commit_msg>monkeysphere: Wrap all relevant programs<commit_after>{ stdenv, fetchurl, makeWrapper
, perl, libassuan, libgcrypt
, perlPackages, lockfileProgs, gnupg
}:

stdenv.mkDerivation rec {
  name = "monkeysphere-${version}";
  version = "0.41";

  src = fetchurl {
    url = "http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monkeysphere/monkeysphere_${version}.orig.tar.gz";
    sha256 = "0jz7kwkwgylqprnl8bwvl084s5gjrilza77ln18i3f6x48b2y6li";
  };

  patches = [ ./monkeysphere.patch ];

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ perl libassuan libgcrypt ];

  makeFlags = ''
    PREFIX=/
    DESTDIR=$(out)
  '';

  postFixup =
    let wrapMonkeysphere = runtimeDeps: program:
          "wrapProgram $out/bin/${program} --prefix PERL5LIB : "
            + (with perlPackages; stdenv.lib.makePerlPath [
                CryptOpenSSLRSA
                CryptOpenSSLBignum
              ])
            + stdenv.lib.optionalString
                (builtins.length runtimeDeps > 0)
                " --prefix PATH : ${stdenv.lib.makeBinPath runtimeDeps}"
            + "\n";
        wrapPrograms = runtimeDeps: programs: stdenv.lib.concatMapStrings
          (wrapMonkeysphere runtimeDeps)
          programs;
    in wrapPrograms [ gnupg ] [ "monkeysphere-authentication" "monkeysphere-host" ]
      + wrapPrograms [ ] [ "../share/monkeysphere/keytrans" "openpgp2ssh" ]
      + wrapPrograms [ lockfileProgs ] [ "monkeysphere" ];

  meta = with stdenv.lib; {
    homepage = http://web.monkeysphere.info/;
    description = "Leverage the OpenPGP web of trust for SSH and TLS authentication";
    longDescription = ''
      The Monkeysphere project's goal is to extend OpenPGP's web of
      trust to new areas of the Internet to help us securely identify
      servers we connect to, as well as each other while we work online.
      The suite of Monkeysphere utilities provides a framework to
      transparently leverage the web of trust for authentication of
      TLS/SSL communications through the normal use of tools you are
      familiar with, such as your web browser0 or secure shell.
    '';
    license = licenses.gpl3Plus;
    platforms = platforms.all;
    maintainers = with maintainers; [ primeos ];
  };
}
{'fraction_non_alphanumeric': 0.09497347815104824, 'fraction_numerical': 0.01414498610760293, 'mean_word_length': 2.96, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2225423', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1264, 'n_words': 325}