diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-10-21 22:06:43 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2011-10-21 22:06:43 +0000 |
commit | d5e7726d8ce5ba324a5fa13b5b93fc1873a35c78 (patch) | |
tree | 06046c8a0a871fd46331a7ff2eac7cdc1bda9bae /sys-power | |
parent | media-gfx/imageworsener: Bring back support for webp images (bug #387761) (diff) | |
download | gentoo-2-d5e7726d8ce5ba324a5fa13b5b93fc1873a35c78.tar.gz gentoo-2-d5e7726d8ce5ba324a5fa13b5b93fc1873a35c78.tar.bz2 gentoo-2-d5e7726d8ce5ba324a5fa13b5b93fc1873a35c78.zip |
Simplify init script with the new declarative runscript.
(Portage version: 2.2.0_alpha69/cvs/Linux x86_64)
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/apcupsd/ChangeLog | 8 | ||||
-rw-r--r-- | sys-power/apcupsd/apcupsd-3.14.10-r1.ebuild (renamed from sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild) | 6 | ||||
-rw-r--r-- | sys-power/apcupsd/apcupsd-3.14.7.ebuild | 136 | ||||
-rw-r--r-- | sys-power/apcupsd/files/apcupsd.init.3 | 28 |
4 files changed, 38 insertions, 140 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog index 764f673f580b..6f1780156e7f 100644 --- a/sys-power/apcupsd/ChangeLog +++ b/sys-power/apcupsd/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-power/apcupsd # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.76 2011/10/20 16:39:01 ranger Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.77 2011/10/21 22:06:43 flameeyes Exp $ + +*apcupsd-3.14.10-r1 (21 Oct 2011) + + 21 Oct 2011; Diego E. Pettenò <flameeyes@gentoo.org> -apcupsd-3.14.7.ebuild, + -apcupsd-3.14.9-r1.ebuild, +apcupsd-3.14.10-r1.ebuild, +files/apcupsd.init.3: + Simplify init script with the new declarative runscript. 20 Oct 2011; Brent Baude <ranger@gentoo.org> apcupsd-3.14.8-r1.ebuild: Marking apcupsd-3.14.8-r1 ppc for bug 363087 diff --git a/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild b/sys-power/apcupsd/apcupsd-3.14.10-r1.ebuild index 90aca78e0249..604bb1616e50 100644 --- a/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild +++ b/sys-power/apcupsd/apcupsd-3.14.10-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.9-r1.ebuild,v 1.1 2011/08/26 10:53:51 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r1.ebuild,v 1.1 2011/10/21 22:06:43 flameeyes Exp $ EAPI=4 @@ -37,7 +37,7 @@ pkg_setup() { } src_prepare() { - epatch "${FILESDIR}/${P}-aliasing.patch" + epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch" } src_configure() { @@ -88,7 +88,7 @@ src_install() { dohtml -r doc/manual/* rm "${D}"/etc/init.d/apcupsd - newinitd "${FILESDIR}/${PN}.init.2" "${PN}" + newinitd "${FILESDIR}/${PN}.init.3" "${PN}" newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail # remove hal settings, we don't really want to have it around still. diff --git a/sys-power/apcupsd/apcupsd-3.14.7.ebuild b/sys-power/apcupsd/apcupsd-3.14.7.ebuild deleted file mode 100644 index 455909daad55..000000000000 --- a/sys-power/apcupsd/apcupsd-3.14.7.ebuild +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.7.ebuild,v 1.11 2011/08/29 13:38:55 flameeyes Exp $ - -WEBAPP_MANUAL_SLOT="yes" -WEBAPP_OPTIONAL="yes" -inherit eutils webapp linux-info - -DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown" -HOMEPAGE="http://www.apcupsd.org/" -SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 ppc x86 ~x86-fbsd" -IUSE="snmp usb cgi nls gnome kernel_linux" - -DEPEND=" - cgi? ( >=media-libs/gd-1.8.4 - ${WEBAPP_DEPEND} ) - nls? ( sys-devel/gettext ) - snmp? ( net-analyzer/net-snmp ) - gnome? ( =x11-libs/gtk+-2* - =dev-libs/glib-2* - >=gnome-base/gconf-2.0 )" -RDEPEND="${DEPEND} - virtual/mailx" - -pkg_setup() { - use cgi && webapp_pkg_setup - - if use kernel_linux && - use usb && - linux_config_exists && - !linux_chkconfig_present USB_HIDDEV; then - ewarn "Note: to be able to use the USB support for ${PN} you're going to need" - ewarn "the CONFIG_USB_HIDDEV option enabled in your kernel." - ewarn "The option hasn't been found enabled, do so before trying to use" - ewarn "${PN} with USB UPSes." - fi -} - -src_compile() { - local myconf - use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=${MY_CGIBINDIR}" - if use usb; then - myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= " - else - myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb" - fi - - # We force the DISTNAME to gentoo so it will use gentoo's layout also - # when installed on non-linux systems. - econf \ - --sbindir=/sbin \ - --sysconfdir=/etc/apcupsd \ - --with-pwrfail-dir=/etc/apcupsd \ - --with-lock-dir=/var/lock \ - --with-pid-dir=/var/run \ - --with-log-dir=/var/log \ - --with-nis-port=3551 \ - --enable-net --enable-pcnet \ - --with-distname=gentoo \ - $(use_enable snmp net-snmp) \ - $(use_enable gnome gapcmon) \ - ${myconf} \ - APCUPSD_MAIL=/bin/mail \ - || die "econf failed" - - # Workaround for bug #280674; upstream should really just provide - # the text files in the distribution, but I wouldn't count on them - # doing that anytime soon. - MANPAGER=$(type -p cat) \ - emake || die "emake failed" -} - -src_install() { - use cgi && webapp_src_preinst - - emake DESTDIR="${D}" install || die "installed failed" - rm -f "${D}"/etc/init.d/halt - - insinto /etc/apcupsd - newins examples/safe.apccontrol safe.apccontrol - - dodoc ChangeLog* ReleaseNotes - doman doc/*.8 doc/*.5 || die "doman failed" - - dohtml -r doc/manual/* || die "dodoc failed" - - use cgi && webapp_src_install - - rm "${D}"/etc/init.d/apcupsd - newinitd "${FILESDIR}/${PN}.init.2a" "${PN}" || die "newinitd failed" - - if has_version sys-apps/openrc; then - newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail || die "newinitd failed" - fi - - # Without this it'll crash at startup. When merging in ROOT= this - # won't be created by default, so we want to make sure we got it! - keepdir /var/lock - fowners root:uucp /var/lock - fperms 0775 /var/lock -} - -pkg_postinst() { - if use cgi; then - elog "If you are upgrading from a previous version, please note" - elog "that the CGI interface is now installed using webapp-config." - elog "/var/www/apcupsd is no longer present." - webapp_pkg_postinst - fi - - elog "" - elog "Since version 3.14.0 you can use multiple apcupsd instances to" - elog "control more than one UPS in a single box." - elog "To do this, create a link between /etc/init.d/apcupsd to a new" - elog "/etc/init.d/apcupsd.something, and it will then load the" - elog "configuration file at /etc/apcupsd/something.conf." - elog "" - - if [ -d "${ROOT}"/etc/runlevels/shutdown -a \ - ! -e "${ROOT}"/etc/runlevels/shutdown/"${PN}".powerfail ] ; then - elog 'If you want apcupsd to power off your UPS when it' - elog 'shuts down your system in a power failure, you must' - elog 'add apcupsd.powerfail to your shutdown runlevel:' - elog '' - elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m' - elog '' - fi -} - -pkg_prerm() { - use cgi && webapp_pkg_prerm -} diff --git a/sys-power/apcupsd/files/apcupsd.init.3 b/sys-power/apcupsd/files/apcupsd.init.3 new file mode 100644 index 000000000000..52787612fea8 --- /dev/null +++ b/sys-power/apcupsd/files/apcupsd.init.3 @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.3,v 1.1 2011/10/21 22:06:43 flameeyes Exp $ + +INSTANCE="${SVCNAME#*.}" +if [ -z "${INSTANCE}" -o "${SVCNAME}" = "apcupsd" ]; then + INSTANCE="apcupsd" +fi + +name="APC UPS Daemon" + +pidfile=/var/run/${SVCNAME}.pid + +command=/sbin/apcupsd +command_args="-f /etc/apcupsd/${INSTANCE}.conf -P ${pidfile}" +start_stop_daemon_args="--wait 300 --retry TERM/5/TERM/5" + +depend() { + use net + after udev +} + +start_pre() { + rm -f /etc/apcupsd/powerfail + + export SERVICE="${SVCNAME}" +} |