diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-block/spindown/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-block/spindown/files')
-rw-r--r-- | sys-block/spindown/files/spindown-0.4.0-CFLAGS-LDFLAGS.patch | 55 | ||||
-rw-r--r-- | sys-block/spindown/files/spindownd.confd-r1 | 11 | ||||
-rw-r--r-- | sys-block/spindown/files/spindownd.initd-r1 | 61 |
3 files changed, 127 insertions, 0 deletions
diff --git a/sys-block/spindown/files/spindown-0.4.0-CFLAGS-LDFLAGS.patch b/sys-block/spindown/files/spindown-0.4.0-CFLAGS-LDFLAGS.patch new file mode 100644 index 000000000000..9101fbadb59c --- /dev/null +++ b/sys-block/spindown/files/spindown-0.4.0-CFLAGS-LDFLAGS.patch @@ -0,0 +1,55 @@ +diff -urN spindown-0.4.0.orig/Makefile spindown-0.4.0/Makefile +--- spindown-0.4.0.orig/Makefile 2009-04-18 18:32:59.000000000 +0200 ++++ spindown-0.4.0/Makefile 2012-03-11 00:22:07.684197769 +0100 +@@ -4,7 +4,8 @@ + OBJS = main.o diskset.o disk.o spindown.o iniparser.o dictionary.o log.o spindownd.o\ + exceptions.o + CC = g++ +-CFLAGS =-O1 ++CFLAGS += ++LDFLAGS += + SRC = src/ + INPARSER = $(SRC)ininiparser3.0b/ + SRCDIR = spindown-$(VERSION) +@@ -60,31 +61,31 @@ + rm -d -r -f $(SRCDIR) + + spindownd: $(OBJS) +- g++ $(CFLAGS) -o spindownd $(OBJS) ++ g++ $(CFLAGS) $(LDFLAGS) -o spindownd $(OBJS) + + main.o: $(SRC)main.cpp $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)main.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)main.cpp + + diskset.o: $(SRC)diskset.cpp $(SRC)diskset.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)diskset.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)diskset.cpp + + disk.o: $(SRC)disk.cpp $(SRC)disk.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)disk.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)disk.cpp + + spindown.o: $(SRC)spindown.cpp $(SRC)spindown.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)spindown.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)spindown.cpp + + spindownd.o: $(SRC)spindownd.cpp $(SRC)spindownd.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)spindownd.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)spindownd.cpp + + log.o: $(SRC)log.cpp $(SRC)log.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)log.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)log.cpp + + exceptions.o: $(SRC)exceptions.cpp $(SRC)exceptions.h $(SRC)general.h +- g++ $(CFLAGS) -c $(SRC)exceptions.cpp ++ g++ $(CFLAGS) $(LDFLAGS) -c $(SRC)exceptions.cpp + + iniparser.o: $(INPARSER)iniparser.c +- g++ $(CFLAGS) -c $(INPARSER)iniparser.c ++ g++ $(CFLAGS) $(LDFLAGS) -c $(INPARSER)iniparser.c + + dictionary.o: $(INPARSER)dictionary.c +- g++ $(CFLAGS) -c $(INPARSER)dictionary.c ++ g++ $(CFLAGS) $(LDFLAGS) -c $(INPARSER)dictionary.c 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..64a6ec5f73d2 --- /dev/null +++ b/sys-block/spindown/files/spindownd.initd-r1 @@ -0,0 +1,61 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 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} + +extra_started_commands="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 --exec ${SPINDOWND_BIN} --pidfile ${SPINDOWND_PID} \ + --signal HUP + eend $? +} |