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