Merge commit 'origin/opendreambox-1.6' into vuplus-1.6
[vuplus_openembedded] / recipes / lirc / lirc-modules_0.8.1.bb
1 DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls. This package contains the lirc kernel modules."
2 SECTION = "base"
3 PRIORITY = "optional"
4 HOMEPAGE = "http://www.lirc.org"
5 LICENSE = "GPL"
6 DEPENDS = "virtual/kernel fakeroot-native setserial"
7 RDEPENDS_nslu2 = "setserial"
8 PR = "r0"
9
10 SRC_URI = "${SOURCEFORGE_MIRROR}/lirc/lirc-${PV}.tar.gz"
11 S = "${WORKDIR}/lirc-${PV}"
12
13 inherit autotools module
14
15 require lirc-config.inc
16
17 MAKE_TARGETS = "KERNEL_PATH=${STAGING_KERNEL_DIR} MAKE='make -e' -C drivers"
18
19 fakeroot do_install() {
20         oe_runmake -C drivers DESTDIR="${D}" moduledir="/lib/modules/${KERNEL_VERSION}/lirc" install
21         rm -rf ${D}/dev
22 }
23
24 # nslu2 uses udev, so /dev/lirc0 will be created automatically
25 # and /dev/lirc will be created by /etc/udev/rules.d/lirc.rules
26 # (that's the kernel-2.6+udev solution)
27 do_install_append_nslu2() {
28         install -d ${D}${sysconfdir}/modutils/
29         echo 'lirc_serial' > ${D}${sysconfdir}/modutils/lirc_serial
30         install -d ${D}${sysconfdir}/modprobe.d/
31         echo 'install lirc_serial /bin/setserial /dev/ttyS1 uart none; /sbin/leds ready on; /sbin/modprobe --ignore-install lirc_serial' >${D}${sysconfdir}/modprobe.d/lirc_serial
32         install -d ${D}${sysconfdir}/udev/rules.d/
33         echo 'KERNEL="lirc0", SYMLINK="lirc"' > ${D}${sysconfdir}/udev/rules.d/lirc.rules
34 }
35
36 # this is for distributions that don't use udev
37 pkg_postinst_append() {
38 if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
39 }
40
41 FILES_${PN} = "/lib/modules"
42 FILES_${PN}_append_nslu2 = " ${sysconfdir}/modutils ${sysconfdir}/modprobe.d ${sysconfdir}/udev/rules.d"