testdisk-7.0-r3.ebuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. AUTOTOOLS_AUTORECONF=1
  5. inherit autotools-utils eutils flag-o-matic
  6. DESCRIPTION="Checks and undeletes partitions + PhotoRec, signature based recovery tool"
  7. HOMEPAGE="http://www.cgsecurity.org/wiki/TestDisk"
  8. SRC_URI="http://www.cgsecurity.org/${P}.tar.bz2"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 ~arm ~hppa ppc x86"
  12. IUSE="ewf jpeg ntfs reiserfs static qt4"
  13. REQUIRED_USE="static? ( !qt4 )"
  14. # WARNING: reiserfs support does NOT work with reiserfsprogs
  15. # you MUST use progsreiserfs-0.3.1_rc8 (the last version ever released).
  16. DEPEND="
  17. static? (
  18. sys-apps/util-linux[static-libs]
  19. >=sys-libs/ncurses-5.2[static-libs]
  20. jpeg? ( virtual/jpeg:0[static-libs] )
  21. ntfs? ( sys-fs/ntfs3g[static-libs] )
  22. reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8[static-libs] )
  23. >=sys-fs/e2fsprogs-1.35[static-libs]
  24. sys-libs/zlib[static-libs]
  25. !arm? ( ewf? ( app-forensics/libewf:=[static-libs] ) )
  26. )
  27. !static? (
  28. sys-apps/util-linux
  29. >=sys-libs/ncurses-5.2
  30. jpeg? ( virtual/jpeg:0 )
  31. ntfs? ( sys-fs/ntfs3g )
  32. reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8 )
  33. >=sys-fs/e2fsprogs-1.35
  34. sys-libs/zlib
  35. !arm? ( ewf? ( app-forensics/libewf:= ) )
  36. qt4? ( dev-qt/qtgui:4 )
  37. )"
  38. RDEPEND="!static? ( ${DEPEND} )"
  39. AUTOTOOLS_IN_SOURCE_BUILD=1
  40. DOCS=( )
  41. src_configure() {
  42. local myconf
  43. # this is static method is the same used by upstream for their 'static' make
  44. # target, but better, as it doesn't break.
  45. use static && append-ldflags -static
  46. # --with-foo are broken, any use of --with/--without disable the
  47. # functionality.
  48. # The following variation must be used.
  49. use reiserfs || myconf+=" --without-reiserfs"
  50. use ntfs || myconf+=" --without-ntfs --without-ntfs3g"
  51. use jpeg || myconf+=" --without-jpeg"
  52. use ewf || myconf+=" --without-ewf"
  53. myconf+=$(usex qt4 " --enable-qt" " --disable-qt")
  54. econf \
  55. --docdir "${ROOT}/usr/share/doc/${P}" \
  56. --enable-sudo \
  57. ${myconf}
  58. # perform safety checks for NTFS, REISERFS and JPEG
  59. if use ntfs && ! egrep -q '^#define HAVE_LIBNTFS(3G)? 1$' "${S}"/config.h ; then
  60. die "Failed to find either NTFS or NTFS-3G library."
  61. fi
  62. if use reiserfs && egrep -q 'undef HAVE_LIBREISERFS\>' "${S}"/config.h ; then
  63. die "Failed to find reiserfs library."
  64. fi
  65. if use jpeg && egrep -q 'undef HAVE_LIBJPEG\>' "${S}"/config.h ; then
  66. die "Failed to find jpeg library."
  67. fi
  68. }