2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchurl, perlPackages, jdk }:
|
2016-03-09 18:50:58 +00:00
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
2019-06-20 14:07:56 +01:00
|
|
|
pname = "awstats";
|
2021-04-17 15:37:29 +01:00
|
|
|
version = "7.8";
|
2016-03-09 18:50:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-06-20 14:07:56 +01:00
|
|
|
url = "mirror://sourceforge/awstats/${pname}-${version}.tar.gz";
|
2021-04-17 15:37:29 +01:00
|
|
|
sha256 = "1f6l0hd01jmz7hpg0py8qixxiq50n8gl37iypayskxmy05z8craa";
|
2016-03-09 18:50:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace wwwroot/cgi-bin/awstats.pl \
|
|
|
|
--replace /usr/share/awstats/ "$out/wwwroot/cgi-bin/"
|
|
|
|
'';
|
|
|
|
|
2016-08-29 01:30:01 +01:00
|
|
|
outputs = [ "bin" "out" "doc" ]; # bin just links the user-run executable
|
2016-04-26 10:15:28 +01:00
|
|
|
propagatedBuildOutputs = [ ]; # otherwise out propagates bin -> cycle
|
2016-03-09 18:50:58 +00:00
|
|
|
|
|
|
|
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"
|
|
|
|
|
2016-03-09 18:50:58 +00:00
|
|
|
mkdir -p "$bin/bin"
|
|
|
|
ln -s "$out/wwwroot/cgi-bin/awstats.pl" "$bin/bin/awstats"
|
|
|
|
|
2017-07-10 12:42:39 +01:00
|
|
|
mkdir -p "$doc/share/doc"
|
2016-03-09 18:50:58 +00:00
|
|
|
mv README.md docs/
|
2017-07-10 12:42:39 +01:00
|
|
|
mv docs "$doc/share/doc/awstats"
|
2016-03-09 18:50:58 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-03-09 18:50:58 +00:00
|
|
|
description = "Real-time logfile analyzer to get advanced statistics";
|
2021-04-17 15:37:29 +01:00
|
|
|
homepage = "https://awstats.org";
|
2016-03-09 18:50:58 +00:00
|
|
|
license = licenses.gpl3Plus;
|
2019-02-17 13:00:33 +00:00
|
|
|
platforms = platforms.unix;
|
2016-03-09 18:50:58 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|