summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-power/nut')
-rw-r--r--sys-power/nut/ChangeLog6
-rw-r--r--sys-power/nut/files/nut-2.4.3-asneeded.patch587
-rw-r--r--sys-power/nut/nut-2.4.3-r2.ebuild3
3 files changed, 594 insertions, 2 deletions
diff --git a/sys-power/nut/ChangeLog b/sys-power/nut/ChangeLog
index 1c98ffd70f80..3ce5cd2958aa 100644
--- a/sys-power/nut/ChangeLog
+++ b/sys-power/nut/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-power/nut
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.77 2010/06/25 17:21:03 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.78 2010/07/01 19:19:30 ssuominen Exp $
+
+ 01 Jul 2010; Samuli Suominen <ssuominen@gentoo.org> nut-2.4.3-r2.ebuild,
+ +files/nut-2.4.3-asneeded.patch:
+ Fix building with -Wl,--as-needed wrt #318481 by Diego E. Pettenò.
25 Jun 2010; Robin H. Johnson <robbat2@gentoo.org>
files/nut.powerfail.initd:
diff --git a/sys-power/nut/files/nut-2.4.3-asneeded.patch b/sys-power/nut/files/nut-2.4.3-asneeded.patch
new file mode 100644
index 000000000000..bd215c79c342
--- /dev/null
+++ b/sys-power/nut/files/nut-2.4.3-asneeded.patch
@@ -0,0 +1,587 @@
+--- clients/Makefile.am
++++ clients/Makefile.am
+@@ -3,7 +3,7 @@
+ # by default, link programs in this directory with libcommon.a
+ LDADD = ../common/libcommon.a libupsclient.la $(NETLIBS)
+ if WITH_SSL
+- LDADD += $(LIBSSL_LDFLAGS)
++ LDADD += $(LIBSSL_LIBS)
+ endif
+
+ # Avoid per-target CFLAGS, because this will prevent re-use of object
+@@ -38,7 +38,7 @@
+ upssched_LDADD = ../common/libcommon.a ../common/libparseconf.la $(NETLIBS)
+
+ upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h
+-upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS)
++upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LIBS)
+
+ upsset_cgi_SOURCES = upsset.c upsclient.h cgilib.c cgilib.h
+ upsstats_cgi_SOURCES = upsstats.c upsclient.h status.h upsstats.h \
+@@ -48,6 +48,6 @@
+ libupsclient_la_SOURCES = upsclient.c upsclient.h
+ libupsclient_la_LIBADD = ../common/libparseconf.la
+ if WITH_SSL
+- libupsclient_la_LIBADD += $(LIBSSL_LDFLAGS)
++ libupsclient_la_LIBADD += $(LIBSSL_LIBS)
+ endif
+ libupsclient_la_LDFLAGS = -version-info 1:0:0
+--- configure.in
++++ configure.in
+@@ -194,7 +194,7 @@
+ solaris2.1* )
+ echo Checking for Solaris 10 / 11 specific configuration for usb drivers
+ AC_SEARCH_LIBS(nanosleep, rt)
+- LIBUSB_LDFLAGS="-R/usr/sfw/lib ${LIBUSB_LDFLAGS}"
++ LIBUSB_LIBS="-R/usr/sfw/lib ${LIBUSB_LIBS}"
+ dnl FIXME: Sun's libusb doesn't support timeout (so blocks notification)
+ dnl and need to call libusb close upon reconnexion
+ AC_DEFINE(SUN_LIBUSB, 1, [Define to 1 for Sun version of the libusb.])
+@@ -742,26 +742,26 @@
+
+ AC_SUBST(OS_NAME)
+ AC_SUBST(LIBSSL_CFLAGS)
+-AC_SUBST(LIBSSL_LDFLAGS)
++AC_SUBST(LIBSSL_LIBS)
+ AC_SUBST(LIBGD_CFLAGS)
+-AC_SUBST(LIBGD_LDFLAGS)
++AC_SUBST(LIBGD_LIBS)
+ AC_SUBST(LIBNETSNMP_CFLAGS)
+-AC_SUBST(LIBNETSNMP_LDFLAGS)
++AC_SUBST(LIBNETSNMP_LIBS)
+ AC_SUBST(LIBUSB_CFLAGS)
+-AC_SUBST(LIBUSB_LDFLAGS)
++AC_SUBST(LIBUSB_LIBS)
+ AC_SUBST(LIBNEON_CFLAGS)
+-AC_SUBST(LIBNEON_LDFLAGS)
++AC_SUBST(LIBNEON_LIBS)
+ AC_SUBST(LIBPOWERMAN_CFLAGS)
+-AC_SUBST(LIBPOWERMAN_LDFLAGS)
++AC_SUBST(LIBPOWERMAN_LIBS)
+ AC_SUBST(LIBWRAP_CFLAGS)
+-AC_SUBST(LIBWRAP_LDFLAGS)
++AC_SUBST(LIBWRAP_LIBS)
+ AC_SUBST(HAL_USER)
+ AC_SUBST(HAL_DEVICE_MATCH_KEY)
+ AC_SUBST(HAL_FDI_PATH)
+ AC_SUBST(HAL_CALLOUTS_PATH)
+ AC_SUBST(HAVE_GLIB_2_14)
+ AC_SUBST(LIBHAL_CFLAGS)
+-AC_SUBST(LIBHAL_LDFLAGS)
++AC_SUBST(LIBHAL_LIBS)
+ AC_SUBST(DRIVER_BUILD_LIST)
+ AC_SUBST(DRIVER_MAN_LIST)
+ AC_SUBST(DRIVER_INSTALL_TARGET)
+--- drivers/Makefile.am
++++ drivers/Makefile.am
+@@ -134,7 +134,7 @@
+ dummy_ups_LDADD = $(LDADD_DRIVERS) ../clients/libupsclient.la
+ if WITH_SSL
+ dummy_ups_CFLAGS += $(LIBSSL_CFLAGS)
+- dummy_ups_LDADD += $(LIBSSL_LDFLAGS)
++ dummy_ups_LDADD += $(LIBSSL_LIBS)
+ endif
+
+ # Clone drivers
+@@ -151,23 +151,23 @@
+ liebert-hid.c mge-hid.c powercom-hid.c tripplite-hid.c
+ usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
+ usb-common.c $(USBHID_UPS_SUBDRIVERS)
+-usbhid_ups_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS)
++usbhid_ups_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+
+ tripplite_usb_SOURCES = tripplite_usb.c libusb.c usb-common.c
+-tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS) -lm
++tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+
+ bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c usb-common.c
+-bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS)
++bcmxcp_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+
+ megatec_usb_SOURCES = megatec.c megatec_usb.c libusb.c usb-common.c
+ megatec_usb_CFLAGS = $(AM_CFLAGS) -DMEGATEC_SUBDRV
+-megatec_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS)
++megatec_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+
+ blazer_usb_SOURCES = blazer.c blazer_usb.c libusb.c usb-common.c
+-blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS) -lm
++blazer_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS) -lm
+
+ richcomm_usb_SOURCES = richcomm_usb.c usb-common.c
+-richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS)
++richcomm_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LIBS)
+
+ # HID-over-serial
+ newmge_shut_SOURCES = usbhid-ups.c libshut.c libhid.c hidparser.c mge-hid.c
+@@ -178,30 +178,30 @@
+ # SNMP
+ snmp_ups_SOURCES = snmp-ups.c apc-mib.c baytech-mib.c compaq-mib.c eaton-mib.c \
+ ietf-mib.c mge-mib.c netvision-mib.c powerware-mib.c raritan-pdu-mib.c
+-snmp_ups_LDADD = $(LDADD_DRIVERS) $(LIBNETSNMP_LDFLAGS)
++snmp_ups_LDADD = $(LDADD_DRIVERS) $(LIBNETSNMP_LIBS)
+
+ # HAL
+ hald_addon_usbhid_ups_SOURCES = usbhid-ups.c libhid.c libusb.c hidparser.c \
+ $(USBHID_UPS_SUBDRIVERS)
+-hald_addon_usbhid_ups_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LDFLAGS) $(LIBHAL_LDFLAGS)
++hald_addon_usbhid_ups_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
+
+ hald_addon_tripplite_usb_SOURCES = tripplite_usb.c libusb.c
+-hald_addon_tripplite_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LDFLAGS) $(LIBHAL_LDFLAGS) -lm
++hald_addon_tripplite_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS) -lm
+
+ hald_addon_bcmxcp_usb_SOURCES = bcmxcp_usb.c bcmxcp.c
+-hald_addon_bcmxcp_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LDFLAGS) $(LIBHAL_LDFLAGS)
++hald_addon_bcmxcp_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
+
+ hald_addon_megatec_usb_SOURCES = megatec.c megatec_usb.c libusb.c
+ hald_addon_megatec_usb_CFLAGS = $(AM_CFLAGS) -DMEGATEC_SUBDRV
+-hald_addon_megatec_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LDFLAGS) $(LIBHAL_LDFLAGS)
++hald_addon_megatec_usb_LDADD = $(LDADD_HAL_DRIVERS) $(LIBUSB_LIBS) $(LIBHAL_LIBS)
+
+ # NEON XML/HTTP
+ netxml_ups_SOURCES = netxml-ups.c mge-xml.c
+-netxml_ups_LDADD = $(LDADD_DRIVERS) $(LIBNEON_LDFLAGS)
++netxml_ups_LDADD = $(LDADD_DRIVERS) $(LIBNEON_LIBS)
+
+ # Powerman
+ powerman_pdu_SOURCES = powerman-pdu.c
+-powerman_pdu_LDADD = $(LDADD) $(LIBPOWERMAN_LDFLAGS)
++powerman_pdu_LDADD = $(LDADD) $(LIBPOWERMAN_LIBS)
+
+ # ----------------------------------------------------------------------
+ # List of header files. The purpose of this list is not dependency
+--- m4/nut_check_libgd.m4
++++ m4/nut_check_libgd.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBGD compiler flags. On success, set nut_have_libgd="yes"
+-dnl and set LIBGD_CFLAGS and LIBGD_LDFLAGS. On failure, set
++dnl and set LIBGD_CFLAGS and LIBGD_LIBS. On failure, set
+ dnl nut_have_libgd="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -9,14 +9,14 @@
+ nut_have_libgd_seen=yes
+
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+ LIBS_ORIG="${LIBS}"
+
+ dnl Initial defaults. These are only used if gdlib-config is
+ dnl unusable and the user fails to pass better values in --with
+ dnl arguments
+ CFLAGS=""
+- LDFLAGS="-L/usr/X11R6/lib"
++ LIBS="-L/usr/X11R6/lib"
+ LIBS="-lgd -lpng -lz -ljpeg -lfreetype -lm -lXpm -lX11"
+
+ AC_MSG_CHECKING(for gd version via gdlib-config)
+@@ -37,7 +37,7 @@
+ ;;
+ *)
+ CFLAGS="`gdlib-config --includes`"
+- LDFLAGS="`gdlib-config --ldflags`"
++ LIBS="`gdlib-config --ldflags`"
+ LIBS="`gdlib-config --libs`"
+ ;;
+ esac
+@@ -51,9 +51,9 @@
+
+ AC_MSG_CHECKING(for gd library flags)
+ AC_ARG_WITH(gd-libs, [
+- AC_HELP_STRING([--with-gd-libs=LDFLAGS], [linker flags for the gd library])
+- ], [LDFLAGS="${withval}" LIBS=""], [])
+- AC_MSG_RESULT([${LDFLAGS} ${LIBS}])
++ AC_HELP_STRING([--with-gd-libs=LIBS], [linker flags for the gd library])
++ ], [LIBS="${withval}" LIBS=""], [])
++ AC_MSG_RESULT([${LIBS} ${LIBS}])
+
+ dnl check if gd is usable
+ AC_CHECK_HEADERS(gd.h gdfontmb.h, [nut_have_libgd=yes], [nut_have_libgd=no], [AC_INCLUDES_DEFAULT])
+@@ -62,12 +62,12 @@
+ if test "${nut_have_libgd}" = "yes"; then
+ AC_DEFINE(HAVE_LIBGD, 1, [Define if you have Boutell's libgd installed])
+ LIBGD_CFLAGS="${CFLAGS}"
+- LIBGD_LDFLAGS="${LDFLAGS} ${LIBS}"
++ LIBGD_LIBS="${LIBS} ${LIBS}"
+ fi
+
+ dnl put back the original versions
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+ LIBS="${LIBS_ORIG}"
+ fi
+ ])
+--- m4/nut_check_libhal.m4
++++ m4/nut_check_libhal.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBHAL compiler flags. On success, set nut_have_libhal="yes"
+-dnl and set LIBHAL_CFLAGS and LIBHAL_LDFLAGS. On failure, set
++dnl and set LIBHAL_CFLAGS and LIBHAL_LIBS. On failure, set
+ dnl nut_have_libhal="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+ dnl NUT requires HAL version 0.5.8 at least
+@@ -10,7 +10,7 @@
+ nut_have_libhal_seen=yes
+
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ AC_MSG_CHECKING(for libhal version via pkg-config (0.5.8 minimum required))
+ HAL_VERSION=`pkg-config --silence-errors --modversion hal`
+@@ -31,9 +31,9 @@
+
+ dnl also get libs from glib-2.0 to workaround a bug in dbus-glib
+ AC_MSG_CHECKING(for libhal ldflags via pkg-config)
+- LDFLAGS=`pkg-config --silence-errors --libs hal dbus-glib-1`
++ LIBS=`pkg-config --silence-errors --libs hal dbus-glib-1`
+ if test "$?" = "0"; then
+- AC_MSG_RESULT(${LDFLAGS})
++ AC_MSG_RESULT(${LIBS})
+ else
+ AC_MSG_RESULT(not found)
+ nut_have_libhal=no
+@@ -50,7 +50,7 @@
+ dnl try again using defaults if pkg-config is not available
+ if test "${nut_have_libhal}" = "check"; then
+ CFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/hal -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include"
+- LDFLAGS="-lhal -ldbus-1 -lpthread"
++ LIBS="-lhal -ldbus-1 -lpthread"
+
+ AC_CHECK_HEADERS(libhal.h, [nut_have_libhal=yes], [nut_have_libhal=no], [AC_INCLUDES_DEFAULT])
+ AC_CHECK_FUNCS(libhal_device_new_changeset, [], [nut_have_libhal=no])
+@@ -58,7 +58,7 @@
+
+ if test "${nut_have_libhal}" = "yes"; then
+ LIBHAL_CFLAGS="${CFLAGS}"
+- LIBHAL_LDFLAGS="${LDFLAGS}"
++ LIBHAL_LIBS="${LIBS}"
+
+ dnl this will only work as of HAL 0.5.9
+ AC_MSG_CHECKING(for libhal user via pkg-config)
+@@ -124,7 +124,7 @@
+ fi
+
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+
+ dnl - test for g_timeout_add_seconds availability
+ AC_MSG_CHECKING([if GLib is version 2.14.0 or newer])
+--- m4/nut_check_libneon.m4
++++ m4/nut_check_libneon.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBNEON compiler flags. On success, set nut_have_neon="yes"
+-dnl and set LIBNEON_CFLAGS and LIBNEON_LDFLAGS. On failure, set
++dnl and set LIBNEON_CFLAGS and LIBNEON_LIBS. On failure, set
+ dnl nut_have_neon="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -8,9 +8,9 @@
+ if test -z "${nut_have_neon_seen}"; then
+ nut_have_neon_seen=yes
+
+- dnl save CFLAGS and LDFLAGS
++ dnl save CFLAGS and LIBS
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ dnl See which version of the neon library (if any) is installed
+ AC_MSG_CHECKING(for libneon version via pkg-config (0.25.0 minimum required))
+@@ -29,9 +29,9 @@
+
+ AC_MSG_CHECKING(for libneon ldflags)
+ AC_ARG_WITH(neon-libs, [
+- AC_HELP_STRING([--with-neon-libs=LDFLAGS], [linker flags for the neon library])
+- ], [LDFLAGS="${withval}"], [LDFLAGS="`pkg-config --silence-errors --libs neon`"])
+- AC_MSG_RESULT([${LDFLAGS}])
++ AC_HELP_STRING([--with-neon-libs=LIBS], [linker flags for the neon library])
++ ], [LIBS="${withval}"], [LIBS="`pkg-config --silence-errors --libs neon`"])
++ AC_MSG_RESULT([${LIBS}])
+
+ dnl check if neon is usable
+ AC_CHECK_HEADERS(ne_xmlreq.h, [nut_have_neon=yes], [nut_have_neon=no], [AC_INCLUDES_DEFAULT])
+@@ -41,11 +41,11 @@
+ dnl Check for connect timeout support in library (optional)
+ AC_CHECK_FUNCS(ne_set_connect_timeout ne_sock_connect_timeout)
+ LIBNEON_CFLAGS="${CFLAGS}"
+- LIBNEON_LDFLAGS="${LDFLAGS}"
++ LIBNEON_LIBS="${LIBS}"
+ fi
+
+- dnl restore original CFLAGS and LDFLAGS
++ dnl restore original CFLAGS and LIBS
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+ fi
+ ])
+--- m4/nut_check_libnetsnmp.m4
++++ m4/nut_check_libnetsnmp.m4
+@@ -1,6 +1,6 @@
+ dnl Check for LIBNETSNMP compiler flags. On success, set
+ dnl nut_have_libnetsnmp="yes" and set LIBNETSNMP_CFLAGS and
+-dnl LIBNETSNMP_LDFLAGS. On failure, set nut_have_libnetsnmp="no".
++dnl LIBNETSNMP_LIBS. On failure, set nut_have_libnetsnmp="no".
+ dnl This macro can be run multiple times, but will do the checking only
+ dnl once.
+
+@@ -9,9 +9,9 @@
+ if test -z "${nut_have_libnetsnmp_seen}"; then
+ nut_have_libnetsnmp_seen=yes
+
+- dnl save CFLAGS and LDFLAGS
++ dnl save CFLAGS and LIBS
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ dnl See which version of the Net-SNMP library (if any) is installed
+ AC_MSG_CHECKING(for Net-SNMP version via net-snmp-config)
+@@ -30,9 +30,9 @@
+
+ AC_MSG_CHECKING(for Net-SNMP libs)
+ AC_ARG_WITH(snmp-libs, [
+- AC_HELP_STRING([--with-snmp-libs=LDFLAGS], [linker flags for the Net-SNMP library])
+- ], [LDFLAGS="${withval}"], [LDFLAGS="`net-snmp-config --libs 2>/dev/null`"])
+- AC_MSG_RESULT([${LDFLAGS}])
++ AC_HELP_STRING([--with-snmp-libs=LIBS], [linker flags for the Net-SNMP library])
++ ], [LIBS="${withval}"], [LIBS="`net-snmp-config --libs 2>/dev/null`"])
++ AC_MSG_RESULT([${LIBS}])
+
+ dnl Check if the Net-SNMP library is usable
+ AC_CHECK_HEADERS(net-snmp/net-snmp-config.h, [nut_have_libnetsnmp=yes], [nut_have_libnetsnmp=no], [AC_INCLUDES_DEFAULT])
+@@ -40,11 +40,11 @@
+
+ if test "${nut_have_libnetsnmp}" = "yes"; then
+ LIBNETSNMP_CFLAGS="${CFLAGS}"
+- LIBNETSNMP_LDFLAGS="${LDFLAGS}"
++ LIBNETSNMP_LIBS="${LIBS}"
+ fi
+
+- dnl restore original CFLAGS and LDFLAGS
++ dnl restore original CFLAGS and LIBS
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+ fi
+ ])
+--- m4/nut_check_libpowerman.m4
++++ m4/nut_check_libpowerman.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBPOWERMAN compiler flags. On success, set nut_have_libpowerman="yes"
+-dnl and set LIBPOWERMAN_CFLAGS and LIBPOWERMAN_LDFLAGS. On failure, set
++dnl and set LIBPOWERMAN_CFLAGS and LIBPOWERMAN_LIBS. On failure, set
+ dnl nut_have_libpowerman="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -8,9 +8,9 @@
+ if test -z "${nut_have_libpowerman_seen}"; then
+ nut_have_libpowerman_seen=yes
+
+- dnl save CFLAGS and LDFLAGS
++ dnl save CFLAGS and LIBS
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ AC_MSG_CHECKING(for libpowerman cflags)
+ AC_ARG_WITH(powerman-includes, [
+@@ -20,9 +20,9 @@
+
+ AC_MSG_CHECKING(for libpowerman libs)
+ AC_ARG_WITH(powerman-libs, [
+- AC_HELP_STRING([--with-powerman-libs=LDFLAGS], [linker flags for the libpowerman library])
+- ], [LDFLAGS="${withval}"], [LDFLAGS="`pkg-config --silence-errors --libs libpowerman`"])
+- AC_MSG_RESULT([${LDFLAGS}])
++ AC_HELP_STRING([--with-powerman-libs=LIBS], [linker flags for the libpowerman library])
++ ], [LIBS="${withval}"], [LIBS="`pkg-config --silence-errors --libs libpowerman`"])
++ AC_MSG_RESULT([${LIBS}])
+
+ dnl check if libpowerman is usable
+ AC_CHECK_HEADERS(libpowerman.h, [nut_have_libpowerman=yes], [nut_have_libpowerman=no], [AC_INCLUDES_DEFAULT])
+@@ -30,12 +30,12 @@
+
+ if test "${nut_have_libpowerman}" = "yes"; then
+ LIBPOWERMAN_CFLAGS="${CFLAGS}"
+- LIBPOWERMAN_LDFLAGS="${LDFLAGS}"
++ LIBPOWERMAN_LIBS="${LIBS}"
+ fi
+
+- dnl restore original CFLAGS and LDFLAGS
++ dnl restore original CFLAGS and LIBS
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+
+ fi
+ ])
+--- m4/nut_check_libssl.m4
++++ m4/nut_check_libssl.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBSSL compiler flags. On success, set nut_have_libssl="yes"
+-dnl and set LIBSSL_CFLAGS and LIBSSL_LDFLAGS. On failure, set
++dnl and set LIBSSL_CFLAGS and LIBSSL_LIBS. On failure, set
+ dnl nut_have_libssl="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -8,20 +8,20 @@
+ if test -z "${nut_have_libssl_seen}"; then
+ nut_have_libssl_seen=yes
+
+- dnl save CFLAGS and LDFLAGS
++ dnl save CFLAGS and LIBS
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ AC_MSG_CHECKING(for openssl version via pkg-config)
+ OPENSSL_VERSION=`pkg-config --silence-errors --modversion openssl`
+ if test "$?" = "0"; then
+ AC_MSG_RESULT(${OPENSSL_VERSION} found)
+ CFLAGS="`pkg-config --silence-errors --cflags openssl`"
+- LDFLAGS="`pkg-config --silence-errors --libs openssl`"
++ LIBS="`pkg-config --silence-errors --libs openssl`"
+ else
+ AC_MSG_RESULT(not found)
+ CFLAGS=""
+- LDFLAGS="-lssl -lcrypto"
++ LIBS="-lssl -lcrypto"
+ fi
+
+ dnl allow overriding openssl settings if the user knows best
+@@ -33,9 +33,9 @@
+
+ AC_MSG_CHECKING(for openssl ldflags)
+ AC_ARG_WITH(ssl-libs, [
+- AC_HELP_STRING([--with-ssl-libs=LDFLAGS], [linker flags for the OpenSSL library])
+- ], [LDFLAGS="${withval}"], [])
+- AC_MSG_RESULT([${LDFLAGS}])
++ AC_HELP_STRING([--with-ssl-libs=LIBS], [linker flags for the OpenSSL library])
++ ], [LIBS="${withval}"], [])
++ AC_MSG_RESULT([${LIBS}])
+
+ dnl check if openssl is usable
+ AC_CHECK_HEADERS(openssl/ssl.h, [nut_have_libssl=yes], [nut_have_libssl=no], [AC_INCLUDES_DEFAULT])
+@@ -44,11 +44,11 @@
+ if test "${nut_have_libssl}" = "yes"; then
+ AC_DEFINE(HAVE_SSL, 1, [Define to enable SSL development code])
+ LIBSSL_CFLAGS="${CFLAGS}"
+- LIBSSL_LDFLAGS="${LDFLAGS}"
++ LIBSSL_LIBS="${LIBS}"
+ fi
+
+- dnl restore original CFLAGS and LDFLAGS
++ dnl restore original CFLAGS and LIBS
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+ fi
+ ])
+--- m4/nut_check_libusb.m4
++++ m4/nut_check_libusb.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBUSB compiler flags. On success, set nut_have_libusb="yes"
+-dnl and set LIBUSB_CFLAGS and LIBUSB_LDFLAGS. On failure, set
++dnl and set LIBUSB_CFLAGS and LIBUSB_LIBS. On failure, set
+ dnl nut_have_libusb="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -8,27 +8,27 @@
+ if test -z "${nut_have_libusb_seen}"; then
+ nut_have_libusb_seen=yes
+
+- dnl save CFLAGS and LDFLAGS
++ dnl save CFLAGS and LIBS
+ CFLAGS_ORIG="${CFLAGS}"
+- LDFLAGS_ORIG="${LDFLAGS}"
++ LIBS_ORIG="${LIBS}"
+
+ AC_MSG_CHECKING(for libusb version via pkg-config)
+ LIBUSB_VERSION=`pkg-config --silence-errors --modversion libusb`
+ if test "$?" = "0"; then
+ AC_MSG_RESULT(${LIBUSB_VERSION} found)
+ CFLAGS="`pkg-config --silence-errors --cflags libusb`"
+- LDFLAGS="`pkg-config --silence-errors --libs libusb`"
++ LIBS="`pkg-config --silence-errors --libs libusb`"
+ else
+ AC_MSG_CHECKING(via libusb-config)
+ LIBUSB_VERSION=`libusb-config --version 2>/dev/null`
+ if test "$?" = "0"; then
+ AC_MSG_RESULT(${LIBUSB_VERSION} found)
+ CFLAGS="`libusb-config --cflags 2>/dev/null`"
+- LDFLAGS="`libusb-config --libs 2>/dev/null`"
++ LIBS="`libusb-config --libs 2>/dev/null`"
+ else
+ AC_MSG_RESULT(not found)
+ CFLAGS=""
+- LDFLAGS="-lusb"
++ LIBS="-lusb"
+ fi
+ fi
+
+@@ -40,9 +40,9 @@
+
+ AC_MSG_CHECKING(for libusb ldflags)
+ AC_ARG_WITH(usb-libs, [
+- AC_HELP_STRING([--with-usb-libs=LDFLAGS], [linker flags for the libusb library])
+- ], [LDFLAGS="${withval}"], [])
+- AC_MSG_RESULT([${LDFLAGS}])
++ AC_HELP_STRING([--with-usb-libs=LIBS], [linker flags for the libusb library])
++ ], [LIBS="${withval}"], [])
++ AC_MSG_RESULT([${LIBS}])
+
+ dnl check if libusb is usable
+ AC_CHECK_HEADERS(usb.h, [nut_have_libusb=yes], [nut_have_libusb=no], [AC_INCLUDES_DEFAULT])
+@@ -52,11 +52,11 @@
+ dnl Check for libusb "force driver unbind" availability
+ AC_CHECK_FUNCS(usb_detach_kernel_driver_np)
+ LIBUSB_CFLAGS="${CFLAGS}"
+- LIBUSB_LDFLAGS="${LDFLAGS}"
++ LIBUSB_LIBS="${LIBS}"
+ fi
+
+- dnl restore original CFLAGS and LDFLAGS
++ dnl restore original CFLAGS and LIBS
+ CFLAGS="${CFLAGS_ORIG}"
+- LDFLAGS="${LDFLAGS_ORIG}"
++ LIBS="${LIBS_ORIG}"
+ fi
+ ])
+--- m4/nut_check_libwrap.m4
++++ m4/nut_check_libwrap.m4
+@@ -1,5 +1,5 @@
+ dnl Check for LIBWRAP compiler flags. On success, set nut_have_libwrap="yes"
+-dnl and set LIBWRAP_CFLAGS and LIBWRAP_LDFLAGS. On failure, set
++dnl and set LIBWRAP_CFLAGS and LIBWRAP_LIBS. On failure, set
+ dnl nut_have_libwrap="no". This macro can be run multiple times, but will
+ dnl do the checking only once.
+
+@@ -39,7 +39,7 @@
+ if test "${nut_have_libwrap}" = "yes"; then
+ AC_DEFINE(HAVE_WRAP, 1, [Define to enable libwrap support])
+ LIBWRAP_CFLAGS=""
+- LIBWRAP_LDFLAGS="${LIBS}"
++ LIBWRAP_LIBS="${LIBS}"
+ fi
+
+ dnl restore original LIBS
+--- server/Makefile.am
++++ server/Makefile.am
+@@ -12,10 +12,10 @@
+ endif
+ LDADD = ../common/libcommon.a ../common/libparseconf.la $(NETLIBS)
+ if WITH_WRAP
+- LDADD += $(LIBWRAP_LDFLAGS)
++ LDADD += $(LIBWRAP_LIBS)
+ endif
+ if WITH_SSL
+- LDADD += $(LIBSSL_LDFLAGS)
++ LDADD += $(LIBSSL_LIBS)
+ endif
+
+ sbin_PROGRAMS = upsd
diff --git a/sys-power/nut/nut-2.4.3-r2.ebuild b/sys-power/nut/nut-2.4.3-r2.ebuild
index 5c7647475bab..b45f8c05fa1e 100644
--- a/sys-power/nut/nut-2.4.3-r2.ebuild
+++ b/sys-power/nut/nut-2.4.3-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.4.3-r2.ebuild,v 1.3 2010/06/22 20:07:21 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.4.3-r2.ebuild,v 1.4 2010/07/01 19:19:30 ssuominen Exp $
EAPI="2"
@@ -57,6 +57,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-2.4.1-no-libdummy.patch
epatch "${FILESDIR}"/${PN}-2.4.3-lowspeed-buffer-size.patch
+ epatch "${FILESDIR}"/${PN}-2.4.3-asneeded.patch
sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
-i configure.in || die "sed failed"