1
0

Makefile 3.6 KB

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