From bc1f2e8c3d4966d416b76acab302d143ce36761d Mon Sep 17 00:00:00 2001 From: Martin Väth Date: Sun, 20 Jan 2019 14:36:04 +0100 Subject: sys-power/nut: Remove. Patches can now reside in portage-env-mv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Väth --- sys-power/nut/Manifest | 1 - sys-power/nut/files/lighttpd_nut.conf-2.2.0 | 22 -- sys-power/nut/files/nut-2.2.2-init.d-upsdrv | 43 ---- .../nut/files/nut-2.6.2-lowspeed-buffer-size.patch | 16 -- sys-power/nut/files/nut-2.6.5-init.d-upsd | 37 --- sys-power/nut/files/nut-2.6.5-init.d-upslog | 30 --- sys-power/nut/files/nut-2.6.5-init.d-upsmon | 29 --- sys-power/nut/files/nut-2.7.1-snmpusb-order.patch | 37 --- .../files/nut-2.7.2/nut-2.7.2-no-libdummy.patch | 13 - sys-power/nut/files/nut.powerfail.initd | 48 ---- sys-power/nut/metadata.xml | 65 ----- sys-power/nut/nut-2.7.4-r2.ebuild | 268 --------------------- 12 files changed, 609 deletions(-) delete mode 100644 sys-power/nut/Manifest delete mode 100644 sys-power/nut/files/lighttpd_nut.conf-2.2.0 delete mode 100644 sys-power/nut/files/nut-2.2.2-init.d-upsdrv delete mode 100644 sys-power/nut/files/nut-2.6.2-lowspeed-buffer-size.patch delete mode 100644 sys-power/nut/files/nut-2.6.5-init.d-upsd delete mode 100644 sys-power/nut/files/nut-2.6.5-init.d-upslog delete mode 100644 sys-power/nut/files/nut-2.6.5-init.d-upsmon delete mode 100644 sys-power/nut/files/nut-2.7.1-snmpusb-order.patch delete mode 100644 sys-power/nut/files/nut-2.7.2/nut-2.7.2-no-libdummy.patch delete mode 100644 sys-power/nut/files/nut.powerfail.initd delete mode 100644 sys-power/nut/metadata.xml delete mode 100644 sys-power/nut/nut-2.7.4-r2.ebuild diff --git a/sys-power/nut/Manifest b/sys-power/nut/Manifest deleted file mode 100644 index 941915e8..00000000 --- a/sys-power/nut/Manifest +++ /dev/null @@ -1 +0,0 @@ -DIST nut-2.7.4.tar.gz 2509831 SHA512 320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a diff --git a/sys-power/nut/files/lighttpd_nut.conf-2.2.0 b/sys-power/nut/files/lighttpd_nut.conf-2.2.0 deleted file mode 100644 index 341ad101..00000000 --- a/sys-power/nut/files/lighttpd_nut.conf-2.2.0 +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Lighttpd configuration for using NUT under Gentoo Linux. -# Copyright 1999-2006 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 -############################################################################### - -# Simple copy this to /etc/lighttpd/ and include it in your lighttpd.conf. -# It will make NUT available at http://$HOST/nut/ - -server.modules += ("mod_cgi") - -# If you want to limit it to some host, uncomment the host check and modify it to your needs. -# $HTTP["host"] == "www2.example.org" { -alias.url += ( "/nut/" => "/usr/share/nut/cgi/" ) -$HTTP["url"] =~ "^/nut/" { - dir-listing.activate = "disable" - cgi.assign = ( ".cgi" => "" ) - index-file.names = ( "upsstats.cgi" ) -} -# } - -# vim: set ft=conf foldmethod=marker et : diff --git a/sys-power/nut/files/nut-2.2.2-init.d-upsdrv b/sys-power/nut/files/nut-2.2.2-init.d-upsdrv deleted file mode 100644 index 01e9b708..00000000 --- a/sys-power/nut/files/nut-2.2.2-init.d-upsdrv +++ /dev/null @@ -1,43 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -extra_commands="stopall startall" - -UPSNAME=${SVCNAME#*.} -msgtext="drivers" -[ "${UPSNAME}" = "${SVCNAME}" ] && UPSNAME='' -[ -n "$UPSNAME" ] && msgtext="driver for $UPSNAME" - -depend() { - before upsd - [ "${UPSNAME}" != '' ] && provide upsdrv -} - -start() { - _dostart "$UPSNAME" "$msgtext" -} -stop() { - _dostop "$UPSNAME" "$msgtext" -} - -startall() { - _dostart "" "$msgtext" -} -stopall() { - _dostop "" "$msgtext" -} - -_dostart() { - ebegin "Starting UPS $msgtext" - /usr/sbin/upsdrvctl start $UPSNAME - eend $? "Failed to start UPS $msgtext!" -} - -_dostop() { - # The pidfile names depend on the actual UPS name - # Not in our control at all - ebegin "Stopping UPS $msgtext" - /usr/sbin/upsdrvctl stop $UPSNAME - eend $? "Failed to stop UPS $msgtext!" -} diff --git a/sys-power/nut/files/nut-2.6.2-lowspeed-buffer-size.patch b/sys-power/nut/files/nut-2.6.2-lowspeed-buffer-size.patch deleted file mode 100644 index 9806d07e..00000000 --- a/sys-power/nut/files/nut-2.6.2-lowspeed-buffer-size.patch +++ /dev/null @@ -1,16 +0,0 @@ -http://bugs.gentoo.org/show_bug.cgi?id=318937 -http://boxster.ghz.cc/projects/nut/changeset/2407 - -Respun from nut-2.4.3-lowspeed-buffer-size.patch - -Index: /trunk/drivers/libhid.c -=================================================================== ---- /trunk/drivers/libhid.c (revision 2336) -+++ /trunk/drivers/libhid.c (revision 2407) -@@ -142,5 +142,5 @@ - int id = pData->ReportID; - int r; -- unsigned char buf[SMALLBUF]; -+ unsigned char buf[8]; /* Maximum size for low-speed USB devices */ - - if (rbuf->ts[id] + age > time(NULL)) { diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upsd b/sys-power/nut/files/nut-2.6.5-init.d-upsd deleted file mode 100644 index 931e9380..00000000 --- a/sys-power/nut/files/nut-2.6.5-init.d-upsd +++ /dev/null @@ -1,37 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2016 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -extra_started_commands="reload" - -pidfile=/var/lib/nut/upsd.pid -bin=/usr/sbin/upsd - -depend() { - use net - before upsmon - after upsdrv -} - -start() { - ebegin "Starting upsd" - # clean up first - pkill -u root,nut -x ${bin} - sleep 1 - rm -f ${pidfile} - # now start up - start-stop-daemon --start --quiet --exec ${bin} - eend $? -} - -stop() { - ebegin "Stopping upsd" - start-stop-daemon --stop --quiet --pidfile ${pidfile} - eend $? -} - -reload() { - ebegin "Reloading upsd" - start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile} - eend $? -} diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upslog b/sys-power/nut/files/nut-2.6.5-init.d-upslog deleted file mode 100644 index 2e07d520..00000000 --- a/sys-power/nut/files/nut-2.6.5-init.d-upslog +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -extra_started_commands="reload" - -pidfile=/var/run/upslog.pid -bin=/usr/bin/upslog - -depend() { - use upsdrv - after upsdrv -} - -start() { - ebegin "Starting upslog" - start-stop-daemon --start --quiet --exec ${bin} - eend $? -} - -stop() { - ebegin "Stopping upslog" - start-stop-daemon --stop --quiet --pidfile ${pidfile} - eend $? -} -reload() { - ebegin "Reloading upslog" - start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile} - eend $? -} diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upsmon b/sys-power/nut/files/nut-2.6.5-init.d-upsmon deleted file mode 100644 index 6e986da0..00000000 --- a/sys-power/nut/files/nut-2.6.5-init.d-upsmon +++ /dev/null @@ -1,29 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2013 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -extra_started_commands="reload" - -pidfile=/var/run/upsmon.pid -bin=/usr/sbin/upsmon - -depend() { - use net -} - -start() { - ebegin "Starting upsmon" - start-stop-daemon --start --quiet --exec ${bin} - eend $? -} - -stop() { - ebegin "Stopping upsmon" - start-stop-daemon --stop --quiet --pidfile ${pidfile} - eend $? -} -reload() { - ebegin "Reloading upsmon" - start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile} - eend $? -} diff --git a/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch b/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch deleted file mode 100644 index e62b6571..00000000 --- a/sys-power/nut/files/nut-2.7.1-snmpusb-order.patch +++ /dev/null @@ -1,37 +0,0 @@ -The code that generates the SNMP and USB headers to compile against does not -have a deterministic order, leading to different results at times. - -Signed-off-by: Robin H. Johnson - -diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-snmpinfo.py nut-2.7.1/tools/nut-snmpinfo.py ---- nut-2.7.1.orig/tools/nut-snmpinfo.py 2014-01-04 19:08:19.117150636 -0800 -+++ nut-2.7.1/tools/nut-snmpinfo.py 2013-07-26 12:41:11.000000000 -0700 -@@ -78,7 +78,9 @@ - output_file.write( "/* SNMP IDs device table */\n" ) - output_file.write( "static snmp_device_id_t snmp_device_table[] = {\n" ) - --for filename in glob.glob('../drivers/*-mib.c'): -+mibs = glob.glob('../drivers/*-mib.c') -+mibs.sort() -+for filename in mibs: - list_of_line = open(filename,'r').read().split(';') - for line in list_of_line: - if "mib2nut_info_t" in line: -diff -Nuar --exclude .libs --exclude '*.o' --exclude core nut-2.7.1.orig/tools/nut-usbinfo.pl nut-2.7.1/tools/nut-usbinfo.pl ---- nut-2.7.1.orig/tools/nut-usbinfo.pl 2014-01-04 19:12:45.595949760 -0800 -+++ nut-2.7.1/tools/nut-usbinfo.pl 2013-11-17 11:27:38.000000000 -0800 -@@ -75,7 +75,12 @@ - - ################# MAIN ################# - --find(\&find_usbdevs,$scanPath); -+find({ -+ wanted => \&find_usbdevs, -+ follow => 1, -+ preprocess => sub { return sort @_ }, -+ }, -+ $scanPath); - &gen_usb_files; - - ################# SUB METHOD ################# - diff --git a/sys-power/nut/files/nut-2.7.2/nut-2.7.2-no-libdummy.patch b/sys-power/nut/files/nut-2.7.2/nut-2.7.2-no-libdummy.patch deleted file mode 100644 index ca0d8be0..00000000 --- a/sys-power/nut/files/nut-2.7.2/nut-2.7.2-no-libdummy.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/drivers/Makefile.am b/drivers/Makefile.am -index 99614ca..42b3611 100644 ---- a/drivers/Makefile.am -+++ b/drivers/Makefile.am -@@ -267,5 +267,6 @@ dist_noinst_HEADERS = apc-mib.h apc-hid.h baytech-mib.h bcmxcp.h \ - - # Define a dummy library so that Automake builds rules for the - # corresponding object files. This library is not actually built, --EXTRA_LIBRARIES = libdummy.a --libdummy_a_SOURCES = main.c dstate.c serial.c -+EXTRA_LIBRARIES = -+#EXTRA_LIBRARIES = libdummy.a -+#libdummy_a_SOURCES = main.c dstate.c serial.c diff --git a/sys-power/nut/files/nut.powerfail.initd b/sys-power/nut/files/nut.powerfail.initd deleted file mode 100644 index 3f2e1a55..00000000 --- a/sys-power/nut/files/nut.powerfail.initd +++ /dev/null @@ -1,48 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2014 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -description='Signal the UPS to kill power in a power failure condition' - -depend() { - # This is only for baselayout2 - if [ -f /etc/init.d/sysfs ]; then - keyword -jail -lxc -openvz -prefix -uml -vserver -xenu -timeout - need mount-ro - fi -} - -start() { - if [ ! -f /etc/init.d/sysfs ]; then - eerror "The $SVCNAME init-script is written for baselayout-2!" - eerror "Please do not use it with baselayout-1!". - return 1 - fi - local UPS_CTL UPS_POWERDOWN - - if [ -f /etc/killpower -o -f /etc/nut/killpower ]; then - UPS_CTL=/sbin/upsdrvctl - UPS_POWERDOWN="${UPS_CTL} shutdown" - elif [ -f /etc/apcupsd/powerfail ]; then - UPS_CTL=/sbin/apcupsd - UPS_POWERDOWN="${UPS_CTL} --killpower" - else - ewarn "UPS powerfail script scheduled, but no poweroff commands found." - return 0 - fi - - if [ -f "${UPS_CTL}" -a -x "${UPS_CTL}" ]; then - ebegin 'Signaling UPS to kill power' - ${UPS_POWERDOWN} - eend $? - - ebegin 'Halt system and wait for the UPS to kill our power' - /sbin/halt -id - # If the sleep gets hit, something is wrong... - # do NOT restart the system. - while [ 1 ]; do sleep 60; done - else - ewarn "UPS powerfail script scheduled, and flags found, but ${UPS_CTL} missing." - fi -} - diff --git a/sys-power/nut/metadata.xml b/sys-power/nut/metadata.xml deleted file mode 100644 index 28063efc..00000000 --- a/sys-power/nut/metadata.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - robbat2@gentoo.org - Robin H. Johnson - - - prometheanfire@gentoo.org - - - Support IPMI-based UPSes. - Driver for Eltek UPS models with AL175 alarm module - Driver for UPSes supporting the serial BCM/XCP protocol - Driver for Belkin serial UPS equipment - Driver for Belkin "Universal UPS" and compatible - Driver for Best Power Fortress/Ferrups - Driver for old Best Fortress UPS equipment - Driver for Best Power Micro-Ferrups - Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment - Driver for multi-purpose UPS emulation - Driver for ETA UPS equipment - Driver for Ever UPS models - Driver for Gamatronic UPS equipment - Driver for contact-closure UPS equipment - Driver for ISBMEX UPS equipment - Driver for Liebert contact-closure UPS equipment - Driver for Liebert UPS, using the ESP-II serial protocol - Driver for Masterguard UPS equipment - Driver for Meta System UPS equipment - Driver for MGE UPS SYSTEMS UTalk protocol equipment - Driver for Microdowell Enterprise UPS series - Driver for SHUT Protocol UPS equipment - Driver for SHUT Protocol UPS equipment (older implementation) - Driver for Oneac UPS equipment - Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment - UPS driver for serial Powercom/Trust/Advice UPS equipment - Driver for Brazilian Microsol RHINO UPS equipment - Driver for SafeNet compatible UPS equipment - Driver for Brazilian Microsol SOLIS UPS equipment - Driver for Tripp-Lite SmartPro UPS equipment - Driver for Tripp-Lite SmartOnline (SU) UPS equipment - Driver for UPScode II compatible UPS equipment - Driver for IMV/Victron UPS unit Match, Match Lite, NetUps - Driver for PowerPanel Plus compatible UPS equipment - Driver for Megatec/Q1 protocol serial based UPS equipment - Fake driver to clone outlets for device grouping - Fake driver to clone outlets for device grouping - driver for the IVT Solar Controller Device - Driver for American Power Conversion Smart Protocol UPS equipment - Driver for American Power Conversion Smart Protocol UPS equipment - Driver for apcupsd client access - Driver for Riello UPS Protocol UPS equipment - Driver for Q* protocol serial and USB based UPS equipment - Driver for USB/HID UPS equipment - Experimental driver for UPSes supporting the BCM/XCP protocol over USB - Driver for older Tripp Lite USB UPSes (not PDC HID) - Driver for Megatec/Q1 protocol USB based UPS equipment - Driver UPS equipment using Richcomm dry-contact to USB solution - Driver for Riello UPS Protocol UPS equipment via USB - Driver for Eaton / MGE Network Management Card / Proxy (XML/HTTP Protocol) equipment - Multi-MIB Driver for SNMP UPS equipment - Driver for IPMI Power Supply Units (PSU) - - diff --git a/sys-power/nut/nut-2.7.4-r2.ebuild b/sys-power/nut/nut-2.7.4-r2.ebuild deleted file mode 100644 index a450cf4d..00000000 --- a/sys-power/nut/nut-2.7.4-r2.ebuild +++ /dev/null @@ -1,268 +0,0 @@ -# Copyright 1999-2018 Gentoo Authors and Martin V\"ath -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -inherit autotools bash-completion-r1 fixheadtails multilib user systemd flag-o-matic toolchain-funcs - -MY_P=${P/_/-} - -DESCRIPTION="Network-UPS Tools" -HOMEPAGE="http://www.networkupstools.org/" -# Nut mirrors are presently broken -SRC_URI="http://random.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz - http://www.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd" - -IUSE="cgi ipmi snmp +usb selinux ssl tcpd xml zeroconf" -DEPEND=" - cgi? ( >=media-libs/gd-2[png] ) - snmp? ( net-analyzer/net-snmp ) - usb? ( virtual/libusb:0 ) - ssl? ( >=dev-libs/openssl-1 ) - tcpd? ( sys-apps/tcp-wrappers ) - xml? ( >=net-libs/neon-0.25.0 ) - ipmi? ( sys-libs/freeipmi ) - zeroconf? ( net-dns/avahi ) - virtual/udev" -BDEPEND=" - virtual/pkgconfig" -RDEPEND="${DEPEND} - !/dev/null - gpasswd -a nut uucp 2>/dev/null - # in some cases on old systems it wasn't in the nut group either! - gpasswd -a nut nut 2>/dev/null - warningmsg ewarn -} - -src_prepare() { - #ht_fix_file configure.in - - eapply "${FILESDIR}/nut-2.7.2/nut-2.7.2-no-libdummy.patch" - eapply -p2 "${FILESDIR}"/${PN}-2.6.2-lowspeed-buffer-size.patch - eapply "${FILESDIR}"/${PN}-2.7.1-snmpusb-order.patch - - sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \ - -e '/systemdsystemunitdir=.*echo.*sed.*libdir/s,^,#,g' \ - -e 's'\''\(systemdsystemshutdowndir="\)${libdir}'\''\1'"${EPREFIX}/lib'" \ - -i configure.ac || die - - sed -e "s:52.nut-usbups.rules:70-nut-usbups.rules:" \ - -i scripts/udev/Makefile.am || die - - rm -f ltmain.sh m4/lt* m4/libtool.m4 - - sed -i \ - -e 's:@LIBSSL_LDFLAGS@:@LIBSSL_LIBS@:' \ - lib/libupsclient{.pc,-config}.in || die #361685 - - default - eautoreconf -} - -src_configure() { - local myconf - append-flags -fno-lto - tc-export CC - tc-export CXX - tc-export AR - - local UPS_DRIVERS="" - for u in $USE ; do - u2=${u#ups_drivers_} - [[ "${u}" != "${u2}" ]] && UPS_DRIVERS="${UPS_DRIVERS} ${u2}" - done - UPS_DRIVERS="${UPS_DRIVERS# }" UPS_DRIVERS="${UPS_DRIVERS% }" - myconf="${myconf} --with-drivers=${UPS_DRIVERS// /,}" - - use cgi && myconf="${myconf} --with-cgipath=/usr/share/nut/cgi" - - # TODO: USE flag for sys-power/powerman - econf \ - --sysconfdir=/etc/nut \ - --datarootdir=/usr/share/nut \ - --datadir=/usr/share/nut \ - --disable-static \ - --with-statepath=/var/lib/nut \ - --with-drvpath=/$(get_libdir)/nut \ - --with-htmlpath=/usr/share/nut/html \ - --with-user=nut \ - --with-group=nut \ - --with-logfacility=LOG_DAEMON \ - --with-dev \ - --with-serial \ - --without-powerman \ - $(use_with cgi) \ - $(use_with ipmi) \ - $(use_with ipmi freeipmi) \ - $(use_with snmp) \ - $(use_with ssl) \ - $(use_with tcpd wrap) \ - $(use_with usb) \ - $(use_with xml neon) \ - $(use_with zeroconf avahi) \ - --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \ - ${myconf} -} - -src_install() { - emake DESTDIR="${ED}" install || die - - find "${ED}" -name '*.la' -exec rm -f {} + - - dodir /sbin - dosym ../usr/sbin/upsdrvctl /sbin/upsdrvctl - - if use cgi; then - elog "CGI monitoring scripts are installed in /usr/share/nut/cgi." - elog "copy them to your web server's ScriptPath to activate (this is a" - elog "change from the old location)." - elog "If you use lighttpd, see lighttpd_nut.conf in the documentation." - fi - - # this must be done after all of the install phases - for i in "${D}"/etc/nut/*.sample ; do - mv "${i}" "${i/.sample/}" - done - - dodoc AUTHORS ChangeLog docs/*.txt MAINTAINERS NEWS README TODO UPGRADING || die - - newdoc lib/README README.lib || die - newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf || die - - docinto cables - dodoc docs/cables/* || die - - newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsd upsd || die - newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv || die - newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsmon upsmon || die - newinitd "${FILESDIR}"/nut-2.6.5-init.d-upslog upslog || die - newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail || die - - keepdir /var/lib/nut - - einfo "Setting up permissions on files and directories" - fperms 0700 /var/lib/nut - fowners nut:nut /var/lib/nut - - # Do not remove eval here, because the variables contain shell expansions. - eval fperms 0640 ${NUT_PRIVATE_FILES} - eval fowners root:nut ${NUT_PRIVATE_FILES} - - # Do not remove eval here, because the variables contain shell expansions. - eval fperms 0644 ${NUT_PUBLIC_FILES} - eval fowners root:root ${NUT_PUBLIC_FILES} - - # Do not remove eval here, because the variables contain shell expansions. - if use cgi; then - eval fperms 0644 ${NUT_CGI_FILES} - eval fowners root:root ${NUT_CGI_FILES} - fi - - # this is installed for 2.4 and fbsd guys - if ! has_version virtual/udev; then - einfo "Installing non-udev hotplug support" - insinto /etc/hotplug/usb - insopts -m 755 - doins scripts/hotplug/nut-usbups.hotplug - fi - - dobashcomp "${S}"/scripts/misc/nut.bash_completion -} - -pkg_postinst() { - # this is to ensure that everybody that installed old versions still has - # correct permissions - - chown nut:nut "${ROOT}"/var/lib/nut 2>/dev/null - chmod 0700 "${ROOT}"/var/lib/nut 2>/dev/null - - # Do not remove eval here, because the variables contain shell expansions. - eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null - eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null - - # Do not remove eval here, because the variables contain shell expansions. - eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null - eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null - - # Do not remove eval here, because the variables contain shell expansions. - if use cgi; then - eval chown root:root "${ROOT}"${NUT_CGI_FILES} 2>/dev/null - eval chmod 0644 "${ROOT}"${NUT_CGI_FILES} 2>/dev/null - fi - - warningmsg elog -} - -warningmsg() { - msgfunc="$1" - [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!" - ${msgfunc} "Please note that NUT now runs under the 'nut' user." - ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS." - ${msgfunc} "However if you use a USB UPS you may need to look at the udev or" - ${msgfunc} "hotplug rules that are installed, and alter them suitably." - ${msgfunc} '' - ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream." - ${msgfunc} '' - ${msgfunc} "Please note that upsdrv is NOT automatically started by upsd anymore." - ${msgfunc} "If you have multiple UPS units, you can use their NUT names to" - ${msgfunc} "have a service per UPS:" - ${msgfunc} "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME" - ${msgfunc} '' - ${msgfunc} 'If you want apcupsd to power off your UPS when it' - ${msgfunc} 'shuts down your system in a power failure, you must' - ${msgfunc} 'add nut.powerfail to your shutdown runlevel:' - ${msgfunc} '' - ${msgfunc} 'rc-update add nut.powerfail shutdown' - ${msgfunc} '' - -} -- cgit v1.2.3-18-g5258