sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / sys-apps / hwinfo / hwinfo-21.4.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit multilib rpm toolchain-funcs
7
8 DESCRIPTION="hardware detection tool used in SuSE Linux"
9 HOMEPAGE="https://www.opensuse.org/"
10 SRC_URI="http://download.opensuse.org/source/factory/repo/oss/suse/src/${P}-1.1.src.rpm"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 ~arm ppc x86 ~amd64-linux ~x86-linux"
15 IUSE=""
16
17 RDEPEND="
18         amd64? ( dev-libs/libx86emu )
19         x86? ( dev-libs/libx86emu )"
20 DEPEND="${RDEPEND}
21         sys-devel/flex
22         >=sys-kernel/linux-headers-2.6.17"
23
24 MAKEOPTS="${MAKEOPTS} -j1"
25
26 src_prepare() {
27         # Respect AR variable.
28         sed -i \
29                 -e 's:ar r:$(AR) r:' \
30                 src/{,isdn,ids,smp,hd}/Makefile || die
31
32         # Avoid -I directories for dbus because HAL is obsolete.
33         sed -i -e '/CFLAGS/d' src/hd/Makefile || die
34         # Respect LDFLAGS.
35         sed -i -e 's:$(CC) -shared:& $(LDFLAGS):' src/Makefile || die
36         sed -i -e 's:$(CC) $(CFLAGS):$(CC) $(LDFLAGS) $(CFLAGS):' src/ids/Makefile || die
37
38         # Use linux/pci.h directly. #506876
39         sed -i \
40                 -e '/#include.*sys\/pci.h/s:sys/pci.h:linux/pci.h:' \
41                 src/hd/*.c || die
42
43         # Respect MAKE variable. Skip forced -pipe and -g. Respect LDFLAGS.
44         sed -i \
45                 -e 's:make:$(MAKE):' \
46                 -e 's:-pipe -g::' \
47                 -e 's:LDFLAGS.*=:LDFLAGS +=:' \
48                 Makefile{,.common} || die
49 }
50
51 src_compile() {
52         tc-export AR
53         emake CC="$(tc-getCC)" RPM_OPT_FLAGS="${CFLAGS}"
54 }
55
56 src_install() {
57         emake DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" install
58
59         dodoc changelog README
60         doman doc/*.{1,8}
61         insinto /usr/share/doc/${PF}/examples
62         doins doc/example*.c
63 }