2ef078386e1893e43d3ed4f9bb091ef9c6fbac7e
[openwrt/svn-archive/archive.git] / net / apcupsd / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id: Makefile 6500 2007-03-04 04:19:46Z pavlov $
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=apcupsd
12 PKG_VERSION:=3.14.2
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/apcupsd
17 PKG_MD5SUM:=fd8785e7607d20cefa68dc20e44eebc4
18 PKG_CAT:=zcat
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
21 #PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
22 PKG_INSTALL_DIR:=$(BUILD_DIR)/apcupsd-ipkg-install
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/apcupsd
27 SECTION:=utils
28 CATEGORY:=Utilities
29 DEPENDS:=+libpthread
30 TITLE:=UPS control software
31 URL:=http://www.apcupsd.org/
32 endef
33
34 define Build/Configure
35 $(call Build/Configure/Default, \
36 --with-distname=unknown \
37 --sysconfdir=/etc/apcupsd \
38 )
39 endef
40
41 define Build/Compile
42 $(MAKE) -C $(PKG_BUILD_DIR) \
43 DESTDIR="$(PKG_INSTALL_DIR)" \
44 LD="$(TARGET_CC)" \
45 all install
46 endef
47
48 define Package/apcupsd/install
49 $(INSTALL_DIR) $(1)/usr/sbin
50 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
51 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
52 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
54 $(INSTALL_DIR) $(1)/etc/apcupsd
55 $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
56 $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
57 $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
58 $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
59 $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
60 $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
61 $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
62 $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
63 $(INSTALL_DIR) $(1)/etc/init.d
64 $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd
65 endef
66
67 $(eval $(call BuildPackage,apcupsd))