Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | require lirc.inc |
| 2 | |
| 3 | SRC_URI += " \ |
| 4 | file://lircd.service \ |
| 5 | file://lircd.init \ |
| 6 | file://lircexec.init \ |
| 7 | file://lircd.conf \ |
| 8 | file://lirc_options.conf \ |
| 9 | file://lirc.tmpfiles \ |
| 10 | " |
| 11 | #file://0001-Adaptation-for-STM-configuration.patch \ |
| 12 | # |
| 13 | SRC_URI[md5sum] = "3afc84e79c0839823cc20e7a710dd06d" |
| 14 | SRC_URI[sha256sum] = "4e3f948fcdee6dce009171143f0cb7cd7be48593dd58138db4101a41f651a1dd" |
| 15 | |
| 16 | SYSTEMD_PACKAGES = "lirc" |
| 17 | SYSTEMD_SERVICE_${PN} = "lircd.service lircmd.service" |
| 18 | SYSTEMD_AUTO_ENABLE_lirc = "enable" |
| 19 | |
| 20 | inherit autotools pkgconfig systemd pythonnative |
| 21 | |
| 22 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd" |
| 23 | PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11," |
| 24 | |
| 25 | PACKAGECONFIG ?= " \ |
| 26 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \ |
| 27 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \ |
| 28 | " |
| 29 | |
| 30 | #EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"' |
| 31 | do_install_append() { |
| 32 | install -m 0755 -d ${D}${sysconfdir} |
| 33 | install -m 0755 -d ${D}${sysconfdir}/lirc |
| 34 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 35 | install -m 0755 -d ${D}${libdir}/tmpfiles.d |
| 36 | install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/ |
| 37 | install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/ |
| 38 | install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/ |
| 39 | install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/ |
| 40 | install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf |
| 41 | rm -rf ${D}${libdir}/lirc/plugins/*.la |
| 42 | rmdir ${D}/var/run/lirc ${D}/var/run |
| 43 | } |
| 44 | |
| 45 | PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python" |
| 46 | |
| 47 | RDEPENDS_${PN} = "bash" |
| 48 | RDEPENDS_${PN}-exec = "${PN}" |
| 49 | RDEPENDS_${PN}-python = "python" |
| 50 | |
| 51 | RRECOMMENDS_lirc = "${PN}-exec ${PN}-plugins" |
| 52 | |
| 53 | FILES_${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs" |
| 54 | FILES_${PN}-contrib = "${datadir}/lirc/contrib" |
| 55 | FILES_${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec" |
| 56 | FILES_${PN} += "${systemd_unitdir}/system/lircexec.init" |
| 57 | FILES_${PN} += "${systemd_unitdir}/system/lircd.service" |
| 58 | FILES_${PN} += "${systemd_unitdir}/system/lircd.socket" |
| 59 | FILES_${PN} += "${libdir}/tmpfiles.d/lirc.conf" |
| 60 | FILES_${PN}-dbg += "${libdir}/lirc/plugins/.debug" |
| 61 | FILES_${PN}-python += "${libdir}/python*/site-packages" |
| 62 | |
| 63 | |
| 64 | INITSCRIPT_PACKAGES = "lirc lirc-exec" |
| 65 | INITSCRIPT_NAME_lirc-exec = "lircexec" |
| 66 | INITSCRIPT_PARAMS_lirc-exec = "defaults 21" |
| 67 | |
| 68 | # this is for distributions that don't use udev |
| 69 | pkg_postinst_${PN}_append() { |
| 70 | if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi |
| 71 | } |