blob: 9f74c486f10ec06af527fe24ccc21a2384d2e26b [file] [log] [blame]
Peter Korsgaard6e2b8092014-12-08 23:55:28 +01001################################################################################
2#
3# triggerhappy
4#
5################################################################################
6
Michael Heinemann3e23b1c2017-04-26 16:57:58 +02007TRIGGERHAPPY_VERSION = b822888066129350e51ad79f1cf307fa38dae4f7
Peter Korsgaard6e2b8092014-12-08 23:55:28 +01008TRIGGERHAPPY_SITE = $(call github,wertarbyte,triggerhappy,$(TRIGGERHAPPY_VERSION))
Rahul Bedarkar337aa512017-03-30 19:13:33 +05309TRIGGERHAPPY_LICENSE = GPL-3.0+
Peter Korsgaard6e2b8092014-12-08 23:55:28 +010010TRIGGERHAPPY_LICENSE_FILES = COPYING
11
12define TRIGGERHAPPY_BUILD_CMDS
Jörg Krausecc9304a2016-01-19 10:51:53 +010013 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) thd th-cmd
Peter Korsgaard6e2b8092014-12-08 23:55:28 +010014endef
15
16ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
17define TRIGGERHAPPY_INSTALL_UDEV_RULE
18 $(INSTALL) -D -m 0644 $(@D)/udev/triggerhappy-udev.rules \
19 $(TARGET_DIR)/lib/udev/rules.d/triggerhappy.rules
20endef
21endif
22
23define TRIGGERHAPPY_INSTALL_TARGET_CMDS
24 $(INSTALL) -d $(TARGET_DIR)/etc/triggerhappy/triggers.d
25 $(INSTALL) -D -m 0755 $(@D)/thd $(TARGET_DIR)/usr/sbin/thd
26 $(INSTALL) -D -m 0755 $(@D)/th-cmd $(TARGET_DIR)/usr/sbin/th-cmd
27 $(TRIGGERHAPPY_INSTALL_UDEV_RULE)
28endef
29
30define TRIGGERHAPPY_INSTALL_INIT_SYSV
31 $(INSTALL) -m 0755 -D package/triggerhappy/S10triggerhappy \
32 $(TARGET_DIR)/etc/init.d/S10triggerhappy
33endef
34
Alex Suykov7ee5eb92015-05-23 13:14:07 +030035define TRIGGERHAPPY_INSTALL_INIT_SYSTEMD
36 $(INSTALL) -D -m 644 package/triggerhappy/triggerhappy.service \
37 $(TARGET_DIR)/usr/lib/systemd/system/triggerhappy.service
38 mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
39 ln -sf ../../../../usr/lib/systemd/system/triggerhappy.service \
40 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/triggerhappy.service
41endef
42
Peter Korsgaard6e2b8092014-12-08 23:55:28 +010043$(eval $(generic-package))