fix apcupsd compile on avr32
[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 $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
36 $(call Build/Configure/Default, \
37 --with-distname=unknown \
38 --sysconfdir=/etc/apcupsd \
39 )
40 endef
41
42 define Build/Compile
43 $(MAKE) -C $(PKG_BUILD_DIR) \
44 DESTDIR="$(PKG_INSTALL_DIR)" \
45 LD="$(TARGET_CC)" \
46 all install
47 endef
48
49 define Package/apcupsd/install
50 $(INSTALL_DIR) $(1)/usr/sbin
51 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
52 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
53 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
54 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
55 $(INSTALL_DIR) $(1)/etc/apcupsd
56 $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
57 $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
58 $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
59 $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
60 $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
61 $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
62 $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
63 $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
64 $(INSTALL_DIR) $(1)/etc/init.d
65 $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd
66 endef
67
68 $(eval $(call BuildPackage,apcupsd))