Makefile 3.9 KB

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