From 98cafbd515dcc5a404e1bad85e6d8a8b6515aaa5 Mon Sep 17 00:00:00 2001 From: hasufell Date: Wed, 17 Feb 2016 12:02:48 +0100 Subject: [PATCH] app-admin/verynice: initial import of version 1.1 --- metadata/categories.conf | 1 + .../verynice/files/systemd/verynice.service | 8 ++ packages/app-admin/verynice/files/verynice | 20 +++++ .../verynice/files/verynice-1.1-build.patch | 73 +++++++++++++++++++ .../app-admin/verynice/verynice-1.1.exheres-0 | 34 +++++++++ 5 files changed, 136 insertions(+) create mode 100644 packages/app-admin/verynice/files/systemd/verynice.service create mode 100644 packages/app-admin/verynice/files/verynice create mode 100644 packages/app-admin/verynice/files/verynice-1.1-build.patch create mode 100644 packages/app-admin/verynice/verynice-1.1.exheres-0 diff --git a/metadata/categories.conf b/metadata/categories.conf index fcceabaa..e77be738 100644 --- a/metadata/categories.conf +++ b/metadata/categories.conf @@ -1,3 +1,4 @@ +app-admin app-crypt dev-games dev-libs diff --git a/packages/app-admin/verynice/files/systemd/verynice.service b/packages/app-admin/verynice/files/systemd/verynice.service new file mode 100644 index 00000000..e85ef4c8 --- /dev/null +++ b/packages/app-admin/verynice/files/systemd/verynice.service @@ -0,0 +1,8 @@ +[Unit] +Description=A tool for dynamically adjusting the nice-level of processes + +[Service] +ExecStart=/usr/sbin/verynice + +[Install] +WantedBy=multi-user.target diff --git a/packages/app-admin/verynice/files/verynice b/packages/app-admin/verynice/files/verynice new file mode 100644 index 00000000..165b6c11 --- /dev/null +++ b/packages/app-admin/verynice/files/verynice @@ -0,0 +1,20 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + after checkroot root +} + +start() { + ebegin "Starting verynice" + /usr/sbin/verynice -d /var/run/verynice.pid + eend $? +} + +stop() { + ebegin "Stopping verynice" + start-stop-daemon --stop --quiet --pidfile=/var/run/verynice.pid + eend $? +} diff --git a/packages/app-admin/verynice/files/verynice-1.1-build.patch b/packages/app-admin/verynice/files/verynice-1.1-build.patch new file mode 100644 index 00000000..a70202b9 --- /dev/null +++ b/packages/app-admin/verynice/files/verynice-1.1-build.patch @@ -0,0 +1,73 @@ +From: Julian Ospald +Date: Wed Dec 26 19:46:44 UTC 2012 +Subject: build system + +respect flags, add LDFLAGS to linker line +fix install rules + +--- Makefile ++++ Makefile +@@ -15,13 +15,15 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +-CC = gcc ++CC ?= gcc + + + RPM_BUILD_ROOT= + + # PREFIX is usually either /usr or /usr/local + PREFIX=/usr/local ++BINDIR=$(PREFIX)/sbin ++ETCDIR=/etc + TARGET=linux + + +@@ -32,8 +34,8 @@ + VERSION=1.1 + + #CFLAGS= -I../include/ -O3 -Wimplicit +-CFLAGS= -I../include/ -g -Wimplicit -DPREFIX=\"$(PREFIX)\" -DTARGET_$(TARGET) -DVERSION=\"$(VERSION)\" +-LINK = gcc ++CFLAGS += -Wimplicit ++CPPFLAGS = -I../include/ -DPREFIX=\"$(PREFIX)\" -DTARGET_$(TARGET) -DVERSION=\"$(VERSION)\" + AG = /home3/sdh4/anagram/ag_unix_dev/ag + + +@@ -55,20 +57,15 @@ + (cd .. ; tar cvzf verynice-$(VERSION).tar.gz verynice/ ) + + install: +- $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/sbin +- $(INSTALL) verynice $(RPM_BUILD_ROOT)$(PREFIX)/sbin +- if [ $(PREFIX) = "/usr" ]; then \ +- mv -f $(RPM_BUILD_ROOT)/etc/verynice.conf $(RPM_BUILD_ROOT)/etc/verynice.conf~ ; \ +- $(INSTALL) verynice.conf $(RPM_BUILD_ROOT)/etc ; \ +- else \ +- $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/etc ; \ +- mv -f $(RPM_BUILD_ROOT)$(PREFIX)/etc/verynice.conf $(RPM_BUILD_ROOT)$(PREFIX)/etc/verynice.conf~ ; \ +- $(INSTALL) -m 644 verynice.conf $(RPM_BUILD_ROOT)$(PREFIX)/etc ; \ +- fi ++ $(INSTALL) -d $(RPM_BUILD_ROOT)$(BINDIR) ++ $(INSTALL) verynice $(RPM_BUILD_ROOT)$(BINDIR) ++ $(INSTALL) -d $(RPM_BUILD_ROOT)$(ETCDIR) ++ $(INSTALL) -m 644 verynice.conf $(RPM_BUILD_ROOT)$(ETCDIR) + $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share + $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc + $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION) +- $(INSTALL) -m 644 verynice.html $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION) ++ $(INSTALL) -d $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)/html ++ $(INSTALL) -m 644 verynice.html $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION)/html + $(INSTALL) -m 644 README $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION) + $(INSTALL) -m 644 README.SYN $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION) + $(INSTALL) -m 644 COPYING $(RPM_BUILD_ROOT)$(PREFIX)/share/doc/verynice-$(VERSION) +@@ -95,7 +92,7 @@ + $(AG) $* + + verynice: verynice.o config.o linklist.o stringstack.o +- $(LINK) -g -o $@ $^ -lm ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lm + + + diff --git a/packages/app-admin/verynice/verynice-1.1.exheres-0 b/packages/app-admin/verynice/verynice-1.1.exheres-0 new file mode 100644 index 00000000..e30d5edc --- /dev/null +++ b/packages/app-admin/verynice/verynice-1.1.exheres-0 @@ -0,0 +1,34 @@ +# Copyright 2016 Julian Ospald +# Distributed under the terms of the GNU General Public License v2 + +require systemd-service + +SUMMARY="A tool for dynamically adjusting the nice-level of processes" +HOMEPAGE="http://thermal.cnde.iastate.edu/~sdh4/verynice/" +DOWNLOADS="mirror://gentoo/${PNV}.tar.gz" + +LICENCES="GPL-2" +SLOT="0" +PLATFORMS="~amd64 ~x86" + +WORK=${WORKBASE}/${PN} + +DEFAULT_SRC_PREPARE_PATCHES=( + -p0 "${FILES}"/${PNV}-build.patch +) + +DEFAULT_SRC_COMPILE_PARAMS=( + RPM_BUILD_ROOT="${IMAGE}" PREFIX=/usr +) + +DEFAULT_SRC_INSTALL_PARAMS=( + RPM_BUILD_ROOT="${IMAGE}" BINDIR="/usr/$(exhost --target)/bin" PREFIX=/usr VERSION=${PVR} +) + +src_install(){ + default + exeinto /etc/init.d + doexe "${FILES}"/verynice + install_systemd_files +} +