From 2cb6f9373d0696eefcc6dd81a0bbe2bc32eab952 Mon Sep 17 00:00:00 2001 From: bougyman Date: Sun, 12 Apr 2015 13:57:32 -0500 Subject: [PATCH] preload: disable i686 and remove sv-helper dependency --- srcpkgs/preload/files/preload/log/run | 56 ++++++++++++++++++++++++++- srcpkgs/preload/files/preload/run | 2 +- srcpkgs/preload/template | 4 +- 3 files changed, 58 insertions(+), 4 deletions(-) mode change 120000 => 100755 srcpkgs/preload/files/preload/log/run diff --git a/srcpkgs/preload/files/preload/log/run b/srcpkgs/preload/files/preload/log/run deleted file mode 120000 index 914853dd4fc..00000000000 --- a/srcpkgs/preload/files/preload/log/run +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/rsvlog \ No newline at end of file diff --git a/srcpkgs/preload/files/preload/log/run b/srcpkgs/preload/files/preload/log/run new file mode 100755 index 00000000000..4e4d1d47e39 --- /dev/null +++ b/srcpkgs/preload/files/preload/log/run @@ -0,0 +1,55 @@ +#!/bin/sh +# Author: TJ Vanderpoel +# Licence: MIT +# This is a generic 'run' script meant to be linked in a log/ directory +# of a runit, daemontools, s6, or similar service. +# It requires svlogd available in the path. + +# If the file './conf' exists, it can modify the behavior +# of the svlogd in these ways: + +# USERGROUP=user:group (default rsvlog:adm) +# SV_LOGDIR=/path/to/log (default `basename $(dirname $PWD)`) +# CURRENT_LOG_FILE=filename.log (default 'current') + +set -e +if [ $0 != "./run" ];then + echo "This script meant to be linked as ./run in a service/log directory only!" + exit 1 +fi +curdir=$(basename $(pwd)) +if [ "$curdir" != "log" ];then + echo "This script meant to be run from a service/log directory only!" + exit 1 +fi +if [ -f ./conf ];then + . ./conf +fi +if [ "x$SV_LOGDIR" != "x" ];then + logdir=$SV_LOGDIR +fi +if [ -w /var/log ];then + user_group=${USERGROUP:-rsvlog:adm} + if [ "x$logdir" = "x" ];then + logdir=$(basename $(dirname $(pwd))) + fi + [ -d "/var/log/$logdir" ] || mkdir -p "/var/log/$logdir" + [ -L ./main ] || [ -d ./main ] || ln -s "/var/log/$logdir" ./main + [ -L ./current ] || ln -s main/current + if [ "x$CURRENT_LOG_FILE" != "x" ];then + [ -L "/var/log/$logdir/$CURRENT_LOG_FILE" ] || ln -s current "/var/log/$logdir/$CURRENT_LOG_FILE" + fi + usergroup=$(stat -c "%U:%G" "/var/log/$logdir") + if [ "$usergroup" != "$user_group" ];then + chown -R $user_group "/var/log/$logdir" + fi + echo Logging as $user_group to /var/log/$logdir + exec chpst -u $user_group svlogd -t ./main +else + echo Logging in $PWD + if [ "x$CURRENT_LOG_FILE" != "x" ];then + [ -L "$CURRENT_LOG_FILE" ] || ln -s current "$CURRENT_LOG_FILE" + fi + exec svlogd -t ./ +fi + diff --git a/srcpkgs/preload/files/preload/run b/srcpkgs/preload/files/preload/run index 31047240764..fa55abe07d7 100755 --- a/srcpkgs/preload/files/preload/run +++ b/srcpkgs/preload/files/preload/run @@ -1,6 +1,6 @@ #!/bin/sh exec 2>&1 -[ -r conf ] && . conf +[ -r ./conf ] && . ./conf MIN_MEMORY=${MIN_MEMORY:-256} free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0 diff --git a/srcpkgs/preload/template b/srcpkgs/preload/template index 0c380ac6840..2d87e868acd 100644 --- a/srcpkgs/preload/template +++ b/srcpkgs/preload/template @@ -1,13 +1,13 @@ # Template file for 'preload' pkgname=preload version=0.6.4 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="help2man pkg-config" makedepends="libglib-devel" -depends="sv-helper" short_desc="An adaptive readahead daemon" maintainer="bougyman " +only_for_archs="x86_64 armv7l armv7l" license="GPL-2" homepage="http://sourceforge.net/projects/preload" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"