Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55488 from winpat/add_dirvish
dirvish: init at 1.2.1
- Loading branch information
Showing
5 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ fetchurl, stdenv, makeWrapper, perl, rsync, perlPackages }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "dirvish-1.2.1"; | ||
src = fetchurl { | ||
url = "http://dirvish.org/${name}.tgz"; | ||
sha256 = "6b7f29c3541448db3d317607bda3eb9bac9fb3c51f970611ffe27e9d63507dcd"; | ||
}; | ||
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
buildInputs = [ perl ] ++ (with perlPackages; [ GetoptLong TimeParseDate TimePeriod ]); | ||
|
||
executables = [ "dirvish" "dirvish-runall" "dirvish-expire" "dirvish-locate" ]; | ||
manpages = [ "dirvish.8" "dirvish-runall.8" "dirvish-expire.8" "dirvish-locate.8" "dirvish.conf.5" ]; | ||
|
||
buildPhase = '' | ||
HEADER="#!${perl}/bin/perl | ||
\$CONFDIR = \"/etc/dirvish\"; | ||
" | ||
for executable in $executables; do | ||
( | ||
echo "$HEADER" | ||
cat $executable.pl loadconfig.pl | ||
) > $executable | ||
chmod +x $executable | ||
done | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp --target-directory=$out/bin $executables | ||
for manpage in $manpages; do | ||
if [[ $manpage =~ \.([[:digit:]]+)$ ]]; then | ||
section=''${BASH_REMATCH[1]} | ||
mkdir -p $out/man/man$section | ||
cp --target-directory=$out/man/man$section $manpage | ||
else | ||
echo "Couldn't determine man page section by filename" | ||
exit 1 | ||
fi | ||
done | ||
''; | ||
|
||
postFixup = '' | ||
for executable in $executables; do | ||
wrapProgram $out/bin/$executable \ | ||
--set PERL5LIB "$PERL5LIB" | ||
done | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Dirvish is a fast, disk based, rotating network backup system"; | ||
homepage = http://dirvish.org/; | ||
license = stdenv.lib.licenses.osl2; | ||
platforms = platforms.linux; | ||
maintainers = [ maintainers.winpat ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters