lshw-02.17b-r1.ebuild 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit flag-o-matic eutils toolchain-funcs
  5. MAJ_PV=${PV:0:${#PV}-1}
  6. MIN_PVE=${PV:0-1}
  7. MIN_PV=${MIN_PVE/b/B}
  8. MY_P="$PN-$MIN_PV.$MAJ_PV"
  9. DESCRIPTION="Hardware Lister"
  10. HOMEPAGE="http://ezix.org/project/wiki/HardwareLiSter"
  11. SRC_URI="http://ezix.org/software/files/${MY_P}.tar.gz"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
  15. IUSE="gtk sqlite static"
  16. REQUIRED_USE="static? ( !gtk )"
  17. RDEPEND="gtk? ( x11-libs/gtk+:2 )
  18. sqlite? ( dev-db/sqlite:3 )"
  19. DEPEND="${RDEPEND}
  20. gtk? ( virtual/pkgconfig )
  21. sqlite? ( virtual/pkgconfig )"
  22. RDEPEND="${RDEPEND}
  23. sys-apps/hwids"
  24. S=${WORKDIR}/${MY_P}
  25. src_prepare() {
  26. epatch \
  27. "${FILESDIR}"/${P}-gentoo.patch \
  28. "${FILESDIR}"/${P}-fat.patch
  29. # correct gettext behavior
  30. if [[ -n "${LINGUAS+x}" ]] ; then
  31. local langs
  32. for i in $(cd src/po ; echo *.po | sed 's/\.po//') ; do
  33. if has ${i} ${LINGUAS} ; then
  34. langs+=" ${i}"
  35. fi
  36. done
  37. sed -i \
  38. -e "/^LANGUAGES =/ s/=.*/= $langs/" \
  39. src/po/Makefile || die
  40. fi
  41. }
  42. src_compile() {
  43. tc-export CC CXX AR
  44. use static && append-ldflags -static
  45. local sqlite=$(usex sqlite 1 0)
  46. emake SQLITE=$sqlite all
  47. if use gtk ; then
  48. emake SQLITE=$sqlite gui
  49. fi
  50. }
  51. src_install() {
  52. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
  53. dodoc README docs/*
  54. if use gtk ; then
  55. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install-gui
  56. make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
  57. fi
  58. }