apcupsd: move from old packages and Makefile updated
[feed/packages.git] / net / apcupsd / Makefile
1 #
2 # Copyright (C) 2006-2015 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.13
12 PKG_RELEASE:=2
13
14 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
15 PKG_LICENSE:=GPL-2.0
16 PKG_LICENSE_FILES:=COPYING
17
18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=@SF/apcupsd
20 PKG_MD5SUM:=c291d9d3923b4d9c0e600b755ad4f489
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/apcupsd
25 SECTION:=utils
26 CATEGORY:=Utilities
27 DEPENDS:=+libpthread +libusb-compat
28 TITLE:=UPS control software
29 URL:=http://www.apcupsd.org/
30 endef
31
32 define Build/Configure
33 $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
34 $(call Build/Configure/Default, \
35 --with-distname=unknown \
36 --sysconfdir=/etc/apcupsd \
37 --enable-usb \
38 --without-x \
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 define Package/apcupsd/conffiles
69 /etc/apcupsd/apcupsd.conf
70 /etc/apcupsd/apcupsd_mail.conf
71 /etc/apcupsd/changeme
72 /etc/apcupsd/commfailure
73 /etc/apcupsd/commok
74 /etc/apcupsd/offbattery
75 /etc/apcupsd/onbattery
76 endef
77
78 $(eval $(call BuildPackage,apcupsd))