lshw-02.17b.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  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 "${FILESDIR}"/${P}-gentoo.patch
  27. # correct gettext behavior
  28. if [[ -n "${LINGUAS+x}" ]] ; then
  29. local langs
  30. for i in $(cd src/po ; echo *.po | sed 's/\.po//') ; do
  31. if has ${i} ${LINGUAS} ; then
  32. langs+=" ${i}"
  33. fi
  34. done
  35. sed -i \
  36. -e "/^LANGUAGES =/ s/=.*/= $langs/" \
  37. src/po/Makefile || die
  38. fi
  39. }
  40. src_compile() {
  41. tc-export CC CXX AR
  42. use static && append-ldflags -static
  43. local sqlite=$(usex sqlite 1 0)
  44. emake SQLITE=$sqlite all
  45. if use gtk ; then
  46. emake SQLITE=$sqlite gui
  47. fi
  48. }
  49. src_install() {
  50. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
  51. dodoc README docs/*
  52. if use gtk ; then
  53. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install-gui
  54. make_desktop_entry /usr/sbin/gtk-lshw "Hardware Lister" "/usr/share/lshw/artwork/logo.svg"
  55. fi
  56. }