| 1 | # $FreeWRT$
|
|---|
| 2 | #-
|
|---|
| 3 | # This file is part of the FreeWRT project. FreeWRT is copyrighted
|
|---|
| 4 | # material, please see the LICENCE file in the top-level directory
|
|---|
| 5 | # or at http://www.freewrt.org/licence for details.
|
|---|
| 6 |
|
|---|
| 7 | include ${TOPDIR}/rules.mk
|
|---|
| 8 |
|
|---|
| 9 | PKG_NAME:= nut
|
|---|
| 10 | PKG_VERSION:= 2.0.4
|
|---|
| 11 | PKG_RELEASE:= 5
|
|---|
| 12 | PKG_MD5SUM:= 59b6f3038a5ef64c584913e72bd850a2
|
|---|
| 13 | MASTER_SITES:= http://www.networkupstools.org/source/2.0/
|
|---|
| 14 |
|
|---|
| 15 | include ${TOPDIR}/mk/package.mk
|
|---|
| 16 |
|
|---|
| 17 | $(eval $(call PKG_template,NUT,nut,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
|
|---|
| 18 |
|
|---|
| 19 | define DRIVER_template
|
|---|
| 20 |
|
|---|
| 21 | DRIVERS_$${FWRT_PACKAGE_NUT_DRIVER_${1}}+=${2}
|
|---|
| 22 |
|
|---|
| 23 | endef
|
|---|
| 24 |
|
|---|
| 25 | DRIVERS_y:=
|
|---|
| 26 | $(eval $(call DRIVER_template,BESTUPS,bestups))
|
|---|
| 27 | $(eval $(call DRIVER_template,FENTONUPS,fentonups))
|
|---|
| 28 | $(eval $(call DRIVER_template,APCSMART,apcsmart))
|
|---|
| 29 | $(eval $(call DRIVER_template,EVERUPS,everups))
|
|---|
| 30 | $(eval $(call DRIVER_template,BELKIN,belkin))
|
|---|
| 31 | $(eval $(call DRIVER_template,MASTERGUARD,masterguard))
|
|---|
| 32 | $(eval $(call DRIVER_template,POWERCOM,powercom))
|
|---|
| 33 | $(eval $(call DRIVER_template,CYBERPOWER,cyberpower))
|
|---|
| 34 | $(eval $(call DRIVER_template,TRIPPLITE,tripplite))
|
|---|
| 35 | $(eval $(call DRIVER_template,VICTRONUPS,victronups))
|
|---|
| 36 | $(eval $(call DRIVER_template,GENERICUPS,genericups))
|
|---|
| 37 | $(eval $(call DRIVER_template,MGE_UTALK,mge-utalk))
|
|---|
| 38 | $(eval $(call DRIVER_template,BESTUFERRUPS,bestuferrups))
|
|---|
| 39 | $(eval $(call DRIVER_template,ISBMEX,isbmex))
|
|---|
| 40 | $(eval $(call DRIVER_template,ETAPRO,etapro))
|
|---|
| 41 | $(eval $(call DRIVER_template,LIEBERT,liebert))
|
|---|
| 42 | $(eval $(call DRIVER_template,SMS,sms))
|
|---|
| 43 | $(eval $(call DRIVER_template,ESUPSSMART,esupssmart))
|
|---|
| 44 | $(eval $(call DRIVER_template,TRIPPLITESU,tripplitesu))
|
|---|
| 45 | $(eval $(call DRIVER_template,BLAZER,blazer))
|
|---|
| 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,IPPON,ippon))
|
|---|
| 50 | $(eval $(call DRIVER_template,CPSUPS,cpsups))
|
|---|
| 51 | $(eval $(call DRIVER_template,MUSTEK,mustek))
|
|---|
| 52 | $(eval $(call DRIVER_template,METASYS,metasys))
|
|---|
| 53 | $(eval $(call DRIVER_template,BESTFCOM,bestfcom))
|
|---|
| 54 | $(eval $(call DRIVER_template,POWERMUST,powermust))
|
|---|
| 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 |
|
|---|
| 61 | CONFIG_DRIVERS=$(shell echo ${DRIVERS_y} | tr ' ' ',')
|
|---|
| 62 |
|
|---|
| 63 | INSTALL_DRIVERS_tmp=${DRIVERS_y}
|
|---|
| 64 | ifneq (${FWRT_PACKAGE_NUT_USB},)
|
|---|
| 65 | INSTALL_DRIVERS_tmp+= hidups energizerups
|
|---|
| 66 | endif
|
|---|
| 67 | ifneq (${FWRT_PACKAGE_NUT_SNMP},)
|
|---|
| 68 | INSTALL_DRIVERS_tmp+= snmp-ups
|
|---|
| 69 | endif
|
|---|
| 70 | INSTALL_DRIVERS=$(shell echo ${INSTALL_DRIVERS_tmp} | tr ' ' ',')
|
|---|
| 71 |
|
|---|
| 72 | CONFIGURE_STYLE:= gnu
|
|---|
| 73 | CONFIGURE_ARGS+= --with-linux-hiddev=${LINUX_DIR}/include/linux/hiddev.h \
|
|---|
| 74 | --without-cgi \
|
|---|
| 75 | --with-drivers=${CONFIG_DRIVERS} \
|
|---|
| 76 | --with-user=root
|
|---|
| 77 | IPKG_DEPEND_tmp:=
|
|---|
| 78 | ifneq (${FWRT_PACKAGE_NUT_SSL},)
|
|---|
| 79 | CONFIGURE_ARGS+= --with-ssl
|
|---|
| 80 | CONFIGURE_ENV+= CPPFLAGS="${TCPPFLAGS} ${TLDFLAGS}"
|
|---|
| 81 | MAKE_FLAGS+= SSL_CFLAGS="${TCPPFLAGS}" SSL_LDFLAGS="${TLDFLAGS} -lssl -lcrypto"
|
|---|
| 82 | IPKG_DEPEND_tmp+= libopenssl
|
|---|
| 83 | endif
|
|---|
| 84 | BUILD_STYLE:= auto
|
|---|
| 85 | ALL_TARGET:= all
|
|---|
| 86 | INSTALL_STYLE:= auto
|
|---|
| 87 | INSTALL_TARGET:= install
|
|---|
| 88 | ifneq (${FWRT_PACKAGE_NUT_USB},)
|
|---|
| 89 | MAKE_FLAGS+= LIBUSB_CFLAGS="${TCPPFLAGS}" \
|
|---|
| 90 | USB_DRIVER_LIST="newhidups tripplite_usb hidups energizerups"
|
|---|
| 91 | ALL_TARGET+= usb
|
|---|
| 92 | INSTALL_TARGET+= install-usb
|
|---|
| 93 | IPKG_DEPEND_tmp+= libusb
|
|---|
| 94 | endif
|
|---|
| 95 | ifneq (${FWRT_PACKAGE_NUT_SNMP},)
|
|---|
| 96 | ALL_TARGET+= snmp
|
|---|
| 97 | INSTALL_TARGET+= install-snmp
|
|---|
| 98 | IPKG_DEPEND_tmp+= libnetsnmp
|
|---|
| 99 | endif
|
|---|
| 100 | IPKG_DEPEND=$(shell echo ${IPKG_DEPEND_tmp} | tr ' ' ',')
|
|---|
| 101 |
|
|---|
| 102 | post-install:
|
|---|
| 103 | ${INSTALL_DIR} ${IDIR_NUT}/usr/{s,}bin
|
|---|
| 104 | ${INSTALL_DIR} ${IDIR_NUT}/etc/init.d
|
|---|
| 105 | ${INSTALL_BIN} ./files/upsd.init \
|
|---|
| 106 | ${IDIR_NUT}/etc/init.d/upsd
|
|---|
| 107 | ${INSTALL_BIN} ${WRKINST}/usr/sbin/ups{d,mon,sched} \
|
|---|
| 108 | ${IDIR_NUT}/usr/sbin/
|
|---|
| 109 | ${INSTALL_BIN} ${WRKINST}/usr/bin/{${INSTALL_DRIVERS}} \
|
|---|
| 110 | ${IDIR_NUT}/usr/bin/
|
|---|
| 111 | ${INSTALL_BIN} ${WRKINST}/usr/bin/ups{c,cmd,drvctl,log,rw} \
|
|---|
| 112 | ${IDIR_NUT}/usr/bin/
|
|---|
| 113 | ${INSTALL_DATA} ./files/ups{d,}.conf ${IDIR_NUT}/etc/
|
|---|
| 114 | echo "Depends: ${IPKG_DEPEND}" >> ${IDIR_NUT}/CONTROL/control
|
|---|
| 115 | ifneq (${FWRT_PACKAGE_NUT_VARDESC},)
|
|---|
| 116 | ${INSTALL_DIR} ${IDIR_NUT}/usr/share
|
|---|
| 117 | ${INSTALL_DATA} ${WRKINST}/usr/share/cmdvartab \
|
|---|
| 118 | ${IDIR_NUT}/usr/share/
|
|---|
| 119 | endif
|
|---|
| 120 |
|
|---|
| 121 | include ${TOPDIR}/mk/pkg-bottom.mk
|
|---|