Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # $Id$
  2. #-
  3. # This file is part of the OpenADK project. OpenADK is copyrighted
  4. # material, please see the LICENCE file in the top-level directory.
  5. include ${TOPDIR}/rules.mk
  6. PKG_NAME:= nut
  7. PKG_VERSION:= 2.4.1
  8. PKG_RELEASE:= 1
  9. PKG_MD5SUM:= 609ebaf2123fc7171d25a6c742dd7d66
  10. PKG_DESCR:= Network UPS Tools
  11. PKG_SECTION:= sys
  12. PKG_URL:= http://www.networkupstools.org
  13. PKG_SITES:= http://www.networkupstools.org/source/2.4/
  14. include ${TOPDIR}/mk/package.mk
  15. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  16. PKG_DEPENDS+= libnetsnmp
  17. endif
  18. ifneq (${ADK_PACKAGE_NUT_USB},)
  19. PKG_DEPENDS+= libusb
  20. endif
  21. ifneq (${ADK_PACKAGE_NUT_SSL},)
  22. PKG_DEPENDS+= libopenssl
  23. endif
  24. $(eval $(call PKG_template,NUT,${PKG_NAME},${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,FENTONUPS,fentonups))
  31. $(eval $(call DRIVER_template,APCSMART,apcsmart))
  32. $(eval $(call DRIVER_template,EVERUPS,everups))
  33. $(eval $(call DRIVER_template,BELKIN,belkin))
  34. $(eval $(call DRIVER_template,MASTERGUARD,masterguard))
  35. $(eval $(call DRIVER_template,POWERCOM,powercom))
  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,SMS,sms))
  46. $(eval $(call DRIVER_template,ESUPSSMART,esupssmart))
  47. $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
  48. $(eval $(call DRIVER_template,BLAZER,blazer))
  49. $(eval $(call DRIVER_template,SAFENET,safenet))
  50. $(eval $(call DRIVER_template,BELKINUNV,belkinunv))
  51. $(eval $(call DRIVER_template,ONEAC,oneac))
  52. $(eval $(call DRIVER_template,IPPON,ippon))
  53. $(eval $(call DRIVER_template,CPSUPS,cpsups))
  54. $(eval $(call DRIVER_template,MUSTEK,mustek))
  55. $(eval $(call DRIVER_template,METASYS,metasys))
  56. $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
  57. $(eval $(call DRIVER_template,UPSCODE2,upscode2))
  58. $(eval $(call DRIVER_template,SOLIS,solis))
  59. $(eval $(call DRIVER_template,GAMATRONIC,gamatronic))
  60. $(eval $(call DRIVER_template,MEGATEC,megatec))
  61. $(eval $(call DRIVER_template,RHINO,rhino))
  62. CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
  63. INSTALL_DRIVERS_tmp=${DRIVERS_y}
  64. ifneq (${ADK_PACKAGE_NUT_USB},)
  65. INSTALL_DRIVERS_tmp+= hidups energizerups newhidups tripplite_usb
  66. endif
  67. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  68. INSTALL_DRIVERS_tmp+= snmp-ups
  69. endif
  70. INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
  71. CONFIGURE_STYLE:= gnu
  72. CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
  73. --without-cgi \
  74. --with-drivers=${INSTALL_DRIVERS} \
  75. --with-group=root \
  76. --with-user=root
  77. ifneq (${ADK_PACKAGE_NUT_SSL},)
  78. CONFIGURE_ARGS+= --with-ssl
  79. CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
  80. MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
  81. endif
  82. BUILD_STYLE:= auto
  83. ALL_TARGET:= all
  84. INSTALL_STYLE:= auto
  85. INSTALL_TARGET:= install
  86. ifneq (${ADK_PACKAGE_NUT_USB},)
  87. ALL_TARGET+= usb
  88. INSTALL_TARGET+= install-usb
  89. endif
  90. ifneq (${ADK_PACKAGE_NUT_SNMP},)
  91. ALL_TARGET+= snmp
  92. INSTALL_TARGET+= install-snmp
  93. endif
  94. post-install:
  95. ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin
  96. ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
  97. ${IDIR_NUT}/usr/sbin/
  98. ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
  99. ${IDIR_NUT}/usr/bin/
  100. ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
  101. ${IDIR_NUT}/usr/bin/
  102. ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
  103. ifneq (${ADK_PACKAGE_NUT_VARDESC},)
  104. ${INSTALL_DIR} ${IDIR_NUT}/usr/share
  105. ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
  106. ${IDIR_NUT}/usr/share/
  107. endif
  108. include ${TOPDIR}/mk/pkg-bottom.mk