diff --git a/pkgs/servers/sabnzbd/builder.sh b/pkgs/servers/sabnzbd/builder.sh new file mode 100644 index 00000000000..9613d24d67d --- /dev/null +++ b/pkgs/servers/sabnzbd/builder.sh @@ -0,0 +1,16 @@ +source $stdenv/setup + +tar xvfz $src +mv SABnzbd-* $out + +-- Create a start script and let wrapProgram with toPythonPath wrap it so that python is started with cheetahTemplate in its importpath (classpath) +mkdir $out/bin +echo "$python/bin/python $out/SABnzbd.py" > $out/bin/sabnzbd.sh +chmod +x $out/bin/sabnzbd.sh + +for i in $(cd $out/bin && ls); do + wrapProgram $out/bin/$i \ + --prefix PYTHONPATH : "$(toPythonPath $python):$(toPythonPath $out):$(toPythonPath $cheetahTemplate)" +done + +echo $out diff --git a/pkgs/servers/sabnzbd/default.nix b/pkgs/servers/sabnzbd/default.nix new file mode 100644 index 00000000000..9c2d947a461 --- /dev/null +++ b/pkgs/servers/sabnzbd/default.nix @@ -0,0 +1,19 @@ +{stdenv, fetchurl, python, cheetahTemplate, makeWrapper}: + +stdenv.mkDerivation { + name = "sabnzbd-0.4.12"; + + src = fetchurl { + url = http://mesh.dl.sourceforge.net/project/sabnzbdplus/sabnzbdplus/sabnzbd-0.4.12/SABnzbd-0.4.12-src.tar.gz; + sha256 = "35ce4172688925ef608fba433ff676357dab7d2abdc1cf83112a1c99682fdd32"; + }; + + buildInputs = [makeWrapper python cheetahTemplate]; + inherit stdenv python cheetahTemplate; + + builder = ./builder.sh; + + meta = { + description = "Usenet NZB downloader, par2 repairer and auto extracting server."; + }; +}