2015-04-18 19:51:40 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ruby, zfs }:
|
2014-01-21 18:47:04 +00:00
|
|
|
|
2015-09-15 06:50:46 +00:00
|
|
|
let version = "0.3.3"; in
|
2014-01-21 18:47:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "zfstools-${version}";
|
|
|
|
|
2015-04-18 19:51:40 +00:00
|
|
|
src = fetchFromGitHub {
|
2015-09-15 06:50:46 +00:00
|
|
|
sha256 = "1gj6jksc9crmjvhsx8yp3l06b5vcm415l0bmdjcil7jjbfhwwp2k";
|
2015-04-18 19:51:40 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
repo = "zfstools";
|
|
|
|
owner = "bdrewery";
|
2014-01-21 18:47:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ruby ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin/
|
|
|
|
|
|
|
|
cp -R lib $out/
|
|
|
|
|
|
|
|
for f in $out/bin/*; do
|
|
|
|
substituteInPlace $f --replace "/usr/bin/env ruby" "ruby -I$out/lib"
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -e 's|cmd.*=.*"zfs |cmd = "${zfs}/sbin/zfs |g' -i $out/lib/zfstools/{dataset,snapshot}.rb
|
|
|
|
'';
|
|
|
|
|
2015-09-15 06:50:46 +00:00
|
|
|
meta = with stdenv.lib; {
|
2015-04-18 19:51:40 +00:00
|
|
|
inherit version;
|
2015-09-15 06:50:46 +00:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
|
2014-01-21 18:47:04 +00:00
|
|
|
longDescription = ''
|
|
|
|
zfstools is an OpenSolaris-like and compatible auto snapshotting script
|
|
|
|
for ZFS, which also supports auto snapshotting mysql databases.
|
|
|
|
'';
|
2015-09-15 06:50:46 +00:00
|
|
|
license = licenses.bsd2;
|
2014-01-21 18:47:04 +00:00
|
|
|
};
|
|
|
|
}
|