at 23.11-beta 64 lines 1.7 kB view raw
1{ fetchurl, lib, stdenv, makeWrapper, perl, perlPackages }: 2 3stdenv.mkDerivation rec { 4 pname = "dirvish"; 5 version = "1.2.1"; 6 7 src = fetchurl { 8 url = "http://dirvish.org/dirvish${version}.tgz"; 9 sha256 = "6b7f29c3541448db3d317607bda3eb9bac9fb3c51f970611ffe27e9d63507dcd"; 10 }; 11 12 nativeBuildInputs = [ makeWrapper ]; 13 buildInputs = [ perl ] ++ (with perlPackages; [ GetoptLong TimeParseDate TimePeriod ]); 14 15 executables = [ "dirvish" "dirvish-runall" "dirvish-expire" "dirvish-locate" ]; 16 manpages = [ "dirvish.8" "dirvish-runall.8" "dirvish-expire.8" "dirvish-locate.8" "dirvish.conf.5" ]; 17 18 buildPhase = '' 19 HEADER="#!${perl}/bin/perl 20 21 \$CONFDIR = \"/etc/dirvish\"; 22 23 " 24 25 for executable in $executables; do 26 ( 27 echo "$HEADER" 28 cat $executable.pl loadconfig.pl 29 ) > $executable 30 chmod +x $executable 31 done 32 ''; 33 34 installPhase = '' 35 mkdir -p $out/bin 36 cp --target-directory=$out/bin $executables 37 38 for manpage in $manpages; do 39 if [[ $manpage =~ \.([[:digit:]]+)$ ]]; then 40 section=''${BASH_REMATCH[1]} 41 mkdir -p $out/man/man$section 42 cp --target-directory=$out/man/man$section $manpage 43 else 44 echo "Couldn't determine man page section by filename" 45 exit 1 46 fi 47 done 48 ''; 49 50 postFixup = '' 51 for executable in $executables; do 52 wrapProgram $out/bin/$executable \ 53 --set PERL5LIB "$PERL5LIB" 54 done 55 ''; 56 57 meta = with lib; { 58 description = "Fast, disk based, rotating network backup system"; 59 homepage = "http://dirvish.org/"; 60 license = lib.licenses.osl2; 61 platforms = platforms.linux; 62 maintainers = [ maintainers.winpat ]; 63 }; 64}