Browse Source

package/nut: bump version to 2.8.0

Removed dependency to host-perl, not needed anymore after
https://github.com/networkupstools/nut/commit/3f7d05093ba589e1b05b9a6a88c03637472b5847

Removed autoreconf, the tarball provided by upstream contains a
configure script.

This configure script however adds /usr/local/include to some tests
which fail for us, instead of patching configure.ac and going through
the autoreconf nightmare again we patch the configure script directly.

Added configure option --without-doc

Added more autoreconf variables to fix cross-compile issues.

Changed "--with-drivers=all" to "--with-drivers=auto" because some new
drivers need packages not provided by buildroot, for example:
configure: error: Powerman client libraries not found, required for
 Powerman PDU client driver

Added optional dependency to freeipmi.

Added optional dependency to libusb, for details see
https://github.com/networkupstools/nut/issues/300

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Bernd Kuhls 3 years ago
parent
commit
1ce8640441
2 changed files with 30 additions and 26 deletions
  1. 1 1
      package/nut/nut.hash
  2. 29 25
      package/nut/nut.mk

+ 1 - 1
package/nut/nut.hash

@@ -1,5 +1,5 @@
 # Locally computed
 # Locally computed
-sha256  7129b2df45f9a9df3943f4d09f2b95b5a63d66ca4913431352570206968ca97b  nut-03c3bbe8df9a2caf3c09c120ae7045d35af99b76.tar.gz
+sha256  c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5  nut-2.8.0.tar.gz
 sha256  9f562d0e6be5108a06684dd249686d378abe1653df14b1944e971e084f6751f0  COPYING
 sha256  9f562d0e6be5108a06684dd249686d378abe1653df14b1944e971e084f6751f0  COPYING
 sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  LICENSE-GPL2
 sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  LICENSE-GPL2
 sha256  fc82ca8b6fdb18d4e3e85cfd8ab58d1bcd3f1b29abe782895abd91d64763f8e7  LICENSE-GPL3
 sha256  fc82ca8b6fdb18d4e3e85cfd8ab58d1bcd3f1b29abe782895abd91d64763f8e7  LICENSE-GPL3

+ 29 - 25
package/nut/nut.mk

@@ -4,44 +4,38 @@
 #
 #
 ################################################################################
 ################################################################################
 
 
-NUT_VERSION = 03c3bbe8df9a2caf3c09c120ae7045d35af99b76
-NUT_SITE = $(call github,networkupstools,nut,$(NUT_VERSION))
+NUT_VERSION = 2.8.0
+NUT_SITE = https://github.com/networkupstools/nut/releases/download/v$(NUT_VERSION)
 NUT_LICENSE = GPL-2.0+, GPL-3.0+ (python scripts), GPL/Artistic (perl client)
 NUT_LICENSE = GPL-2.0+, GPL-3.0+ (python scripts), GPL/Artistic (perl client)
 NUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3
 NUT_LICENSE_FILES = COPYING LICENSE-GPL2 LICENSE-GPL3
 NUT_SELINUX_MODULES = apache nut
 NUT_SELINUX_MODULES = apache nut
 NUT_INSTALL_STAGING = YES
 NUT_INSTALL_STAGING = YES
-NUT_DEPENDENCIES = host-pkgconf host-perl
+NUT_DEPENDENCIES = host-pkgconf
 
 
-# From git:
-NUT_AUTORECONF = YES
-
-# Generate files otherwise generated by autogen.sh
-# buildroot does not support augeas, creating an empty file prevents
-# us from adding a dependency to host-python
-define NUT_PREGEN
-	touch $(@D)/scripts/augeas/nutupsconf.aug.in
-	cd $(@D)/tools && PATH=$(BR_PATH) ./nut-usbinfo.pl
+# prevent usage of unsafe paths
+define NUT_FIX_CONFIGURE
+	$(SED) 's%CFLAGS="-isystem /usr/local/include%_UNUSED_CFLAGS="-isystem /usr/local/include%' $(@D)/configure
+	$(SED) 's%CXXFLAGS="-isystem /usr/local/include%_UNUSED_CXXFLAGS="-isystem /usr/local/include%' $(@D)/configure
 endef
 endef
-NUT_PRE_CONFIGURE_HOOKS += NUT_PREGEN
-
-# Race condition in tools generation
-NUT_MAKE = $(MAKE1)
+NUT_POST_PATCH_HOOKS += NUT_FIX_CONFIGURE
 
 
 # Put the PID files in a read-write place (/var/run is a tmpfs)
 # Put the PID files in a read-write place (/var/run is a tmpfs)
 # since the default location (/var/state/ups) maybe readonly.
 # since the default location (/var/state/ups) maybe readonly.
 NUT_CONF_OPTS = \
 NUT_CONF_OPTS = \
 	--with-altpidpath=/var/run/upsd \
 	--with-altpidpath=/var/run/upsd \
-	--with-dev
+	--with-dev \
+	--without-doc
 
 
-NUT_CONF_ENV = ax_cv__printf_string_null=yes
-
-# For uClibc-based toolchains, nut forgets to link with -lm
-ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
-NUT_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) -lm"
-endif
+NUT_CONF_ENV = \
+	ax_cv_check_cflags__Werror__Wno_unknown_warning_option=no \
+	ax_cv_check_cxxflags__Werror__Wno_unknown_warning_option=no \
+	ac_cv_func_strcasecmp=yes \
+	ac_cv_func_strdup=yes \
+	ac_cv_func_strncasecmp=yes \
+	ax_cv__printf_string_null=yes
 
 
 ifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),)
 ifeq ($(call qstrip,$(BR2_PACKAGE_NUT_DRIVERS)),)
-NUT_CONF_OPTS += --with-drivers=all
+NUT_CONF_OPTS += --with-drivers=auto
 else
 else
 NUT_CONF_OPTS += --with-drivers=$(BR2_PACKAGE_NUT_DRIVERS)
 NUT_CONF_OPTS += --with-drivers=$(BR2_PACKAGE_NUT_DRIVERS)
 endif
 endif
@@ -53,6 +47,13 @@ else
 NUT_CONF_OPTS += --without-avahi
 NUT_CONF_OPTS += --without-avahi
 endif
 endif
 
 
+ifeq ($(BR2_PACKAGE_FREEIPMI),y)
+NUT_CONF_OPTS += --with-freeipmi
+NUT_DEPENDENCIES += freeipmi
+else
+NUT_CONF_OPTS += --without-freeipmi
+endif
+
 # gd with support for png is required for the CGI
 # gd with support for png is required for the CGI
 ifeq ($(BR2_PACKAGE_GD)$(BR2_PACKAGE_LIBPNG),yy)
 ifeq ($(BR2_PACKAGE_GD)$(BR2_PACKAGE_LIBPNG),yy)
 NUT_DEPENDENCIES += gd libpng
 NUT_DEPENDENCIES += gd libpng
@@ -72,7 +73,10 @@ else
 NUT_CONF_OPTS += --without-libltdl
 NUT_CONF_OPTS += --without-libltdl
 endif
 endif
 
 
-ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
+ifeq ($(BR2_PACKAGE_LIBUSB),y)
+NUT_DEPENDENCIES += libusb
+NUT_CONF_OPTS += --with-usb
+else ifeq ($(BR2_PACKAGE_LIBUSB_COMPAT),y)
 NUT_DEPENDENCIES += libusb-compat
 NUT_DEPENDENCIES += libusb-compat
 NUT_CONF_OPTS += --with-usb
 NUT_CONF_OPTS += --with-usb
 else
 else