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.

106 lines
2.8 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:=1
  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_MD5SUM:=cc8f5ced77f38906a274787acb9bc980
  17. PKG_BUILD_DEPENDS:=libgd
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/apcupsd
  20. SECTION:=net
  21. CATEGORY:=Network
  22. DEPENDS:=+libpthread +libusb-compat
  23. TITLE:=UPS control software
  24. URL:=http://www.apcupsd.org/
  25. endef
  26. define Package/apcupsd-cgi
  27. SECTION:=net
  28. CATEGORY:=Network
  29. DEPENDS:=+libpthread +libgd
  30. TITLE:=UPS control software CGI module
  31. URL:=http://www.apcupsd.org/
  32. endef
  33. define Build/Configure
  34. $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/
  35. $(call Build/Configure/Default, \
  36. --with-distname=unknown \
  37. --sysconfdir=/etc/apcupsd \
  38. --enable-cgi \
  39. --enable-usb \
  40. --enable-modbus-usb \
  41. --without-x \
  42. )
  43. endef
  44. define Build/Compile
  45. $(MAKE) -C $(PKG_BUILD_DIR) \
  46. DESTDIR="$(PKG_INSTALL_DIR)" \
  47. LD="$(TARGET_CC)" \
  48. all install
  49. endef
  50. define Package/apcupsd/install
  51. $(INSTALL_DIR) $(1)/usr/sbin
  52. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/
  53. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/
  54. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/
  55. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/
  56. $(INSTALL_DIR) $(1)/etc/apcupsd
  57. $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/
  58. $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/
  59. $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/
  60. $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/
  61. $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/
  62. $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/
  63. $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/
  64. $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd
  67. endef
  68. define Package/apcupsd-cgi/install
  69. $(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd
  70. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/*.cgi $(1)/www/cgi-bin/apcupsd
  71. $(INSTALL_DIR) $(1)/etc/apcupsd
  72. $(INSTALL_CONF) ./files/apcupsd.css $(1)/etc/apcupsd/
  73. $(INSTALL_CONF) ./files/hosts.conf $(1)/etc/apcupsd/
  74. $(INSTALL_CONF) ./files/multimon.conf $(1)/etc/apcupsd/
  75. endef
  76. define Package/apcupsd/conffiles
  77. /etc/apcupsd/apcupsd.conf
  78. /etc/apcupsd/apcupsd_mail.conf
  79. /etc/apcupsd/changeme
  80. /etc/apcupsd/commfailure
  81. /etc/apcupsd/commok
  82. /etc/apcupsd/offbattery
  83. /etc/apcupsd/onbattery
  84. endef
  85. define Package/apcupsd-cgi/conffiles
  86. /etc/apcupsd/apcupsd.css
  87. /etc/apcupsd/hosts.conf
  88. /etc/apcupsd/multimon.conf
  89. endef
  90. $(eval $(call BuildPackage,apcupsd))
  91. $(eval $(call BuildPackage,apcupsd-cgi))