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
3.0 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.13
  10. PKG_RELEASE:=3
  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:=c291d9d3923b4d9c0e600b755ad4f489
  17. PKG_BUILD_DEPENDS:=libgd
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/apcupsd
  20. SECTION:=net
  21. CATEGORY:=Network
  22. DEPENDS:=+libpthread
  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. --without-x \
  41. )
  42. endef
  43. define Build/Compile
  44. $(MAKE) -C $(PKG_BUILD_DIR) \
  45. DESTDIR="$(PKG_INSTALL_DIR)" \
  46. LD="$(TARGET_CC)" \
  47. all install
  48. endef
  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. define Package/apcupsd-cgi/install
  68. $(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd
  69. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/multimon.cgi $(1)/www/cgi-bin/apcupsd
  70. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsfstats.cgi $(1)/www/cgi-bin/apcupsd
  71. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsimage.cgi $(1)/www/cgi-bin/apcupsd
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/upsstats.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. endef
  77. define Package/apcupsd/conffiles
  78. /etc/apcupsd/apcupsd.conf
  79. /etc/apcupsd/apcupsd_mail.conf
  80. /etc/apcupsd/changeme
  81. /etc/apcupsd/commfailure
  82. /etc/apcupsd/commok
  83. /etc/apcupsd/offbattery
  84. /etc/apcupsd/onbattery
  85. endef
  86. define Package/apcupsd-cgi/conffiles
  87. /etc/apcupsd/apcupsd.css
  88. /etc/apcupsd/hosts.conf
  89. endef
  90. $(eval $(call BuildPackage,apcupsd))
  91. $(eval $(call BuildPackage,apcupsd-cgi))