about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/http/apache-modules/mod_perl/default.nix
blob: c0a9e11a6ce577bb24e894427b4fd866ba3d8434 (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
52
53
54
55
56
57
58
{
  apacheHttpd,
  directoryListingUpdater,
  fetchurl,
  lib,
  nixosTests,
  perl,
  stdenv,
}:

stdenv.mkDerivation rec {
  pname = "mod_perl";
  version = "2.0.13";

  src = fetchurl {
    url = "mirror://apache/perl/${pname}-${version}.tar.gz";
    sha256 = "sha256-reO+McRHuESIaf7N/KziWNbVh7jGx3PF8ic19w2C1to=";
  };

  buildInputs = [
    apacheHttpd
    perl
  ];

  buildPhase = ''
    perl Makefile.PL \
      MP_APXS=${apacheHttpd.dev}/bin/apxs
    make
  '';

  installPhase = ''
    mkdir -p $out
    make install DESTDIR=$out
    mv $out${apacheHttpd}/* $out
    mv $out${apacheHttpd.dev}/* $out
    mv $out${perl}/* $out
    rm $out/nix -rf
  '';

  passthru = {
    updateScript = directoryListingUpdater {
      url = "https://archive.apache.org/dist/perl/";
    };
    tests = nixosTests.mod_perl;
  };

  __darwinAllowLocalNetworking = true;

  meta = with lib; {
    description = "Integration of perl with the Apache2 web server";
    homepage = "https://perl.apache.org/download/index.html";
    changelog = "https://github.com/apache/mod_perl/blob/trunk/Changes";
    license = licenses.asl20;
    mainProgram = "mp2bug";
    maintainers = with maintainers; [ ];
    platforms = platforms.unix;
  };
}