packages: add missing conffiles define
[openwrt/svn-archive/archive.git] / net / apcupsd / Makefile
1 #
2 # Copyright (C) 2006-2011 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:=apcupsd
11 PKG_VERSION:=3.14.7
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/apcupsd
16 PKG_MD5SUM:=bb2f8e4fc6b2f5d7b3e236eb57b81640
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/apcupsd
21 SECTION:=utils
22 CATEGORY:=Utilities
23 DEPENDS:=+libpthread +libusb
24 TITLE:=UPS control software
25 URL:=http://www.apcupsd.org/
26 endef
27
28 define Build/Configure
29 $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
30 $(call Build/Configure/Default, \
31 --with-distname=unknown \
32 --sysconfdir=/etc/apcupsd \
33 --enable-usb \
34 --without-x \
35 )
36 endef
37
38 define Build/Compile
39 $(MAKE) -C $(PKG_BUILD_DIR) \
40 DESTDIR="$(PKG_INSTALL_DIR)" \
41 LD="$(TARGET_CC)" \
42 all install
43 endef
44
45 define Package/apcupsd/install
46 $(INSTALL_DIR) $(1)/usr/sbin
47 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
48 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
49 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
50 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
51 $(INSTALL_DIR) $(1)/etc/apcupsd
52 $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
53 $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
54 $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
55 $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
56 $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
57 $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
58 $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
59 $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
60 $(INSTALL_DIR) $(1)/etc/init.d
61 $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd
62 endef
63
64 define Package/apcupsd/conffiles
65 /etc/apcupsd/apcupsd.conf
66 /etc/apcupsd/apcupsd_mail.conf
67 /etc/apcupsd/changeme
68 /etc/apcupsd/commfailure
69 /etc/apcupsd/commok
70 /etc/apcupsd/offbattery
71 /etc/apcupsd/onbattery
72 endef
73
74 $(eval $(call BuildPackage,apcupsd))