2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2005-06-23 06:48:02 +02:00
|
|
|
#
|
|
|
|
# acpid
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2013-06-06 01:53:25 +02:00
|
|
|
|
2018-08-07 22:20:36 +02:00
|
|
|
ACPID_VERSION = 2.0.30
|
2014-04-22 23:25:33 +02:00
|
|
|
ACPID_SOURCE = acpid-$(ACPID_VERSION).tar.xz
|
|
|
|
ACPID_SITE = http://downloads.sourceforge.net/project/acpid2
|
2017-03-30 15:43:32 +02:00
|
|
|
ACPID_LICENSE = GPL-2.0+
|
2012-11-30 01:14:36 +01:00
|
|
|
ACPID_LICENSE_FILES = COPYING
|
2010-09-26 09:13:52 +02:00
|
|
|
|
2018-11-13 21:17:28 +01:00
|
|
|
define ACPID_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 0755 package/acpid/acpid.service \
|
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/acpid.service
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
|
|
|
|
ln -sf ../../../../usr/lib/systemd/system/acpid.service \
|
|
|
|
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/acpid.service
|
|
|
|
endef
|
|
|
|
|
2014-04-22 23:25:33 +02:00
|
|
|
define ACPID_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -D -m 0755 package/acpid/S02acpid \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S02acpid
|
2010-09-26 09:13:52 +02:00
|
|
|
endef
|
|
|
|
|
2018-08-30 15:21:20 +02:00
|
|
|
ifeq ($(BR2_INIT_SYSV)$(BR2_INIT_SYSTEMD),y)
|
|
|
|
ACPID_POWEROFF_CMD = /sbin/shutdown -hP now
|
|
|
|
else
|
|
|
|
ACPID_POWEROFF_CMD = /sbin/poweroff
|
|
|
|
endif
|
|
|
|
|
2014-04-22 23:25:33 +02:00
|
|
|
define ACPID_SET_EVENTS
|
2005-06-23 06:48:02 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/etc/acpi/events
|
2018-08-30 15:21:20 +02:00
|
|
|
printf 'event=button[ /]power\naction=%s\n' '$(ACPID_POWEROFF_CMD)' \
|
2014-04-22 23:25:33 +02:00
|
|
|
>$(TARGET_DIR)/etc/acpi/events/powerbtn
|
2010-09-26 09:13:52 +02:00
|
|
|
endef
|
2005-06-23 06:48:02 +02:00
|
|
|
|
2014-04-22 23:25:33 +02:00
|
|
|
ACPID_POST_INSTALL_TARGET_HOOKS += ACPID_SET_EVENTS
|
|
|
|
|
|
|
|
$(eval $(autotools-package))
|