Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. PKG_URL:= http://www.networkupstools.org
  11. PKG_SITES:= http://www.networkupstools.org/source/2.4/
  12. include ${TOPDIR}/mk/package.mk
  13. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  14. PKG_DEPENDS+= libnetsnmp
  15. endif
  16. ifneq (${ADK_PACKAGE_NUT_USB},)
  17. PKG_DEPENDS+= libusb
  18. endif
  19. ifneq (${ADK_PACKAGE_NUT_SSL},)
  20. PKG_DEPENDS+= libopenssl
  21. endif
  22. $(eval $(call PKG_template,NUT,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  23. define DRIVER_template
  24. DRIVERS_$${ADK_PACKAGE_NUT_DRIVER_${1}}+=${2}
  25. endef
  26. DRIVERS_y:=
  27. $(eval $(call DRIVER_template,BESTUPS,bestups))
  28. $(eval $(call DRIVER_template,FENTONUPS,fentonups))
  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,CYBERPOWER,cyberpower))
  35. $(eval $(call DRIVER_template,TRIPPLITE,tripplite))
  36. $(eval $(call DRIVER_template,VICTRONUPS,victronups))
  37. $(eval $(call DRIVER_template,GENERICUPS,genericups))
  38. $(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
  39. $(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
  40. $(eval $(call DRIVER_template,ISBMEX,isbmex))
  41. $(eval $(call DRIVER_template,ETAPRO,etapro))
  42. $(eval $(call DRIVER_template,LIEBERT,liebert))
  43. $(eval $(call DRIVER_template,SMS,sms))
  44. $(eval $(call DRIVER_template,ESUPSSMART,esupssmart))
  45. $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
  46. $(eval $(call DRIVER_template,BLAZER,blazer))
  47. $(eval $(call DRIVER_template,SAFENET,safenet))
  48. $(eval $(call DRIVER_template,BELKINUNV,belkinunv))
  49. $(eval $(call DRIVER_template,ONEAC,oneac))
  50. $(eval $(call DRIVER_template,IPPON,ippon))
  51. $(eval $(call DRIVER_template,CPSUPS,cpsups))
  52. $(eval $(call DRIVER_template,MUSTEK,mustek))
  53. $(eval $(call DRIVER_template,METASYS,metasys))
  54. $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
  55. $(eval $(call DRIVER_template,UPSCODE2,upscode2))
  56. $(eval $(call DRIVER_template,SOLIS,solis))
  57. $(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
  58. $(eval $(call DRIVER_template,MEGATEC,megatec))
  59. $(eval $(call DRIVER_template,RHINO,rhino))
  60. CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
  61. INSTALL_DRIVERS_tmp=${DRIVERS_y}
  62. ifneq (${ADK_PACKAGE_NUT_USB},)
  63. INSTALL_DRIVERS_tmp+= hidups energizerups newhidups tripplite_usb
  64. endif
  65. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  66. INSTALL_DRIVERS_tmp+= snmp-ups
  67. endif
  68. INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
  69. CONFIGURE_STYLE:= gnu
  70. CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
  71. --without-cgi \
  72. --with-drivers=${INSTALL_DRIVERS} \
  73. --with-group=root \
  74. --with-user=root
  75. ifneq (${ADK_PACKAGE_NUT_SSL},)
  76. CONFIGURE_ARGS+= --with-ssl
  77. CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
  78. MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
  79. endif
  80. BUILD_STYLE:= auto
  81. ALL_TARGET:= all
  82. INSTALL_STYLE:= auto
  83. INSTALL_TARGET:= install
  84. ifneq (${ADK_PACKAGE_NUT_USB},)
  85. ALL_TARGET+= usb
  86. INSTALL_TARGET+= install-usb
  87. endif
  88. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  89. ALL_TARGET+= snmp
  90. INSTALL_TARGET+= install-snmp
  91. endif
  92. post-install:
  93. ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin
  94. ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
  95. ${IDIR_NUT}/usr/sbin/
  96. ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
  97. ${IDIR_NUT}/usr/bin/
  98. ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
  99. ${IDIR_NUT}/usr/bin/
  100. ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
  101. ifneq (${ADK_PACKAGE_NUT_VARDESC},)
  102. ${INSTALL_DIR} ${IDIR_NUT}/usr/share
  103. ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
  104. ${IDIR_NUT}/usr/share/
  105. endif
  106. include ${TOPDIR}/mk/pkg-bottom.mk