dd-rescue-1.99.5.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit toolchain-funcs flag-o-matic multilib autotools
  5. MY_PN=${PN/-/_}
  6. MY_P=${MY_PN}-${PV}
  7. DESCRIPTION="Similar to dd but can copy from source with errors"
  8. HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
  9. SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.bz2"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
  13. IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
  14. RDEPEND="lzo? ( dev-libs/lzo )
  15. xattr? ( sys-apps/attr )"
  16. DEPEND="${RDEPEND}"
  17. S="${WORKDIR}/${MY_P}"
  18. src_prepare() {
  19. epatch "${FILESDIR}/${MY_PN}-1.99-test_fix.patch"
  20. epatch "${FILESDIR}/${MY_PN}-1.99-musl.patch"
  21. sed -i \
  22. -e 's:-ldl:$(LDFLAGS) -ldl:' \
  23. -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \
  24. Makefile
  25. eautoreconf
  26. }
  27. src_configure() {
  28. use static && append-ldflags -static
  29. # OpenSSL is only used by a random helper tool we don't install.
  30. ac_cv_header_attr_xattr_h=$(usex xattr) \
  31. ac_cv_header_openssl_evp_h=no \
  32. ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
  33. econf
  34. }
  35. _emake() {
  36. local arch
  37. case ${ARCH} in
  38. x86) arch=i386;;
  39. amd64) arch=x86_64;;
  40. arm) arch=arm;;
  41. arm64) arch=aarch64;;
  42. esac
  43. local os=$(usex kernel_linux Linux IDK)
  44. # The Makefile is a mess. Override a few vars rather than patch it.
  45. emake \
  46. MACH="${arch}" \
  47. OS="${os}" \
  48. HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
  49. HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
  50. RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
  51. CFLAGS_OPT='$(CFLAGS)' \
  52. LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/${PN}" \
  53. CC="$(tc-getCC)" \
  54. "$@"
  55. }
  56. src_compile() {
  57. _emake
  58. }
  59. src_test() {
  60. _emake check
  61. }
  62. src_install() {
  63. # easier to install by hand than trying to make sense of the Makefile.
  64. dobin dd_rescue
  65. dodir /usr/$(get_libdir)/${PN}
  66. cp -pPR libddr_*.so "${ED}"/usr/$(get_libdir)/${PN}/ || die
  67. dodoc README.dd_rescue
  68. doman dd_rescue.1
  69. use lzo && doman ddr_lzo.1
  70. }