blob: 504176d6325254b7fd77688138a4dd1513e99063 [file] [log] [blame]
Andrew Geissler8fc454f2020-12-11 16:27:59 -06001SUMMARY = "Linux Console Project"
2DESCRIPTION = "This project maintains the Linux Console tools, which include \
3utilities to test and configure joysticks, connect legacy devices to the kernel's \
4input subsystem (providing support for serial mice, touchscreens etc.), and test \
5the input event layer."
6HOMEPAGE = "https://sourceforge.net/projects/linuxconsole"
7
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
10
Andrew Geissler72956ed2021-01-08 16:11:14 -060011DEPENDS = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
Andrew Geissler8fc454f2020-12-11 16:27:59 -060012
13SRC_URI = "\
14 ${SOURCEFORGE_MIRROR}/linuxconsole/linuxconsoletools-${PV}.tar.bz2 \
15 file://51-these-are-not-joysticks-rm.rules \
16 file://60-joystick.rules \
17 file://inputattachctl \
18 file://inputattach.service \
19"
20
21SRC_URI[sha256sum] = "95d112f06393806116341d593bda002c8bc44119c1538407623268fed90d8c34"
22
23S = "${WORKDIR}/linuxconsoletools-${PV}"
24
25inherit systemd pkgconfig
26
27EXTRA_OEMAKE = "DESTDIR=${D} PREFIX=${prefix} -C utils"
28EXTRA_OEMAKE += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'SYSTEMD_SUPPORT=1', '', d)}"
29
30SYSTEMD_PACKAGES += "inputattach"
Patrick Williams213cb262021-08-07 19:21:33 -050031SYSTEMD_SERVICE:inputattach = "inputattach.service"
32SYSTEMD_AUTO_ENABLE:inputattach = "enable"
Andrew Geissler8fc454f2020-12-11 16:27:59 -060033
Andrew Geissler72956ed2021-01-08 16:11:14 -060034PROVIDES += "joystick"
35
36PACKAGECONFIG ??= "sdl"
37PACKAGECONFIG[sdl] = ",,libsdl2"
38
Andrew Geissler8fc454f2020-12-11 16:27:59 -060039do_compile() {
Andrew Geissler72956ed2021-01-08 16:11:14 -060040 if ! ${@bb.utils.contains('PACKAGECONFIG', 'sdl', 'true', 'false', d)}; then
41 # drop ffmvforce so that we don't need libsdl2
42 sed '/^PROGRAMS/s/ffmvforce *//g' -i ${S}/utils/Makefile
43 fi
44 # respect nonarch_base_libdir path to keep QA check happy
45 sed 's#DESTDIR)/lib/udev#DESTDIR)/${nonarch_base_libdir}/udev#g' -i ${S}/utils/Makefile
Andrew Geissler8fc454f2020-12-11 16:27:59 -060046 oe_runmake
47}
48
49do_install() {
50 oe_runmake install
51
Andrew Geissler72956ed2021-01-08 16:11:14 -060052 install -Dm 0644 ${WORKDIR}/51-these-are-not-joysticks-rm.rules ${D}${nonarch_base_libdir}/udev/rules.d/51-these-are-not-joysticks-rm.rules
53 install -Dm 0644 ${WORKDIR}/60-joystick.rules ${D}${nonarch_base_libdir}/udev/rules.d/60-joystick.rules
Andrew Geissler8fc454f2020-12-11 16:27:59 -060054
55 install -Dm 0644 ${WORKDIR}/inputattach.service ${D}${systemd_system_unitdir}/inputattach.service
56 install -Dm 0755 ${WORKDIR}/inputattachctl ${D}${bindir}/inputattachctl
57}
58
Andrew Geissler72956ed2021-01-08 16:11:14 -060059PACKAGES += "inputattach joystick-jscal joystick"
Andrew Geissler8fc454f2020-12-11 16:27:59 -060060
61# We won't package any file here as we are following the same packaging schema
62# Debian does and we are splitting it in 'inputattach' and 'joystick' packages.
Patrick Williams213cb262021-08-07 19:21:33 -050063FILES:${PN} = ""
Andrew Geissler8fc454f2020-12-11 16:27:59 -060064
Patrick Williams213cb262021-08-07 19:21:33 -050065FILES:inputattach += "\
Andrew Geissler8fc454f2020-12-11 16:27:59 -060066 ${bindir}/inputattach \
67 ${bindir}/inputattachctl \
68 ${systemd_system_unitdir}/inputattach.service \
69"
70
Patrick Williams213cb262021-08-07 19:21:33 -050071FILES:joystick += "\
Andrew Geissler8fc454f2020-12-11 16:27:59 -060072 ${bindir}/evdev-joystick \
73 ${bindir}/ffcfstress \
74 ${bindir}/ffmvforce \
75 ${bindir}/ffset \
76 ${bindir}/fftest \
Andrew Geissler72956ed2021-01-08 16:11:14 -060077 ${bindir}/jstest \
78 ${nonarch_base_libdir}/udev/rules.d/51-these-are-not-joysticks-rm.rules \
79 ${nonarch_base_libdir}/udev/js-set-enum-leds \
80 ${nonarch_base_libdir}/udev/rules.d/60-joystick.rules \
81 ${nonarch_base_libdir}/udev/rules.d/80-stelladaptor-joystick.rules \
82"
83
Patrick Williams213cb262021-08-07 19:21:33 -050084FILES:joystick-jscal = " \
Andrew Geissler72956ed2021-01-08 16:11:14 -060085 ${datadir}/joystick \
Andrew Geissler8fc454f2020-12-11 16:27:59 -060086 ${bindir}/jscal \
87 ${bindir}/jscal-restore \
88 ${bindir}/jscal-store \
Andrew Geissler8fc454f2020-12-11 16:27:59 -060089"
90
Patrick Williams213cb262021-08-07 19:21:33 -050091RDEPENDS:inputattach += "inputattach-config"
Andrew Geissler8fc454f2020-12-11 16:27:59 -060092
Patrick Williams213cb262021-08-07 19:21:33 -050093RDEPENDS:joystick-jscal += "\
Andrew Geissler8fc454f2020-12-11 16:27:59 -060094 bash \
95 gawk \
96"