2018-12-15 03:50:31 +00:00
|
|
|
{ fetchurl, stdenv, makeWrapper, perlPackages }:
|
2010-01-24 19:07:16 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "swec-0.4";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2016-05-04 11:08:35 +01:00
|
|
|
url = "http://files.zerodogg.org/swec/${name}.tar.bz2";
|
2010-01-24 19:07:16 +00:00
|
|
|
sha256 = "1m3971z4z1wr0paggprfz0n8ng8vsnkc9m6s3bdplgyz7qjk6jwx";
|
|
|
|
};
|
|
|
|
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ makeWrapper perlPackages.perl perlPackages.LWP perlPackages.URI perlPackages.HTMLParser ];
|
|
|
|
checkInputs = [ perlPackages.HTTPServerSimple perlPackages.Parent ];
|
2010-01-24 19:07:16 +00:00
|
|
|
|
2016-05-04 11:08:35 +01:00
|
|
|
configurePhase = ''
|
|
|
|
for i in swec tests/{runTests,testServer}
|
|
|
|
do
|
2018-12-15 03:50:31 +00:00
|
|
|
sed -i "$i" -e's|/usr/bin/perl|${perlPackages.perl}/bin/perl|g'
|
2016-05-04 11:08:35 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make install prefix="$out"
|
|
|
|
|
|
|
|
mkdir -p "$out/share/${name}"
|
|
|
|
cp -v default.sdf "$out/share/${name}"
|
|
|
|
sed -i "$out/bin/swec" -e"s|realpath(\$0)|'$out/share/${name}/swec'|g"
|
|
|
|
|
|
|
|
wrapProgram "$out/bin/swec" \
|
2018-12-15 03:50:31 +00:00
|
|
|
--prefix PERL5LIB : ${with perlPackages; makePerlPath [ LWP URI HTMLParser ]}
|
2016-05-04 11:08:35 +01:00
|
|
|
'';
|
2010-01-24 19:07:16 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = "make test";
|
|
|
|
|
|
|
|
meta = {
|
2018-01-05 19:42:46 +00:00
|
|
|
homepage = https://random.zerodogg.org/swec/;
|
2010-01-24 19:07:16 +00:00
|
|
|
|
|
|
|
description = "Simple Web Error Checker (SWEC)";
|
|
|
|
|
|
|
|
longDescription =
|
|
|
|
'' SWEC (Simple Web Error Checker) is a program that automates testing
|
|
|
|
of dynamic websites. It parses each HTML file it finds for links,
|
|
|
|
and if those links are within the site specified (ie. local, not
|
|
|
|
external), it will check that page as well. In this respect it
|
|
|
|
works a lot like a crawler, in that it'll click on any link it finds
|
|
|
|
(more notes about this later).
|
|
|
|
|
|
|
|
In addition to parsing and locating links, it will also parse the
|
|
|
|
pages looking for known errors and report those (such as Mason or
|
|
|
|
PHP errors), and will report if a page can not be read (by either
|
|
|
|
returning a 404, 500 or similar).
|
|
|
|
|
|
|
|
Since you may often want SWEC to be logged in on your site, you have
|
|
|
|
to be careful. When logged in, SWEC will still click on all links
|
|
|
|
it finds, including things like 'join group' or 'delete account'
|
|
|
|
(though it has some magic trying to avoid the latter). Therefore it
|
|
|
|
is highly recommended that when you run SWEC as a logged-in user on
|
|
|
|
a site, use a test server, not the live one.
|
|
|
|
|
|
|
|
Running SWEC on a live site without being logged in as a user is
|
|
|
|
perfectly fine, it won't do anything a normal crawler wouldn't do
|
|
|
|
(well, not exactly true, SWEC will ignore robots.txt).
|
|
|
|
'';
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2010-01-24 19:07:16 +00:00
|
|
|
|
2013-08-16 22:44:33 +01:00
|
|
|
maintainers = [ ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2010-01-24 19:07:16 +00:00
|
|
|
};
|
|
|
|
}
|