<commit_before>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "lsof-${version}";
  version = "4.89";

  src = fetchurl {
    urls = map (
      # the tarball is moved after new version is released
      isOld: "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/"
      + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2"
    ) [ false true ];
    sha256 = "061p18v0mhzq517791xkjs8a5dfynq1418a1mwxpji69zp2jzb41";
  };

  unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
  
  preBuild = "sed -i Makefile -e 's/^CFGF=/&	-DHASIPv6=1/;';";
  
  configurePhase = if stdenv.isDarwin
    then "./Configure -n darwin;"
    else "./Configure -n linux;";
  
  installPhase = ''
    mkdir -p $out/bin $out/man/man8
    cp lsof.8 $out/man/man8/
    cp lsof $out/bin
  '';

  meta = {<commit_msg>add working lsof mirror<commit_after>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "lsof-${version}";
  version = "4.89";

  src = fetchurl {
    urls =
      ["ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${version}.tar.bz2"]
      ++ map (
        # the tarball is moved after new version is released
        isOld: "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/"
        + "${stdenv.lib.optionalString isOld "OLD/"}lsof_${version}.tar.bz2"
      ) [ false true ];
    sha256 = "061p18v0mhzq517791xkjs8a5dfynq1418a1mwxpji69zp2jzb41";
  };

  unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
  
  preBuild = "sed -i Makefile -e 's/^CFGF=/&	-DHASIPv6=1/;';";
  
  configurePhase = if stdenv.isDarwin
    then "./Configure -n darwin;"
    else "./Configure -n linux;";
  
  installPhase = ''
    mkdir -p $out/bin $out/man/man8
    cp lsof.8 $out/man/man8/
    cp lsof $out/bin
  '';

  meta = {
{'fraction_non_alphanumeric': 0.16444444444444445, 'fraction_numerical': 0.04055555555555555, 'mean_word_length': 2.783613445378151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2130437', 'n_tokens_mistral': 814, 'n_tokens_neox': 763, 'n_words': 150}