flashrom-0.9.6.1.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils toolchain-funcs
  5. if [[ ${PV} == "9999" ]] ; then
  6. ESVN_REPO_URI="svn://flashrom.org/flashrom/trunk"
  7. inherit subversion
  8. else
  9. SRC_URI="http://download.flashrom.org/releases/${P}.tar.bz2"
  10. KEYWORDS="amd64 arm x86"
  11. fi
  12. DESCRIPTION="Utility for reading, writing, erasing and verifying flash ROM chips"
  13. HOMEPAGE="http://flashrom.org/"
  14. LICENSE="GPL-2"
  15. SLOT="0"
  16. IUSE="atahpt +bitbang_spi +buspirate_spi +dediprog doc +drkaiser
  17. +dummy ft2232_spi +gfxnvidia +internal +nic3com +nicintel +nicintel_spi
  18. nicnatsemi nicrealtek +ogp_spi rayer_spi
  19. +pony_spi +satasii satamv +serprog +wiki"
  20. COMMON_DEPEND="atahpt? ( sys-apps/pciutils )
  21. dediprog? ( virtual/libusb:0 )
  22. drkaiser? ( sys-apps/pciutils )
  23. ft2232_spi? ( dev-embedded/libftdi:0 )
  24. gfxnvidia? ( sys-apps/pciutils )
  25. internal? ( sys-apps/pciutils )
  26. nic3com? ( sys-apps/pciutils )
  27. nicintel? ( sys-apps/pciutils )
  28. nicintel_spi? ( sys-apps/pciutils )
  29. nicnatsemi? ( sys-apps/pciutils )
  30. nicrealtek? ( sys-apps/pciutils )
  31. rayer_spi? ( sys-apps/pciutils )
  32. satasii? ( sys-apps/pciutils )
  33. satamv? ( sys-apps/pciutils )
  34. ogp_spi? ( sys-apps/pciutils )"
  35. RDEPEND="${COMMON_DEPEND}
  36. internal? ( sys-apps/dmidecode )"
  37. DEPEND="${COMMON_DEPEND}
  38. sys-apps/diffutils"
  39. _flashrom_enable() {
  40. local c="CONFIG_${2:-$(echo $1 | tr [:lower:] [:upper:])}"
  41. args+=" $c=$(usex $1 yes no)"
  42. }
  43. flashrom_enable() {
  44. local u
  45. for u in "$@" ; do _flashrom_enable $u ; done
  46. }
  47. src_compile() {
  48. local progs=0
  49. local args=""
  50. # Programmer
  51. flashrom_enable \
  52. atahpt bitbang_spi buspirate_spi dediprog drkaiser \
  53. ft2232_spi gfxnvidia nic3com nicintel nicintel_spi nicnatsemi nicrealtek \
  54. ogp_spi rayer_spi pony_spi \
  55. satasii satamv serprog \
  56. internal dummy
  57. _flashrom_enable wiki PRINT_WIKI
  58. # You have to specify at least one programmer, and if you specify more than
  59. # one programmer you have to include either dummy or internal in the list.
  60. for prog in ${IUSE//[+-]} ; do
  61. case ${prog} in
  62. internal|dummy|wiki) continue ;;
  63. esac
  64. use ${prog} && : $(( progs++ ))
  65. done
  66. if [ $progs -ne 1 ] ; then
  67. if ! use internal && ! use dummy ; then
  68. ewarn "You have to specify at least one programmer, and if you specify"
  69. ewarn "more than one programmer, you have to enable either dummy or"
  70. ewarn "internal as well. 'internal' will be the default now."
  71. args+=" CONFIG_INTERNAL=yes"
  72. fi
  73. fi
  74. # WARNERROR=no, bug 347879
  75. tc-export AR CC RANLIB
  76. emake WARNERROR=no ${args} || die
  77. }
  78. src_install() {
  79. dosbin flashrom || die
  80. doman flashrom.8
  81. dodoc ChangeLog README
  82. if use doc; then
  83. dodoc Documentation/*.txt
  84. fi
  85. }