Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include ${TOPDIR}/rules.mk
  4. PKG_NAME:= nut
  5. PKG_VERSION:= 2.4.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 609ebaf2123fc7171d25a6c742dd7d66
  8. PKG_DESCR:= Network UPS Tools
  9. PKG_SECTION:= sys
  10. ifneq (${ADK_PACKAGE_NUT_SSL},)
  11. PKG_DEPENDS+= libopenssl
  12. PKG_BUILDDEP+= openssl
  13. endif
  14. ifneq (${ADK_PACKAGE_NUT_USB},)
  15. PKG_DEPENDS+= libusb
  16. PKG_BUILDDEP+= libusb
  17. endif
  18. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  19. PKG_DEPENDS+= libnetsnmp
  20. PKG_BUILDDEP+= net-snmp
  21. endif
  22. PKG_URL:= http://www.networkupstools.org
  23. PKG_SITES:= http://www.networkupstools.org/source/2.4/
  24. PKG_FLAVOURS:= SSL SNMP USB
  25. PKGFD_SSL:= enable SSL support
  26. PKGFD_SNMP:= enable SNMP support
  27. PKGFD_USB:= enable USB support
  28. include ${TOPDIR}/mk/package.mk
  29. $(eval $(call PKG_template,NUT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  30. define DRIVER_template
  31. DRIVERS_$${ADK_PACKAGE_NUT_DRIVER_${1}}+=${2}
  32. endef
  33. DRIVERS_y:=
  34. $(eval $(call DRIVER_template,BESTUPS,bestups))
  35. $(eval $(call DRIVER_template,APCSMART,apcsmart))
  36. $(eval $(call DRIVER_template,EVERUPS,everups))
  37. $(eval $(call DRIVER_template,BELKIN,belkin))
  38. $(eval $(call DRIVER_template,MASTERGUARD,masterguard))
  39. $(eval $(call DRIVER_template,POWERCOM,powercom))
  40. $(eval $(call DRIVER_template,POWERPANEL,powerpanel))
  41. $(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
  42. $(eval $(call DRIVER_template,TRIPPLITE,tripplite))
  43. $(eval $(call DRIVER_template,VICTRONUPS,victronups))
  44. $(eval $(call DRIVER_template,GENERICUPS,genericups))
  45. $(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
  46. $(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
  47. $(eval $(call DRIVER_template,ISBMEX,isbmex))
  48. $(eval $(call DRIVER_template,ETAPRO,etapro))
  49. $(eval $(call DRIVER_template,LIEBERT,liebert))
  50. $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
  51. $(eval $(call DRIVER_template,SAFENET,safenet))
  52. $(eval $(call DRIVER_template,BELKINUNV,belkinunv))
  53. $(eval $(call DRIVER_template,ONEAC,oneac))
  54. $(eval $(call DRIVER_template,METASYS,metasys))
  55. $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
  56. $(eval $(call DRIVER_template,UPSCODE2,upscode2))
  57. $(eval $(call DRIVER_template,SOLIS,solis))
  58. $(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
  59. $(eval $(call DRIVER_template,MEGATEC,megatec))
  60. $(eval $(call DRIVER_template,RHINO,rhino))
  61. CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
  62. INSTALL_DRIVERS_tmp=${DRIVERS_y}
  63. ifneq (${ADK_PACKAGE_NUT_USB},)
  64. INSTALL_DRIVERS_tmp+= usbhid-ups tripplite_usb
  65. endif
  66. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  67. INSTALL_DRIVERS_tmp+= snmp-ups
  68. endif
  69. INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
  70. CONFIGURE_STYLE:= gnu
  71. CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
  72. --without-cgi \
  73. --with-drivers=${INSTALL_DRIVERS} \
  74. --with-group=0 \
  75. --with-user=0
  76. ifneq (${ADK_PACKAGE_NUT_SSL},)
  77. CONFIGURE_ARGS+= --with-ssl
  78. CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
  79. MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
  80. endif
  81. BUILD_STYLE:= auto
  82. ALL_TARGET:= all
  83. INSTALL_STYLE:= auto
  84. INSTALL_TARGET:= install
  85. ifneq (${ADK_PACKAGE_NUT_USB},)
  86. ALL_TARGET+= usb
  87. INSTALL_TARGET+= install-usb
  88. endif
  89. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  90. ALL_TARGET+= snmp
  91. INSTALL_TARGET+= install-snmp
  92. endif
  93. post-install:
  94. ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin ${IDIR_NUT}/etc
  95. ${INSTALL_DIR} ${IDIR_NUT}/usr/lib
  96. ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
  97. ${IDIR_NUT}/usr/sbin/
  98. ${CP} ${WRKINST}/usr/lib/lib*.so* ${IDIR_NUT}/usr/lib
  99. ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
  100. ${IDIR_NUT}/usr/bin/
  101. ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
  102. ${IDIR_NUT}/usr/bin/
  103. ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
  104. ifneq (${ADK_PACKAGE_NUT_VARDESC},)
  105. ${INSTALL_DIR} ${IDIR_NUT}/usr/share
  106. ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
  107. ${IDIR_NUT}/usr/share/
  108. endif
  109. include ${TOPDIR}/mk/pkg-bottom.mk