2016-03-09 18:50:58 +00:00
|
|
|
{ stdenv, fetchurl, perlPackages, jdk }:
|
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
2019-06-20 14:07:56 +01:00
|
|
|
pname = "awstats";
|
2018-01-11 01:47:39 +00:00
|
|
|
version = "7.7";
|
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";
|
2018-01-11 01:47:39 +00:00
|
|
|
sha256 = "0z3p77jnpjilajs9yv87r8xla2x1gjqlvrhpbgbh5ih73386v3j2";
|
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
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Real-time logfile analyzer to get advanced statistics";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://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
|
|
|
};
|
|
|
|
}
|
|
|
|
|