@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME := nut
PKG_NAME := nut
PKG_VERSION := 2.7.3
PKG_VERSION := 2.7.3
PKG_RELEASE := 1
PKG_RELEASE := 2
PKG_SOURCE := $( PKG_NAME) -$( PKG_VERSION) .tar.gz
PKG_SOURCE := $( PKG_NAME) -$( PKG_VERSION) .tar.gz
PKG_SOURCE_URL := http://www.networkupstools.org/source/2.7/
PKG_SOURCE_URL := http://www.networkupstools.org/source/2.7/
@ -28,11 +28,10 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_NUT_CLIENTS_UPSMON \
CONFIG_NUT_CLIENTS_UPSMON \
CONFIG_NUT_CLIENTS_UPSRW \
CONFIG_NUT_CLIENTS_UPSRW \
CONFIG_NUT_CLIENTS_UPSSCHED \
CONFIG_NUT_CLIENTS_UPSSCHED \
CONFIG_NUT_DRIVER_SERIAL \
CONFIG_NUT_DRIVER_SNMP \
CONFIG_NUT_DRIVER_SNMP \
CONFIG_NUT_DRIVER_USB \
CONFIG_NUT_DRIVER_USB \
CONFIG_NUT_SERVER \
CONFIG_NUT_SERVER \
CONFIG_NUT_SSL \
CONFIG_NUT_SSL
i n c l u d e $( INCLUDE_DIR ) / p a c k a g e . m k
i n c l u d e $( INCLUDE_DIR ) / p a c k a g e . m k
@ -78,7 +77,6 @@ endef
d e f i n e P a c k a g e / n u t / i n s t a l l
d e f i n e P a c k a g e / n u t / i n s t a l l
$( INSTALL_DIR) $( 1) /etc/nut
$( INSTALL_DIR) $( 1) /etc/nut
$( INSTALL_DIR) $( 1) /usr/bin
$( INSTALL_DIR) $( 1) /usr/bin
$( INSTALL_DIR) $( 1) /usr/bin
$( INSTALL_DIR) $( 1) /usr/lib
$( INSTALL_DIR) $( 1) /usr/lib
$( INSTALL_DIR) $( 1) /usr/sbin
$( INSTALL_DIR) $( 1) /usr/sbin
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/nut.conf.sample $( 1) /etc/nut/nut.conf
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/nut.conf.sample $( 1) /etc/nut/nut.conf
@ -102,7 +100,7 @@ define Package/nut/install
$( if $( CONFIG_NUT_SERVER) ,$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upsd.users.sample $( 1) /etc/nut/upsd.users)
$( if $( CONFIG_NUT_SERVER) ,$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upsd.users.sample $( 1) /etc/nut/upsd.users)
$( if $( CONFIG_NUT_CLIENTS_UPSC) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upsc $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSC) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upsc $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSCMD) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upscmd $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSCMD) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upscmd $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_LOG) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upslog $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPS LOG) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upslog $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSRW) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upsrw $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSRW) ,$( CP) $( PKG_INSTALL_DIR) /usr/bin/upsrw $( 1) /usr/bin/)
$( if $( CONFIG_NUT_CLIENTS_UPSMON) ,$( CP) ./files/nut-monitor.init $( 1) /etc/init.d/)
$( if $( CONFIG_NUT_CLIENTS_UPSMON) ,$( CP) ./files/nut-monitor.init $( 1) /etc/init.d/)
$( if $( CONFIG_NUT_CLIENTS_UPSMON) ,$( CP) $( PKG_INSTALL_DIR) /usr/sbin/upsmon $( 1) /usr/sbin/)
$( if $( CONFIG_NUT_CLIENTS_UPSMON) ,$( CP) $( PKG_INSTALL_DIR) /usr/sbin/upsmon $( 1) /usr/sbin/)
@ -112,13 +110,62 @@ define Package/nut/install
$( if $( CONFIG_NUT_CLIENTS_UPSSCHED) ,$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upssched.conf.sample $( 1) /etc/nut/upssched.conf)
$( if $( CONFIG_NUT_CLIENTS_UPSSCHED) ,$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upssched.conf.sample $( 1) /etc/nut/upssched.conf)
e n d e f
e n d e f
d e f i n e P a c k a g e / n u t - w e b - c g i
$( call Package/nut/Default)
TITLE += Web CGI interface
DEPENDS += +libgd
e n d e f
d e f i n e P a c k a g e / n u t - w e b - c g i / d e s c r i p t i o n
T h e C G I p r o g r a m s a r e c l i e n t s t h a t r u n t h r o u g h y o u r w e b s e r v e r .
T h e y a l l o w y o u t o s e e U P S s t a t u s a n d p e r f o r m c e r t a i n a d m i n i s t r a t i v e
c o m m a n d s f r o m a n y w e b b r o w s e r . J a v a s c r i p t a n d c o o k i e s a r e n o t r e q u i r e d .
e n d e f
d e f i n e P a c k a g e / n u t - w e b - c g i / c o n f f i l e s
/etc/nut/hosts.conf
/etc/nut/upsset.conf
/etc/nut/upsstats.html
/etc/nut/upsstats-single.html
e n d e f
d e f i n e P a c k a g e / n u t - w e b - c g i / i n s t a l l
$( INSTALL_DIR) $( 1) /etc/nut
$( INSTALL_DIR) $( 1) /usr/share/www/cgi-bin
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/hosts.conf.sample $( 1) /etc/nut/hosts.conf
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upsset.conf.sample $( 1) /etc/nut/upsset.conf
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upsstats.html.sample $( 1) /etc/nut/upsstats.html
$( INSTALL_CONF) $( PKG_INSTALL_DIR) /etc/nut/upsstats-single.html.sample $( 1) /etc/nut/upsstats-single.html
$( CP) $( PKG_INSTALL_DIR) /usr/share/www/nut $( 1) /usr/share/www/
$( CP) $( PKG_INSTALL_DIR) /usr/share/www/cgi-bin/nut $( 1) /usr/share/www/cgi-bin/
e n d e f
d e f i n e P a c k a g e / n u t - a v a h i - s e r v i c e
$( call Package/nut/Default)
TITLE += ( Avahi service)
DEPENDS += +avahi-daemon
e n d e f
d e f i n e P a c k a g e / n u t - a v a h i - s e r v i c e / d e s c r i p t i o n
T h i s p a c k a g e c o n t a i n s t h e s e r v i c e d e f i n i t i o n f o r a n n o u n c i n g t h e
a t t a c h e d U P S v i a m D N S / D N S - S D .
e n d e f
d e f i n e P a c k a g e / n u t - a v a h i - s e r v i c e / c o n f f i l e s
/etc/avahi/services/nut.service
e n d e f
d e f i n e P a c k a g e / n u t - a v a h i - s e r v i c e / i n s t a l l
$( INSTALL_DIR) $( 1) /etc/avahi/services
$( INSTALL_CONF) ./files/nut.service $( 1) /etc/avahi/services/
e n d e f
# Dealing with all of the drivers is very repetitive, but the previous
# Dealing with all of the drivers is very repetitive, but the previous
# maintainer had a neat solution which just needed some tweaking.
# maintainer had a neat solution which just needed some tweaking.
d e f i n e D r i v e r P a c k a g e
d e f i n e D r i v e r P a c k a g e
define Package/nut-driver-$( 2)
define Package/nut-driver-$( 2)
$( call Package/nut/Default)
$( call Package/nut/Default)
TITLE:= $( 2) ( NUT $( 1) driver)
TITLE:= $( 2) ( NUT $( 1) driver)
$( if $( filter $( 1) ,serial) ,DEPENDS+= @NUT_DRIVER_SERIAL)
$( if $( filter $( 1) ,snmp) ,DEPENDS+= @NUT_DRIVER_SNMP)
$( if $( filter $( 1) ,snmp) ,DEPENDS+= @NUT_DRIVER_SNMP)
$( if $( filter $( 1) ,usb) ,DEPENDS+= @NUT_DRIVER_USB)
$( if $( filter $( 1) ,usb) ,DEPENDS+= @NUT_DRIVER_USB)
endef
endef
@ -270,24 +317,36 @@ $(eval $(call DriverDescription,usb,nutdrv_qx,\
Driver for Q* protocol serial and USB based UPS equipment) )
Driver for Q* protocol serial and USB based UPS equipment) )
CONFIGURE_ARGS += \
CONFIGURE_ARGS += \
--$( if $( CONFIG_NUT_DRIVER_SERIAL) ,with,without) -serial \
--sysconfdir= /etc/nut \
--datadir= /usr/share/nut \
--with-dev \
--$( if $( CONFIG_NUT_DRIVER_USB) ,with,without) -usb \
--$( if $( CONFIG_NUT_DRIVER_USB) ,with,without) -usb \
--without-avahi \
--$( if $( CONFIG_NUT_DRIVER_SNMP) ,with,without) -snmp \
--$( if $( CONFIG_NUT_DRIVER_SNMP) ,with,without) -snmp \
--without-neon \
--without-neon \
--without-powerman \
--without-powerman \
--without-ipmi \
--without-ipmi \
--without-freeipmi \
--without-freeipmi \
--$( if $( CONFIG_NUT_SSL) ,with,without) -ssl $( if $( CONFIG_NUT_SSL) ,--with-openssl) \
--$( if $( CONFIG_NUT_SSL) ,with,without) -ssl $( if $( CONFIG_NUT_SSL) ,--with-openssl) \
--without-avahi \
--without-libltdl \
--without-libltdl \
--with-user= root \
--with-group= root \
--sysconfdir= /etc/nut \
--with-drvpath= /lib/nut \
--$( if $( CONFIG_PACKAGE_nut-web-cgi) ,with,without) -cgi \
--with-statepath= /var/run \
--with-statepath= /var/run \
--datadir= /usr/share/nut
--with-drvpath= /lib/nut \
--with-cgipath= /usr/share/www/cgi-bin/nut \
--with-htmlpath= /usr/share/www/nut \
--with-user= root \
--with-group= root
d e f i n e B u i l d / I n s t a l l D e v
$( INSTALL_DIR) $( 1) /usr/include $( 1) /usr/lib/pkgconfig
$( CP) $( PKG_INSTALL_DIR) /usr/lib/lib*.so* $( 1) /usr/lib/
$( CP) $( PKG_INSTALL_DIR) /usr/include/*.h $( 1) /usr/include/
$( CP) $( PKG_INSTALL_DIR) /usr/lib/pkgconfig/*.pc $( 1) /usr/lib/pkgconfig/
e n d e f
$( eval $ ( call BuildPackage ,nut ) )
$( eval $ ( call BuildPackage ,nut ) )
$( eval $ ( call BuildPackage ,nut -web -cgi ) )
$( eval $ ( call BuildPackage ,nut -avahi -service ) )
$( foreach d ,$ ( filter -out $ ( SERIAL_DRIVERLIST_IGNORE ) ,$ ( SERIAL_DRIVERLIST ) ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )
$( foreach d ,$ ( filter -out $ ( SERIAL_DRIVERLIST_IGNORE ) ,$ ( SERIAL_DRIVERLIST ) ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )
$( foreach d ,$ ( SNMP_DRIVERLIST ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )
$( foreach d ,$ ( SNMP_DRIVERLIST ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )
$( foreach d ,$ ( USB_LIBUSB_DRIVERLIST ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )
$( foreach d ,$ ( USB_LIBUSB_DRIVERLIST ) ,$ ( eval $ ( call BuildPackage ,nut -driver -$ ( d ) ) ) )