summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfram Schlich <wschlich@gentoo.org>2009-11-21 15:01:55 +0000
committerWolfram Schlich <wschlich@gentoo.org>2009-11-21 15:01:55 +0000
commitfa766e7c944be2612d39d5c7a32c2fa7ebd3d817 (patch)
tree6b18c490d2b17218f3345d348c0fb9ad83dc7266 /sys-block
parentalpha/ia64/m68k/s390/sh/sparc stable wrt #284088 (diff)
downloadgentoo-2-fa766e7c944be2612d39d5c7a32c2fa7ebd3d817.tar.gz
gentoo-2-fa766e7c944be2612d39d5c7a32c2fa7ebd3d817.tar.bz2
gentoo-2-fa766e7c944be2612d39d5c7a32c2fa7ebd3d817.zip
fix bug #278651
(Portage version: 2.2_rc33/cvs/Linux i686)
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/spindown/ChangeLog9
-rw-r--r--sys-block/spindown/files/spindownd.confd-r111
-rw-r--r--sys-block/spindown/files/spindownd.initd-r161
-rw-r--r--sys-block/spindown/spindown-0.4.0-r1.ebuild46
4 files changed, 126 insertions, 1 deletions
diff --git a/sys-block/spindown/ChangeLog b/sys-block/spindown/ChangeLog
index c4a651bde21f..bb183981c717 100644
--- a/sys-block/spindown/ChangeLog
+++ b/sys-block/spindown/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-block/spindown
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-block/spindown/ChangeLog,v 1.5 2009/09/23 20:33:04 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-block/spindown/ChangeLog,v 1.6 2009/11/21 15:01:55 wschlich Exp $
+
+*spindown-0.4.0-r1 (21 Nov 2009)
+
+ 21 Nov 2009; Wolfram Schlich <wschlich@gentoo.org>
+ +files/spindownd.confd-r1, +files/spindownd.initd-r1,
+ +spindown-0.4.0-r1.ebuild:
+ fix bug #278651
23 Sep 2009; Patrick Lauer <patrick@gentoo.org> spindown-0.4.0.ebuild:
Remove virtual/libc
diff --git a/sys-block/spindown/files/spindownd.confd-r1 b/sys-block/spindown/files/spindownd.confd-r1
new file mode 100644
index 000000000000..cc1f37b86ea2
--- /dev/null
+++ b/sys-block/spindown/files/spindownd.confd-r1
@@ -0,0 +1,11 @@
+# spindownd config file
+# default: /etc/spindown.conf
+#SPINDOWND_CFG=/etc/spindown.conf
+
+# spindownd pidfile
+# default: /var/run/spindown.pid
+#SPINDOWND_PID=/var/run/spindown.pid
+
+# spindownd fifo
+# default: /var/run/spindown.fifo
+#SPINDOWND_FIFO=/var/run/spindown.fifo
diff --git a/sys-block/spindown/files/spindownd.initd-r1 b/sys-block/spindown/files/spindownd.initd-r1
new file mode 100644
index 000000000000..7e1b4617d298
--- /dev/null
+++ b/sys-block/spindown/files/spindownd.initd-r1
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+SPINDOWND_BIN="/usr/sbin/spindownd"
+SPINDOWND_CFG=${SPINDOWND_CFG:-/etc/spindown.conf}
+SPINDOWND_PID=${SPINDOWND_PID:-/var/run/spindown.pid}
+SPINDOWND_FIFO=${SPINDOWND_FIFO:-/var/run/spindown.fifo}
+
+opts="reload"
+
+depend() {
+ need localmount
+ after bootmisc
+}
+
+checkconfig() {
+ # check for config file
+ if [ ! -e "${SPINDOWND_CFG}" ]; then
+ eerror
+ eerror "The spindownd config file (${SPINDOWND_CFG})"
+ eerror "is missing!"
+ eerror
+ return 1
+ fi
+ # check for leftover pidfile
+ if [ -f "${SPINDOWND_PID}" ]; then
+ ewarn
+ ewarn "The spindownd pidfile (${SPINDOWND_PID})"
+ ewarn "exists although the service is not marked as started."
+ ewarn "Will remove the pidfile and start the service in 10s"
+ ewarn "if not interrupted..."
+ ewarn
+ sleep 10
+ if ! rm -f "${SPINDOWND_PID}"; then
+ eerror "Failed to remove the spindownd pidfile (${SPINDOWND_PID})"
+ return 1
+ fi
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting spindownd"
+ start-stop-daemon --start --exec ${SPINDOWND_BIN} \
+ -- -d -c ${SPINDOWND_CFG} -p ${SPINDOWND_PID} -f ${SPINDOWND_FIFO}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spindownd"
+ start-stop-daemon --stop --exec ${SPINDOWND_BIN} --pidfile ${SPINDOWND_PID}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading spindownd configuration"
+ start-stop-daemon --stop --exec ${SPINDOWND_BIN} --pidfile ${SPINDOWND_PID} \
+ --signal HUP
+ eend $?
+}
diff --git a/sys-block/spindown/spindown-0.4.0-r1.ebuild b/sys-block/spindown/spindown-0.4.0-r1.ebuild
new file mode 100644
index 000000000000..31112db1040d
--- /dev/null
+++ b/sys-block/spindown/spindown-0.4.0-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-block/spindown/spindown-0.4.0-r1.ebuild,v 1.1 2009/11/21 15:01:55 wschlich Exp $
+
+inherit eutils
+
+DESCRIPTION="Spindown is a daemon that can spin down idle disks"
+HOMEPAGE="http://code.google.com/p/spindown"
+SRC_URI="http://spindown.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ sys-apps/sg3_utils"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-CFLAGS.patch
+}
+
+src_compile() {
+ emake || die "emake failed"
+}
+
+src_install() {
+ insinto /etc
+ newins spindown.conf.example spindown.conf
+ newinitd "${FILESDIR}"/spindownd.initd-r1 spindownd
+ newconfd "${FILESDIR}"/spindownd.confd-r1 spindownd
+ dosbin spindownd
+ dodoc CHANGELOG README TODO spindown.conf.example
+}
+
+pkg_postinst() {
+ elog "Before starting spindownd the first time"
+ elog "you should modify /etc/spindown.conf"
+ elog
+ elog "To start spindownd by default"
+ elog "you should add it to the default runlevel:"
+ elog " rc-update add spindownd default"
+}