Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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:= net/misc
  10. PKG_URL:= http://www.networkupstools.org/
  11. PKG_SITES:= http://www.networkupstools.org/source/2.4/
  12. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.gz
  13. PKG_FLAVOURS_NUT:= WITH_SSL WITH_SNMP WITH_USB
  14. PKGFD_WITH_SNMP:= enable SNMP support
  15. PKGFS_WITH_SNMP:= libnetsnmp
  16. PKGFB_WITH_SNMP:= net-snmp
  17. PKGFD_WITH_USB:= enable USB support
  18. PKGFS_WITH_USB:= libusb
  19. PKGFB_WITH_USB:= libusb
  20. PKGFD_WITH_SSL:= enable SSL support
  21. PKGFS_WITH_SSL:= libopenssl
  22. PKGFB_WITH_SSL:= openssl
  23. include ${TOPDIR}/mk/package.mk
  24. $(eval $(call PKG_template,NUT,nut,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  25. define DRIVER_template
  26. DRIVERS_$${ADK_PACKAGE_NUT_DRIVER_${1}}+=${2}
  27. endef
  28. DRIVERS_y:=
  29. $(eval $(call DRIVER_template,BESTUPS,bestups))
  30. $(eval $(call DRIVER_template,APCSMART,apcsmart))
  31. $(eval $(call DRIVER_template,EVERUPS,everups))
  32. $(eval $(call DRIVER_template,BELKIN,belkin))
  33. $(eval $(call DRIVER_template,MASTERGUARD,masterguard))
  34. $(eval $(call DRIVER_template,POWERCOM,powercom))
  35. $(eval $(call DRIVER_template,POWERPANEL,powerpanel))
  36. $(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
  37. $(eval $(call DRIVER_template,TRIPPLITE,tripplite))
  38. $(eval $(call DRIVER_template,VICTRONUPS,victronups))
  39. $(eval $(call DRIVER_template,GENERICUPS,genericups))
  40. $(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
  41. $(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
  42. $(eval $(call DRIVER_template,ISBMEX,isbmex))
  43. $(eval $(call DRIVER_template,ETAPRO,etapro))
  44. $(eval $(call DRIVER_template,LIEBERT,liebert))
  45. $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
  46. $(eval $(call DRIVER_template,SAFENET,safenet))
  47. $(eval $(call DRIVER_template,BELKINUNV,belkinunv))
  48. $(eval $(call DRIVER_template,ONEAC,oneac))
  49. $(eval $(call DRIVER_template,METASYS,metasys))
  50. $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
  51. $(eval $(call DRIVER_template,UPSCODE2,upscode2))
  52. $(eval $(call DRIVER_template,SOLIS,solis))
  53. $(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
  54. $(eval $(call DRIVER_template,MEGATEC,megatec))
  55. $(eval $(call DRIVER_template,RHINO,rhino))
  56. CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
  57. INSTALL_DRIVERS_tmp=${DRIVERS_y}
  58. ifneq (${ADK_PACKAGE_NUT_WITH_USB},)
  59. INSTALL_DRIVERS_tmp+= usbhid-ups tripplite_usb
  60. endif
  61. ifneq (${ADK_PACKAGE_NUT_WITH_SNMP},)
  62. INSTALL_DRIVERS_tmp+= snmp-ups
  63. endif
  64. INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
  65. CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
  66. --without-cgi \
  67. --with-drivers=${INSTALL_DRIVERS} \
  68. --with-group=0 \
  69. --with-user=0
  70. ifneq (${ADK_PACKAGE_NUT_WITH_SSL},)
  71. CONFIGURE_ARGS+= --with-ssl
  72. CONFIGURE_ENV+= CPPFLAGS="${TARGET_CPPFLAGS} ${TARGET_LDFLAGS}"
  73. MAKE_FLAGS+= SSL_CFLAGS="${TARGET_CPPFLAGS}" SSL_LDFLAGS="${TARGET_LDFLAGS} -lssl -lcrypto"
  74. endif
  75. ifneq (${ADK_PACKAGE_NUT_WITH_USB},)
  76. CONFIGURE_ARGS+= --with-usb
  77. endif
  78. ifneq (${ADK_PACKAGE_NUT_WITH_SNMP},)
  79. CONFIGURE_ARGS+= --with-snmp
  80. endif
  81. nut-install:
  82. ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin ${IDIR_NUT}/etc
  83. ${INSTALL_DIR} ${IDIR_NUT}/usr/lib
  84. ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
  85. ${IDIR_NUT}/usr/sbin/
  86. ${CP} ${WRKINST}/usr/lib/lib*.so* ${IDIR_NUT}/usr/lib
  87. ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
  88. ${IDIR_NUT}/usr/bin/
  89. ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
  90. ${IDIR_NUT}/usr/bin/
  91. ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
  92. include ${TOPDIR}/mk/pkg-bottom.mk