avrdude: moved to github
[packages.git] / utils / acpid / Makefile
1 #
2 # Copyright (C) 2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=acpid
11 PKG_VERSION:=2.0.10
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://tedfelix.com/linux/
16 PKG_MD5SUM:=d5dd88bcfaa4a0bf51905e95115da6df
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/acpid
21   SECTION:=utils
22   CATEGORY:=Utilities
23   TITLE:=The ACPI Daemon (acpid) With Netlink Support
24   URL:=http://tedfelix.com/linux/acpid-netlink.html
25   DEPENDS:=+kmod-input-evdev +kmod-acpi-button
26 endef
27
28 define Package/acpid/description
29   The ACPI Daemon (acpid) With Netlink Support
30 endef
31
32 define Build/Compile
33         $(MAKE) -C $(PKG_BUILD_DIR) \
34                 CC="$(TARGET_CC)" \
35                 LD="$(TARGET_CC)" \
36                 LDFLAGS="$(TARGET_LDFLAGS)" \
37                 all
38 endef
39
40 define Package/acpid/install
41         $(INSTALL_DIR) $(1)/usr/sbin
42         $(INSTALL_BIN) $(PKG_BUILD_DIR)/acpid $(1)/usr/sbin/
43         $(INSTALL_BIN) $(PKG_BUILD_DIR)/acpi_listen $(1)/usr/sbin/
44         $(INSTALL_DIR) $(1)/etc/acpi/events
45         $(INSTALL_CONF) ./files/default $(1)/etc/acpi/events/default
46         $(INSTALL_DIR) $(1)/etc/init.d
47         $(INSTALL_CONF) ./files/acpid.init $(1)/etc/init.d/acpid
48         chmod 0750 $(1)/etc/init.d/acpid
49         $(INSTALL_DIR) $(1)/etc/hotplug.d/input/
50         $(INSTALL_CONF) ./files/acpid.hotplug $(1)/etc/hotplug.d/input/
51 endef
52
53 define Package/acpid/postinst
54 #!/bin/sh
55 [ -n "$${IPKG_INSTROOT}" ] || {
56         echo "waiting for input devices to come up"
57         /etc/init.d/acpid enable
58         sleep 5
59         /etc/init.d/acpid start
60         echo "please try the power button"
61         exit 0
62 }
63 endef
64
65 $(eval $(call BuildPackage,acpid))