summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/preload
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-apps/preload')
-rw-r--r--sys-apps/preload/Manifest1
-rw-r--r--sys-apps/preload/files/00-patch-configure.diff15
-rw-r--r--sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch64
-rw-r--r--sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch29
-rw-r--r--sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch27
-rw-r--r--sys-apps/preload/files/02-patch-preload_conf.diff21
-rw-r--r--sys-apps/preload/files/02-patch-preload_sysconfig.diff39
-rw-r--r--sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch31
-rw-r--r--sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch21
-rw-r--r--sys-apps/preload/files/preload-0.6.4.init.in50
-rwxr-xr-xsys-apps/preload/files/preload-0.6.4.init.in-r166
-rwxr-xr-xsys-apps/preload/files/preload-0.6.4.init.in-r266
-rw-r--r--sys-apps/preload/metadata.xml11
-rw-r--r--sys-apps/preload/preload-0.6.4-r3.ebuild64
14 files changed, 505 insertions, 0 deletions
diff --git a/sys-apps/preload/Manifest b/sys-apps/preload/Manifest
new file mode 100644
index 000000000000..c7ae629147a0
--- /dev/null
+++ b/sys-apps/preload/Manifest
@@ -0,0 +1 @@
+DIST preload-0.6.4.tar.gz 140750 SHA256 d0a558e83cb29a51d9d96736ef39f4b4e55e43a589ad1aec594a048ca22f816b SHA512 ffb533059b8c9cd171b0d02d52fc8c9bc45284fb16e12b9698ab74345d0e4f66cee61e17922074f7fbfaa90db254e473f815718fc72a689bb55346fcda9e823c WHIRLPOOL dcee78e1933689e0860cee1b641625182c1cd35a30a71cb11d12dbd68dd513f7a49f69134f6623baa7fa9ab85f81fb45324ffd20aa191aac23ee054f939bb0d6
diff --git a/sys-apps/preload/files/00-patch-configure.diff b/sys-apps/preload/files/00-patch-configure.diff
new file mode 100644
index 000000000000..0fa5feb47b1f
--- /dev/null
+++ b/sys-apps/preload/files/00-patch-configure.diff
@@ -0,0 +1,15 @@
+--- configure.ac~ 2009-04-15 23:47:52.000000000 +0200
++++ configure.ac 2010-03-29 17:59:39.000000000 +0200
+@@ -54,9 +54,9 @@
+ PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.14)
+
+ # Directories we need.
+-pkgdocdir='${datadir}/doc/'${PACKAGE_NAME}-${PACKAGE_VERSION}
+-initddir='${sysconfdir}/rc.d/init.d'
+-sysconfigdir='${sysconfdir}/sysconfig'
++pkgdocdir='${datadir}/doc/'${PF}
++initddir='${sysconfdir}/init.d'
++sysconfigdir='${sysconfdir}/conf.d'
+ logrotatedir='${sysconfdir}/logrotate.d'
+ logdir='${localstatedir}/log'
+ subsysdir='${localstatedir}/lock/subsys'
diff --git a/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch
new file mode 100644
index 000000000000..2143ba3cc15e
--- /dev/null
+++ b/sys-apps/preload/files/0001-Early-restart-of-forking-readahead-children.patch
@@ -0,0 +1,64 @@
+From 63cbd8862714a97c8ef752041dc8c351ba4fae1d Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 19:50:22 +0200
+Subject: [PATCH] Early restart of forking readahead children
+
+This patch adds ability to wait_for_children() to restart
+forking new readahead children as soon as a slot becomes
+available which should make the effect of parallelism even
+more effective. Previous situation was:
+
+Wait for all children to exit as soon as the high water mark
+was reached. This resulted in 30 processes in peak, wait for
+them to reach 0 processes. Start another 30 processes in
+peak, wait again etc.
+
+New situation is: Start a new process as soon as a previous
+process exited which keeps the peak at 30 processes until
+the readahead list is finished.
+
+This introduces a new parameter to wait_for_children() which
+tells it to leave now more than XY processes running when
+returning.
+---
+ src/readahead.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index c169e81..7617449 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -103,10 +103,10 @@ map_block_compare (const preload_map_t **pa, const preload_map_t **pb)
+ static int procs = 0;
+
+ static void
+-wait_for_children (void)
++wait_for_children (int maxprocs)
+ {
+ /* wait for child processes to terminate */
+- while (procs > 0)
++ while (procs >= maxprocs)
+ {
+ int status;
+ if (wait (&status) > 0)
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children ();
++ wait_for_children (maxprocs);
+
+ if (maxprocs > 0)
+ {
+@@ -257,7 +257,7 @@ preload_readahead (preload_map_t **files, int file_count)
+ path = NULL;
+ }
+
+- wait_for_children ();
++ wait_for_children (0);
+
+ return processed;
+ }
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch
new file mode 100644
index 000000000000..20ba67a1bb4b
--- /dev/null
+++ b/sys-apps/preload/files/0002-Create-short-overlapping-io-bursts.patch
@@ -0,0 +1,29 @@
+From 97814f566aeb84f60031008c3dda5457ba176fe7 Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 20:57:06 +0200
+Subject: [PATCH] Create short overlapping io bursts
+
+Modify the wait_for_children() mechanism to create short
+burst instead of constant flow of new io requests. This
+is more fair and should enable the kernel to rearrange
+io requests better.
+---
+ src/readahead.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index 7617449..466961d 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children (maxprocs);
++ wait_for_children (maxprocs >> 1);
+
+ if (maxprocs > 0)
+ {
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch
new file mode 100644
index 000000000000..dc37548638a5
--- /dev/null
+++ b/sys-apps/preload/files/0003-Fix-wait_for_children-loop.patch
@@ -0,0 +1,27 @@
+From 536714622135e53db3f8a5673db32c5de9620aa8 Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Tue, 29 Jul 2008 08:15:55 +0200
+Subject: [PATCH] Fix wait_for_children() loop
+
+Brain damage repaired: One should not wait while zero or
+more children exist... That's always the case. :-(
+---
+ src/readahead.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index 466961d..08d9f4f 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -106,7 +106,7 @@ static void
+ wait_for_children (int maxprocs)
+ {
+ /* wait for child processes to terminate */
+- while (procs >= maxprocs)
++ while (procs > maxprocs)
+ {
+ int status;
+ if (wait (&status) > 0)
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/02-patch-preload_conf.diff b/sys-apps/preload/files/02-patch-preload_conf.diff
new file mode 100644
index 000000000000..70055c3bbb0f
--- /dev/null
+++ b/sys-apps/preload/files/02-patch-preload_conf.diff
@@ -0,0 +1,21 @@
+diff -urN preload-0.6.orig/src/preload.conf.in preload-0.6/src/preload.conf.in
+--- preload-0.6.orig/src/preload.conf.in 2008-07-24 02:02:11.000000000 +0200
++++ preload-0.6/src/preload.conf.in 2008-07-24 16:32:28.565184094 +0200
+@@ -132,7 +132,7 @@
+ # preload doesn't special-handle device files internally.
+ #
+ # default: (empty list, accept all)
+-mapprefix = /usr/;/lib;/var/cache/;!/
++mapprefix = /usr/;/lib;/var/cache/;/opt/;/home/;!/
+
+ # exeprefix:
+ #
+@@ -141,7 +141,7 @@
+ # files instead of maps.
+ #
+ # default: (empty list, accept all)
+-exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;!/
++exeprefix = !/usr/sbin/;!/usr/local/sbin/;/usr/;/opt/;/usr/libexec/;!/
+
+ # maxprocs
+ #
diff --git a/sys-apps/preload/files/02-patch-preload_sysconfig.diff b/sys-apps/preload/files/02-patch-preload_sysconfig.diff
new file mode 100644
index 000000000000..84308b6e14d8
--- /dev/null
+++ b/sys-apps/preload/files/02-patch-preload_sysconfig.diff
@@ -0,0 +1,39 @@
+diff -urN preload-0.6.4.orig/preload.sysconfig preload-0.6.4/preload.sysconfig
+--- preload-0.6.4.orig/preload.sysconfig 2008-10-23 03:08:20.000000000 +0200
++++ preload-0.6.4/preload.sysconfig 2009-05-01 13:51:03.493828659 +0200
+@@ -1,10 +1,30 @@
++# Copyright 1999-2008 Gentoo Foundation
++# $Id$
++# preload configuration file
++
++PIDFILE="/var/run/preload.pid"
++
++# verbosity. 0-10, Default is 1.
++#PRELOAD_VERBOSITY="1"
++
++# set this for niceness. Default is 15. Valid ranges are from -20 to 19. See
++# nice(1) man page.
++#PRELOAD_NICE="15"
++
++# log file (default is /var/log/preload.log )
++#PRELOAD_LOGFILE="/var/log/preload.log"
++
++# preload state file (default location is /var/lib/preload/preload.state )
++# Empty (commented out) means no state is saved.
++PRELOAD_STATEFILE="/var/lib/preload/preload.state"
++
+ # Miminum memory that the system should have for preload to be launched.
+-# In megabytes.
+-MIN_MEMORY="256"
++# In megabytes. Currently unused.
++#MIN_MEMORY="256"
+
+ # Command-line arguments to pass to the daemon. Read preload(8) man page
+ # for available options.
+-PRELOAD_OPTS="--verbose 1"
++#PRELOAD_OPTS="--verbose 1"
+
+-# Option to call ionice with. Leave empty to skip ionice.
+-IONICE_OPTS="-c3"
++# Option to call ionice with. Leave empty to use defaults.
++#IONICE_OPTS="-c3"
diff --git a/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch b/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch
new file mode 100644
index 000000000000..61db50692524
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4-use-help2man-as-usual.patch
@@ -0,0 +1,31 @@
+--- src/Makefile.am~ 2009-04-15 23:46:04.000000000 +0200
++++ src/Makefile.am 2010-04-09 12:56:45.000000000 +0200
+@@ -54,23 +54,11 @@
+
+ dist_man_MANS = preload.8
+
+-$(srcdir)/preload.8: cmdline.c ../configure.ac preload.8.i
+- $(MAKE) $(AM_MAKEFLAGS) preload
+- @echo "Creating $@ using help2man(1)"
+- @$(top_builddir)/missing --run \
+- help2man --no-info --section=8 --include=preload.8.i \
+- --help-option="-H" --output="$@.tmp" \
+- --name 'Adaptive readahead daemon' ./preload \
+- && mv "$@.tmp" "$@" \
+- || ($(RM) "$@"; \
+- echo Failed to update preload.8, the man page may be outdated >&2; \
+- (test -f "$@" || echo help2man is required to generate this file. >> "$@"));
+-
+-install-data-hook:
+- @cd "$(DESTDIR)$(man8dir)" && gzip -c preload.8 > preload.8.gz.tmp && mv preload.8.gz.tmp preload.8.gz && $(RM) preload.8
+-
+-uninstall-hook:
+- $(RM) "$(DESTDIR)$(man8dir)/preload.8.gz"
++preload.8: preload preload.8.i
++ help2man \
++ --no-info --section=8 --include=preload.8.i \
++ --help-option="-H" --output="$@" \
++ --name 'Adaptive readahead daemon' ./preload
+
+ ######################################################################
+
diff --git a/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch b/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch
new file mode 100644
index 000000000000..0f41780c31e4
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4-use-make-dependencies.patch
@@ -0,0 +1,21 @@
+--- src/Makefile.am~ 2010-04-09 12:56:45.000000000 +0200
++++ src/Makefile.am 2010-04-09 12:58:36.000000000 +0200
+@@ -8,8 +8,6 @@
+ -DLOGDIR='"${logdir}"' \
+ -DPKGLOCALSTATEDIR='"${pkglocalstatedir}"'
+
+-preload.o cmdline.o preload.8: Makefile
+-
+ sbin_PROGRAMS = preload
+
+ preload_SOURCES = \
+@@ -64,8 +62,7 @@
+
+ MAINTAINERCLEANFILES += preload.conf.debug
+
+-preload.conf.debug:
+- $(MAKE) $(AM_MAKEFLAGS) preload.conf
++preload.conf.debug: preload.conf
+ cp preload.conf preload.conf.debug
+
+ RUNPREQ = preload preload.conf.debug
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in b/sys-apps/preload/files/preload-0.6.4.init.in
new file mode 100644
index 000000000000..664cc9b09983
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in
@@ -0,0 +1,50 @@
+#!/sbin/runscript
+
+PIDFILE="/var/run/@PACKAGE@.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ ebegin "Dumping config and state for @PACKAGE@"
+ kill -USR1 $(<${PIDFILE})
+ kill -USR2 $(<${PIDFILE})
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading @PACKAGE@"
+ kill -HUP $(<${PIDFILE})
+ eend $?
+}
+
+start() {
+ ebegin "Starting @PACKAGE@"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # IMPORTANT: Let ssd do the backgrounding so we immediatly get a valid
+ # pid file in the next step (ionice)
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec @sbindir@/@PACKAGE@ -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} ${PRELOAD_OPTS} -f
+
+ IONICE=$(which ionice)
+ if [ -x "$IONICE" ]; then
+ IONICE_OPTS=${IONICE_OPTS:--c3}
+ $IONICE ${IONICE_OPTS} -p$(<${PIDFILE})
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping @PACKAGE@ (this may take while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in-r1 b/sys-apps/preload/files/preload-0.6.4.init.in-r1
new file mode 100755
index 000000000000..8a6351940743
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in-r1
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+
+description='Start/stop the preload daemon'
+extra_started_commands='dump reload'
+description_dump='Dump the config and state of the daemon (to the logfile)'
+description_reload='Reload the daemon'
+
+PIDFILE="/var/run/preload.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ local pid
+ pid=$(cat ${PIDFILE})
+
+ ebegin "Dumping the config and state of preload"
+ if [ -n "${pid}" ]; then
+ kill -USR1 ${pid}
+ kill -USR2 ${pid}
+ fi
+ eend ${?} && \
+ einfo "These should have been written to ${PRELOAD_LOGFILE:-/var/log/preload.log}"
+}
+
+reload() {
+ ebegin "Reloading preload"
+ kill -HUP $(cat ${PIDFILE})
+ eend ${?}
+}
+
+start() {
+ local ionice
+
+ ebegin "Starting preload"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # First try to start with ionice; if that fails, try without.
+ for ionice in "ionice ${IONICE_OPTS:--c3}" ''; do
+ # Avoid 'ionice not found' errors
+ ${ionice:-true} >/dev/null 2>&1 || continue
+
+ ${ionice} start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec /usr/sbin/preload -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} \
+ -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} \
+ -s ${PRELOAD_STATEFILE:-""} \
+ ${PRELOAD_OPTS} -f \
+ && break
+ done
+
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping preload (this may take a while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend ${?}
+}
diff --git a/sys-apps/preload/files/preload-0.6.4.init.in-r2 b/sys-apps/preload/files/preload-0.6.4.init.in-r2
new file mode 100755
index 000000000000..bf1b18e53541
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.4.init.in-r2
@@ -0,0 +1,66 @@
+#!/sbin/runscript
+
+description='Start/stop the preload daemon'
+extra_started_commands='dump reload'
+description_dump='Dump the config and state of the daemon (to the logfile)'
+description_reload='Reload the daemon'
+
+PIDFILE="/var/run/preload.pid"
+
+depend() {
+ after localmount
+ use netmount ntpd
+}
+
+dump() {
+ local pid
+ pid=$(cat ${PIDFILE})
+
+ ebegin "Dumping the config and state of preload"
+ if [ -n "${pid}" ]; then
+ kill -USR1 ${pid}
+ kill -USR2 ${pid}
+ fi
+ eend ${?} && \
+ einfo "These should have been written to ${PRELOAD_LOGFILE:-/var/log/preload.log}"
+}
+
+reload() {
+ ebegin "Reloading preload"
+ kill -HUP $(cat ${PIDFILE})
+ eend ${?}
+}
+
+start() {
+ local ionice
+
+ ebegin "Starting preload"
+
+ #MIN_MEMORY=${MIN_MEMORY:-256}
+ # Check for > MIN_MEMORY MB
+ #free -m | awk '/Mem:/ {exit ($2 >= ('"$MIN_MEMORY"'))?0:1}' || exit 0
+
+ # First try to start with ionice; if that fails, try without.
+ for ionice in "ionice ${IONICE_OPTS:--c3}" ''; do
+ # Avoid 'ionice not found' errors
+ ${ionice} true >/dev/null 2>&1 || continue
+
+ ${ionice} start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile ${PIDFILE} \
+ --exec /usr/sbin/preload -- \
+ -l ${PRELOAD_LOGFILE:-/var/log/preload.log} \
+ -V ${PRELOAD_VERBOSITY:-1} \
+ -n ${PRELOAD_NICE:-15} \
+ -s ${PRELOAD_STATEFILE:-""} \
+ ${PRELOAD_OPTS} -f \
+ && break
+ done
+
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping preload (this may take a while)"
+ start-stop-daemon --stop --retry 120 --quiet --pidfile ${PIDFILE}
+ eend ${?}
+}
diff --git a/sys-apps/preload/metadata.xml b/sys-apps/preload/metadata.xml
new file mode 100644
index 000000000000..e14703d34f93
--- /dev/null
+++ b/sys-apps/preload/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pacho@gentoo.org</email>
+ </maintainer>
+ <longdescription> preload is an adaptive readahead daemon. It monitors applications that users run, and by analyzing this data, predicts what applications users might run, and fetches those binaries and their dependencies into memory for faster startup times. </longdescription>
+ <upstream>
+ <remote-id type="sourceforge">preload</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/preload/preload-0.6.4-r3.ebuild b/sys-apps/preload/preload-0.6.4-r3.ebuild
new file mode 100644
index 000000000000..0c091d1e614a
--- /dev/null
+++ b/sys-apps/preload/preload-0.6.4-r3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit eutils autotools
+
+DESCRIPTION="Adaptive readahead daemon"
+HOMEPAGE="http://sourceforge.net/projects/preload/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="vanilla"
+
+WANT_AUTOCONF="2.56"
+
+RDEPEND=">=dev-libs/glib-2.6:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ sys-apps/help2man"
+
+src_prepare() {
+ epatch "${FILESDIR}"/00-patch-configure.diff
+ epatch "${FILESDIR}"/02-patch-preload_conf.diff
+ epatch "${FILESDIR}"/02-patch-preload_sysconfig.diff
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-help2man-as-usual.patch
+ epatch "${FILESDIR}"/${PN}-0.6.4-use-make-dependencies.patch
+ use vanilla || epatch "${FILESDIR}"/000{1,2,3}-*.patch
+ cat "${FILESDIR}"/preload-0.6.4.init.in-r2 > preload.init.in || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf --localstatedir=/var
+}
+
+src_install() {
+ default
+
+ # Remove log and state file from image or they will be
+ # truncated during merge
+ rm "${ED}"/var/lib/preload/preload.state || die "cleanup failed"
+ rm "${ED}"/var/log/preload.log || die "cleanup failed"
+ keepdir /var/lib/preload
+ keepdir /var/log
+}
+
+pkg_postinst() {
+ if [ "$(rc-config list default | grep preload)" = "" ] ; then
+ elog "You probably want to add preload to the default runlevel like so:"
+ elog "# rc-update add preload default"
+ fi
+
+ if has_version sys-fs/e4rat; then
+ elog "It appears you have sys-fs/e4rat installed. This may"
+ elog "has negative effects on it. You may want to disable preload"
+ elog "when using sys-fs/e4rat."
+ elog "http://e4rat.sourceforge.net/wiki/index.php/Main_Page#Debian.2FUbuntu"
+
+ fi
+}