summaryrefslogtreecommitdiffstats
path: root/meta/packages/exmap-console/exmap-console.inc
blob: 6744aed49fb6d4d02fc20da3e6e5edaae566ddf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
DESCRIPTION = "Console based version of exmap, a memory usage analysis tool"
HOMEPAGE = "http://projects.o-hand.com/exmap-console"
SECTION = "devel"
LICENSE = "GPL"
DEPENDS = "virtual/kernel readline"

SRC_URI = "http://projects.o-hand.com/sources/exmap-console/exmap-console-${PV}.tgz"

TEMPPACKAGE_ARCH := "${PACKAGE_ARCH}"

inherit module-base
inherit autotools

MYPV := "${PV}"
PACKAGE_ARCH = "${TEMPPACKAGE_ARCH}"

PACKAGES =+ "exmap-server kernel-module-exmap"

FILES_exmap-console = "${bindir}/exmap ${bindir}/exmapd"
RDEPENDS_exmap-console += "kernel-module-exmap"

FILES_exmap-server = "${bindir}/exmapserver"
RDEPENDS_exmap-server += "kernel-module-exmap"

FILES_kernel-module-exmap = "${base_libdir}"
PACKAGE_ARCH_kernel-module-exmap = "${MACHINE_ARCH}"
PV_kernel-module-exmap = "${MYPV}-${KERNEL_VERSION}"
RDEPENDS_kernel-module-exmap += "update-modules kernel-image-${KERNEL_VERSION}"

S = "${WORKDIR}/exmap-console-${PV}"

export MODULE_PATH="${D}${base_libdir}/modules/${KERNEL_VERSION}"

do_compile() {
	cd ${S}/src
	make

	cd ${S}/kernel
	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
	oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR}   \
		   KERNEL_SRC=${STAGING_KERNEL_DIR}    \
		   KERNEL_VERSION=${KERNEL_VERSION}    \
		   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
		   ${MAKE_TARGETS}
}

do_install() {
	oe_runmake 'DESTDIR=${D}' 'DEPMOD=/bin/true' install
}

pkg_postinst_append_kernel-module-exmap () {
	if [ -n "$D" ]; then
		exit 1
	fi
	depmod -a
	update-modules || true
}

pkg_postrm_append_kernel-module-exmap () {
	update-modules || true
}