From 87a579dd537575abeb668f9eed98f0f00f7f39d2 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Thu, 16 May 2013 11:41:58 +0200 Subject: [PATCH] partclone, partimage. both are used by clonezilla and drbl (which I haven't packaged yet) --- pkgs/tools/backup/partclone/default.nix | 26 +++++++++++++++ pkgs/tools/backup/partimage/default.nix | 29 ++++++++++++++++ .../tools/backup/partimage/gentoos-zlib.patch | 33 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 4 files changed, 92 insertions(+) create mode 100644 pkgs/tools/backup/partclone/default.nix create mode 100644 pkgs/tools/backup/partimage/default.nix create mode 100644 pkgs/tools/backup/partimage/gentoos-zlib.patch diff --git a/pkgs/tools/backup/partclone/default.nix b/pkgs/tools/backup/partclone/default.nix new file mode 100644 index 000000000000..b446b06f987c --- /dev/null +++ b/pkgs/tools/backup/partclone/default.nix @@ -0,0 +1,26 @@ +{stdenv, fetchurl +, pkgconfig, libuuid +, e2fsprogs +}: +stdenv.mkDerivation { + name = "partclone-stable"; + enableParallelBuilding = true; + + src = fetchurl { + url = https://codeload.github.com/Thomas-Tsai/partclone/legacy.tar.gz/stable; + sha256 = "0vvk6c26gf2wv5y0mxnz90bivgp84pi82qk5q5xkcz6nz3swals7"; + name = "Thomas-Tsai-partclone-stable-0-gab3bd53.tar.gz"; + }; + + buildInputs = [e2fsprogs pkgconfig libuuid]; + + installPhase = ''make INSTPREFIX=$out install''; + + meta = { + description = "Partclone provides utilities to save and restore used blocks on a partition and is designed for higher compatibility of the file system by using existing libraries, e.g. e2fslibs is used to read and write the ext2 partition"; + homepage = http://partclone.org; + license = stdenv.lib.licenses.gpl2; + maintainers = [stdenv.lib.maintainers.marcweber]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/tools/backup/partimage/default.nix b/pkgs/tools/backup/partimage/default.nix new file mode 100644 index 000000000000..d06ef2c83662 --- /dev/null +++ b/pkgs/tools/backup/partimage/default.nix @@ -0,0 +1,29 @@ +{stdenv, fetchurl, bzip2, zlib, newt, openssl, pkgconfig, slang +, automake, autoconf, libtool, gettext +}: +stdenv.mkDerivation { + name = "partimage-0.6.9"; + enableParallelBuilding = true; + + src = fetchurl { + url = http://sourceforge.net/projects/partimage/files/stable/0.6.9/partimage-0.6.9.tar.bz2; + sha256 = "0db6xiphk6xnlpbxraiy31c5xzj0ql6k4rfkmqzh665yyj0nqfkm"; + }; + configureFlags = "--with-ssl-headers=${openssl}/include/openssl"; + + buildInputs = [bzip2 zlib newt newt openssl pkgconfig slang + # automake autoconf libtool gettext + ]; + + patches = [ + ./gentoos-zlib.patch + ]; + + meta = { + description = "opensource disk backup software"; + homepage = http://www.partimage.org; + license = stdenv.lib.licenses.gpl2; + maintainers = [stdenv.lib.maintainers.marcweber]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/tools/backup/partimage/gentoos-zlib.patch b/pkgs/tools/backup/partimage/gentoos-zlib.patch new file mode 100644 index 000000000000..05150e131e36 --- /dev/null +++ b/pkgs/tools/backup/partimage/gentoos-zlib.patch @@ -0,0 +1,33 @@ +http://bugs.gentoo.org/405323 + +--- a/src/client/imagefile.cpp ++++ b/src/client/imagefile.cpp +@@ -783,7 +783,7 @@ + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression + { + showDebug(1, "open gzip\n"); +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h"); ++ m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h"); + if (m_gzImageFile == NULL) + { + showDebug(1, "error:%d %s\n", errno, strerror(errno)); +@@ -1098,7 +1098,7 @@ + } + else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression + { +- m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb"); ++ m_gzImageFile = gzdopen(m_nFdImage, "rb"); + if (m_gzImageFile == NULL) + THROW(ERR_ERRNO, errno); + else +--- a/src/client/imagefile.h ++++ b/src/client/imagefile.h +@@ -41,7 +41,7 @@ + COptions m_options; + + FILE *m_fImageFile; +- gzFile *m_gzImageFile; ++ gzFile m_gzImageFile; + BZFILE *m_bzImageFile; + + int m_nFdImage; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4e519a8e9123..337c83080e03 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -956,6 +956,10 @@ let gzip = callPackage ../tools/compression/gzip { }; + partclone = callPackage ../tools/backup/partclone { }; + + partimage = callPackage ../tools/backup/partimage { }; + pigz = callPackage ../tools/compression/pigz { }; haproxy = callPackage ../tools/networking/haproxy { };