New package: preload-0.6.4

Closes #1291
This commit is contained in:
bougyman 2015-04-11 17:53:13 -05:00
parent 410c32b83e
commit a42b0aa7ba
4 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# Miminum memory that the system should have for preload to be launched.
# In megabytes.
MIN_MEMORY="256"
# Command-line arguments to pass to the daemon. Read preload(8) man page
# for available options.
OPTS="--verbose 1 -l ''"
# Option to call ionice with. Leave empty to skip ionice.
IONICE_OPTS="-c3"

View file

@ -0,0 +1 @@
/usr/bin/rsvlog

View file

@ -0,0 +1,15 @@
#!/bin/sh
exec 2>&1
[ -r conf ] && . conf
MIN_MEMORY=${MIN_MEMORY:-256}
free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
if [ -n "$IONICE_OPTS" ]; then
if [ -x "$IONICE" ]; then
RUNNER="$IONICE $IONICE_OPTS"
else
echo "ionice not found, running with normal io priority" 1>&2
fi
fi
exec $RUNNER preload $OPTS -f 2>&1

22
srcpkgs/preload/template Normal file
View file

@ -0,0 +1,22 @@
# Template file for 'preload'
pkgname=preload
version=0.6.4
revision=1
build_style=gnu-configure
hostmakedepends="help2man pkg-config"
makedepends="libglib-devel"
depends="sv-helper"
short_desc="An adaptive readahead daemon"
maintainer="bougyman <bougyman@voidlinux.eu>"
license="GPL-2"
homepage="http://sourceforge.net/projects/preload"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=d0a558e83cb29a51d9d96736ef39f4b4e55e43a589ad1aec594a048ca22f816b
post_install() {
rm -rf etc/rc.d
rm -rf etc/logrotate.d
rm -rf etc/sysconfig
rm -rf var/log
vsv preload
}