gddrescue: add ddrescue a data recovery tool 5909/head
authorLucian Cristian <lucian.cristian@gmail.com>
Fri, 13 Apr 2018 00:48:40 +0000 (03:48 +0300)
committerLucian Cristian <lucian.cristian@gmail.com>
Thu, 28 Mar 2019 22:12:50 +0000 (00:12 +0200)
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
utils/gddrescue/Makefile [new file with mode: 0644]
utils/gddrescue/patches/001-fix_uclibc.patch [new file with mode: 0644]

diff --git a/utils/gddrescue/Makefile b/utils/gddrescue/Makefile
new file mode 100644 (file)
index 0000000..230a1fe
--- /dev/null
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2018 Lucian Cristian
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gddrescue
+PKG_VERSION:=1.23
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.xz
+PKG_SOURCE_URL:=http://http.debian.net/debian/pool/main/g/$(PKG_NAME)
+PKG_HASH:=5831d7e24070bc700d8f22deaeec56af1149392ce30ae67254096eaf8c9169ab
+PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gddrescue
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Data recovery tool
+  URL:=https://www.gnu.org/software/ddrescue/
+  DEPENDS:=$(CXX_DEPENDS)
+endef
+
+define Package/gddrescue/description
+       GNU ddrescue is a data recovery tool. It copies data from one file
+       or block device (hard disc, cdrom, etc) to another, trying to rescue
+       the good parts first in case of read errors.
+endef
+
+CONFIGURE_ARGS += \
+       CXX="$(TARGET_CXX)" \
+       CPPFLAGS="$(TARGET_CPPFLAGS)" \
+       CXXFLAGS="$(TARGET_CXXFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)"
+
+define Package/gddrescue/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ddrescue $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ddrescuelog $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,gddrescue))
diff --git a/utils/gddrescue/patches/001-fix_uclibc.patch b/utils/gddrescue/patches/001-fix_uclibc.patch
new file mode 100644 (file)
index 0000000..05113a8
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/block.h
++++ b/block.h
+@@ -34,6 +34,7 @@ class Block
+     { if( size_ < 0 || size_ > LLONG_MAX - pos_ ) size_ = LLONG_MAX - pos_; }
+ public:
++  Block() {}          // default constructor
+   Block( const long long p, const long long s ) : pos_( p ), size_( s )
+     { if( p < 0 ) { pos_ = 0; if( s > 0 ) size_ -= std::min( s, -p ); }
+       fix_size(); }
+@@ -102,6 +103,7 @@ private:
+   Status status_;
+ public:
++  Sblock() {}                         // default constructor
+   Sblock( const Block & b, const Status st )
+     : Block( b ), status_( st ) {}
+   Sblock( const long long p, const long long s, const Status st )
+--- a/mapbook.cc
++++ b/mapbook.cc
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cerrno>
++#include <cctype>
+ #include <climits>
+ #include <cstdio>
+ #include <cstdlib>
\ No newline at end of file