2015-04-18 20:51:40 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ruby, zfs }:
|
2014-01-21 18:47:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "zfstools-${version}";
|
|
|
|
|
2015-04-18 20:51:40 +01:00
|
|
|
version = "0.3.2";
|
2014-01-21 18:47:04 +00:00
|
|
|
|
2015-04-18 20:51:40 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
sha256 = "1dzfir9413qrmx9kqpndi3l2m09f6l1wspnwn84lm3n1g9cr46nd";
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2015-04-18 20:51:40 +01:00
|
|
|
inherit version;
|
2014-01-21 18:47:04 +00:00
|
|
|
homepage = https://github.com/bdrewery/zfstools;
|
|
|
|
description = "OpenSolaris-like and compatible auto snapshotting script for ZFS";
|
|
|
|
longDescription = ''
|
|
|
|
zfstools is an OpenSolaris-like and compatible auto snapshotting script
|
|
|
|
for ZFS, which also supports auto snapshotting mysql databases.
|
|
|
|
'';
|
|
|
|
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
|
|
|
};
|
|
|
|
}
|