2016-03-09 18:50:58 +00:00
|
|
|
{ stdenv, fetchurl, perlPackages, jdk }:
|
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
|
|
|
name = "awstats-${version}";
|
2018-01-11 01:47:39 +00:00
|
|
|
version = "7.7";
|
2016-03-09 18:50:58 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/awstats/${name}.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";
|
|
|
|
homepage = http://awstats.org;
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|