You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.9 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=apcupsd
  9. PKG_VERSION:=3.14.14
  10. PKG_RELEASE:=2
  11. PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
  12. PKG_LICENSE:=GPL-2.0
  13. PKG_LICENSE_FILES:=COPYING
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=@SF/apcupsd
  16. PKG_HASH:=db7748559b6b4c3784f9856561ef6ac6199ef7bd019b3edcd7e0a647bf8f9867
  17. PKG_CPE_ID:=cpe:/a:apc:apcupsd
  18. PKG_BUILD_DEPENDS:=libgd
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/apcupsd
  21. SECTION:=net
  22. CATEGORY:=Network
  23. DEPENDS:=+libpthread +libusb-compat
  24. TITLE:=UPS control software
  25. URL:=http://www.apcupsd.org/
  26. endef
  27. define Package/apcupsd-cgi
  28. SECTION:=net
  29. CATEGORY:=Network
  30. DEPENDS:=+libpthread +libgd
  31. TITLE:=UPS control software CGI module
  32. URL:=http://www.apcupsd.org/
  33. endef
  34. CONFIGURE_VARS += SHUTDOWN=/sbin/halt
  35. define Build/Configure
  36. $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
  37. $(call Build/Configure/Default, \
  38. --with-distname=unknown \
  39. --sysconfdir=/etc/apcupsd \
  40. --enable-cgi \
  41. --enable-usb \
  42. --enable-modbus-usb \
  43. --without-x \
  44. )
  45. endef
  46. define Build/Compile
  47. $(MAKE) -C $(PKG_BUILD_DIR) \
  48. DESTDIR="$(PKG_INSTALL_DIR)" \
  49. LD="$(TARGET_CC)" \
  50. all install
  51. endef
  52. define Package/apcupsd/install
  53. $(INSTALL_DIR) $(1)/usr/sbin
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
  55. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
  56. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
  57. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
  58. $(INSTALL_DIR) $(1)/etc/apcupsd
  59. $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
  60. $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
  61. $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
  62. $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
  63. $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
  64. $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
  65. $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
  66. $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
  67. $(INSTALL_DIR) $(1)/etc/init.d
  68. $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd
  69. endef
  70. define Package/apcupsd-cgi/install
  71. $(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/*.cgi $(1)/www/cgi-bin/apcupsd
  73. $(INSTALL_DIR) $(1)/etc/apcupsd
  74. $(INSTALL_CONF) ./files/apcupsd.css $(1)/etc/apcupsd/
  75. $(INSTALL_CONF) ./files/hosts.conf $(1)/etc/apcupsd/
  76. $(INSTALL_CONF) ./files/multimon.conf $(1)/etc/apcupsd/
  77. endef
  78. define Package/apcupsd/conffiles
  79. /etc/apcupsd/apcupsd.conf
  80. /etc/apcupsd/apcupsd_mail.conf
  81. /etc/apcupsd/changeme
  82. /etc/apcupsd/commfailure
  83. /etc/apcupsd/commok
  84. /etc/apcupsd/offbattery
  85. /etc/apcupsd/onbattery
  86. endef
  87. define Package/apcupsd-cgi/conffiles
  88. /etc/apcupsd/apcupsd.css
  89. /etc/apcupsd/hosts.conf
  90. /etc/apcupsd/multimon.conf
  91. endef
  92. $(eval $(call BuildPackage,apcupsd))
  93. $(eval $(call BuildPackage,apcupsd-cgi))