nixpkgs/pkgs/tools/system/awstats/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.5 KiB
Nix
Raw Normal View History

2023-01-25 08:44:17 +00:00
{ lib
, fetchurl
, perlPackages
, jdk
}:
perlPackages.buildPerlPackage rec {
pname = "awstats";
version = "7.9";
src = fetchurl {
url = "mirror://sourceforge/awstats/${pname}-${version}.tar.gz";
sha256 = "sha256-YVF47TE9NDFfFaUi2xpdEsqcOV43hbsGKAq/+V2aBUY=";
};
postPatch = ''
substituteInPlace wwwroot/cgi-bin/awstats.pl \
--replace /usr/share/awstats/ "$out/wwwroot/cgi-bin/"
'';
outputs = [ "bin" "out" "doc" ]; # bin just links the user-run executable
2023-01-25 08:44:17 +00:00
propagatedBuildOutputs = [ ]; # otherwise out propagates bin -> cycle
buildInputs = with perlPackages; [ ]; # plugins will need some
preConfigure = ''
touch Makefile.PL
patchShebangs .
'';
# build our own JAR
preBuild = ''
(
cd wwwroot/classes/src
rm ../*.jar
PATH="${jdk}/bin" "$(type -P perl)" Makefile.pl
test -f ../*.jar
)
'';
doCheck = false;
installPhase = ''
mkdir "$out"
mv wwwroot "$out/wwwroot"
rm -r "$out/wwwroot/classes/src/"
2018-01-29 17:05:31 +00:00
mkdir -p "$out/share/awstats"
mv tools "$out/share/awstats/tools"
mkdir -p "$bin/bin"
ln -s "$out/wwwroot/cgi-bin/awstats.pl" "$bin/bin/awstats"
2017-07-10 11:42:39 +00:00
mkdir -p "$doc/share/doc"
mv README.md docs/
2017-07-10 11:42:39 +00:00
mv docs "$doc/share/doc/awstats"
'';
meta = with lib; {
2023-01-25 08:44:17 +00:00
changelog = "https://www.awstats.org/docs/awstats_changelog.txt";
description = "Real-time logfile analyzer to get advanced statistics";
homepage = "https://awstats.org";
license = licenses.gpl3Plus;
platforms = platforms.unix;
};
}