1*4882a593Smuzhiyun################################################################################ 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# nut 4*4882a593Smuzhiyun# 5*4882a593Smuzhiyun################################################################################ 6*4882a593Smuzhiyun 7*4882a593SmuzhiyunNUT_VERSION = 03c3bbe8df9a2caf3c09c120ae7045d35af99b76 8*4882a593SmuzhiyunNUT_SITE = $(call github,networkupstools,nut,$(NUT_VERSION)) 9*4882a593SmuzhiyunNUT_LICENSE = GPL-2.0+, GPL-3.0+ (python scripts), GPL/Artistic (perl client) 10*4882a593SmuzhiyunNUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3 11*4882a593SmuzhiyunNUT_SELINUX_MODULES = apache nut 12*4882a593SmuzhiyunNUT_INSTALL_STAGING = YES 13*4882a593SmuzhiyunNUT_DEPENDENCIES = host-pkgconf host-perl 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun# From git: 16*4882a593SmuzhiyunNUT_AUTORECONF = YES 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun# Generate files otherwise generated by autogen.sh 19*4882a593Smuzhiyun# buildroot does not support augeas, creating an empty file prevents 20*4882a593Smuzhiyun# us from adding a dependency to host-python 21*4882a593Smuzhiyundefine NUT_PREGEN 22*4882a593Smuzhiyun touch $(@D)/scripts/augeas/nutupsconf.aug.in 23*4882a593Smuzhiyun cd $(@D)/tools && PATH=$(BR_PATH) ./nut-usbinfo.pl 24*4882a593Smuzhiyunendef 25*4882a593SmuzhiyunNUT_PRE_CONFIGURE_HOOKS += NUT_PREGEN 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun# Race condition in tools generation 28*4882a593SmuzhiyunNUT_MAKE = $(MAKE1) 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun# Put the PID files in a read-write place (/var/run is a tmpfs) 31*4882a593Smuzhiyun# since the default location (/var/state/ups) maybe readonly. 32*4882a593SmuzhiyunNUT_CONF_OPTS = \ 33*4882a593Smuzhiyun --with-altpidpath=/var/run/upsd \ 34*4882a593Smuzhiyun --with-dev 35*4882a593Smuzhiyun 36*4882a593SmuzhiyunNUT_CONF_ENV = ax_cv__printf_string_null=yes 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun# For uClibc-based toolchains, nut forgets to link with -lm 39*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y) 40*4882a593SmuzhiyunNUT_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lm" 41*4882a593Smuzhiyunendif 42*4882a593Smuzhiyun 43*4882a593Smuzhiyunifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),) 44*4882a593SmuzhiyunNUT_CONF_OPTS += --with-drivers=all 45*4882a593Smuzhiyunelse 46*4882a593SmuzhiyunNUT_CONF_OPTS += --with-drivers=$(BR2_PACKAGE_NUT_DRIVERS) 47*4882a593Smuzhiyunendif 48*4882a593Smuzhiyun 49*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_DBUS),yy) 50*4882a593SmuzhiyunNUT_DEPENDENCIES += avahi dbus 51*4882a593SmuzhiyunNUT_CONF_OPTS += --with-avahi 52*4882a593Smuzhiyunelse 53*4882a593SmuzhiyunNUT_CONF_OPTS += --without-avahi 54*4882a593Smuzhiyunendif 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun# gd with support for png is required for the CGI 57*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_GD)$(BR2_PACKAGE_LIBPNG),yy) 58*4882a593SmuzhiyunNUT_DEPENDENCIES += gd libpng 59*4882a593SmuzhiyunNUT_CONF_OPTS += --with-cgi 60*4882a593Smuzhiyunelse 61*4882a593SmuzhiyunNUT_CONF_OPTS += --without-cgi 62*4882a593Smuzhiyunendif 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun# nut-scanner needs libltdl, which is a wrapper arounf dlopen/dlsym, 65*4882a593Smuzhiyun# so is not available for static-only builds. 66*4882a593Smuzhiyun# There is no flag to directly enable/disable nut-scanner, it's done 67*4882a593Smuzhiyun# via the --enable/disable-libltdl flag. 68*4882a593Smuzhiyunifeq ($(BR2_STATIC_LIBS):$(BR2_PACKAGE_LIBTOOL),:y) 69*4882a593SmuzhiyunNUT_DEPENDENCIES += libtool 70*4882a593SmuzhiyunNUT_CONF_OPTS += --with-libltdl 71*4882a593Smuzhiyunelse 72*4882a593SmuzhiyunNUT_CONF_OPTS += --without-libltdl 73*4882a593Smuzhiyunendif 74*4882a593Smuzhiyun 75*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y) 76*4882a593SmuzhiyunNUT_DEPENDENCIES += libusb-compat 77*4882a593SmuzhiyunNUT_CONF_OPTS += --with-usb 78*4882a593Smuzhiyunelse 79*4882a593SmuzhiyunNUT_CONF_OPTS += --without-usb 80*4882a593Smuzhiyunendif 81*4882a593Smuzhiyun 82*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NEON_EXPAT)$(BR2_PACKAGE_NEON_LIBXML2),y) 83*4882a593SmuzhiyunNUT_DEPENDENCIES += neon 84*4882a593SmuzhiyunNUT_CONF_OPTS += --with-neon 85*4882a593Smuzhiyunelse 86*4882a593SmuzhiyunNUT_CONF_OPTS += --without-neon 87*4882a593Smuzhiyunendif 88*4882a593Smuzhiyun 89*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NETSNMP),y) 90*4882a593SmuzhiyunNUT_DEPENDENCIES += netsnmp 91*4882a593SmuzhiyunNUT_CONF_OPTS += \ 92*4882a593Smuzhiyun --with-snmp \ 93*4882a593Smuzhiyun --with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config 94*4882a593Smuzhiyunelse 95*4882a593SmuzhiyunNUT_CONF_OPTS += --without-snmp 96*4882a593Smuzhiyunendif 97*4882a593Smuzhiyun 98*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y) 99*4882a593SmuzhiyunNUT_DEPENDENCIES += openssl 100*4882a593SmuzhiyunNUT_CONF_OPTS += --with-ssl 101*4882a593Smuzhiyunelse 102*4882a593SmuzhiyunNUT_CONF_OPTS += --without-ssl 103*4882a593Smuzhiyunendif 104*4882a593Smuzhiyun 105*4882a593Smuzhiyun$(eval $(autotools-package)) 106