diff options
Diffstat (limited to 'sys-apps/preload')
12 files changed, 398 insertions, 0 deletions
diff --git a/sys-apps/preload/Manifest b/sys-apps/preload/Manifest new file mode 100644 index 000000000000..ee1ec6a488b6 --- /dev/null +++ b/sys-apps/preload/Manifest @@ -0,0 +1,14 @@ +AUX 00-patch-configure.diff 554 SHA256 fde86c42379111b211fa750b6b32cd02ae4f0d1e2597fc7f9e85d841ebf71be3 SHA512 08d0ec88d15812e9a495e3b5bef080539f088163d3ad3b390fc6f5cffaefbdf8a6ac854c9a24ec0962466afead1223ba5621566649fea6bb84d80bcecbc16c3e WHIRLPOOL 87b800eeb873fd627f3f02985bd15da1a5c6516d1fe5ad127fe5062cf592f2fe233ec2d36210e1725f677afe26376f9adb9339f69916712604b3af7932f4d83e +AUX 0001-Early-restart-of-forking-readahead-children.patch 1900 SHA256 13a2d3f91960f9ebddf4261aa9e53f64ce3111b5e1c5273f467f00d3ab0ac880 SHA512 c24b22605e7fc020a5f2a069a65b2ffac9caae69b70d7e5925953f9e4a71992ca34f4701de7b9e975321ae3418a2d6a6bd952e162b8167891bc68128dbdc51cf WHIRLPOOL 62bf4e4b9f67f7cbb7e176a3d59e71f92fdb9c914e3b9f476eac0b79d1d74b4f5dde9dfdf9359d9b9bddf62514d7eefde53965a254bdc0b38210daf2377fa835 +AUX 0002-Create-short-overlapping-io-bursts.patch 856 SHA256 1e92121abfa3549b18d4a7eefa26fa098e25539cc3948c3ffe492598d6ba9ae5 SHA512 ad9f8cc342e54cf36ade563351dec14d02bbcf1495f8dddae265a339531b623eeb3be100b6303670c33d588b2f0106d6162e74b449ec082e2f4257e2dd7b276b WHIRLPOOL f301b757e21ce3fc1d7312d1086d382599d695411e9e7a714ccaabc09dea2f3c1aedffbb8b1b70531512515939d73b8b6755a05df07ea915b6342d61102d96c8 +AUX 0003-Fix-wait_for_children-loop.patch 745 SHA256 1bbb777d7a92779cff1888bdb5b322ce3cd913c3a9dc38c3677774d98d0a4176 SHA512 32c107fde8d9afcf687e5e276dcb95006bc26fa0af6a1bc2223c80fbe9ec685d7952ae4e0452ed57c6edf3cffddc23fa0da4633c37f23c4450b5c68b3dbff274 WHIRLPOOL 2c98a84cd2f88e74c5440bc1ebd531b87c21f8324c553b4cd2b2ba8abfc23fc9f186cc7cdfc9e07f5bca3640e676052cf25c841a451b51ce1ce09a438de8ad11 +AUX 02-patch-preload_conf.diff 684 SHA256 f71c689becee188f67288869be70dc6712059e2b54601cd27bce5975c703957c SHA512 b5c6076cc4c97d917219d12d8aa30b3bc958085e2477b81c54449e2b4bc576fd86a1e01f64867933b1219842e3292e4861a1776486594ae3aa93f956fb919c9f WHIRLPOOL 6fb4d63dd28f6f63f721ef62b72ab813b7962410eeddd04be05f11bb0e804758a49d2a0ffd2f867dd70cd2c091cdfb64fb1d896bd38b3d4c18e8d139a28c2a4f +AUX 02-patch-preload_sysconfig.diff 1297 SHA256 194fd5df6b9d29f1d9f02ce827c5358d5d1a73dd27c93f7347368a3c46aebea6 SHA512 bef0346e1b0c3fb15f9f1987a302cd0b349ce1898f387afaf6407833c2adfd3dfa985615840312d5cd09d22e330f072ab3a164cb3f7c9b356bfc51522fe924e3 WHIRLPOOL 4440a6325f782de36328ef84a20935dd76892fd7289f61fabad78175629e6f16a6908cd2ed08f4377a72b2ac486a64689d3cf52b29c42a55f13dae2d176483f4 +AUX preload-0.6.4-use-help2man-as-usual.patch 1170 SHA256 e3cfa2a98d4723fdaad8824828c6a48c3f11b7d391c56b272f21dd52e1270ee5 SHA512 cbd40b621974544f4737161a034f13d7d9e635822f7cca293ca93e7e5d7bb108260b02aa557e42fb43cbd48ca069bb19eb7946cb1f4fbf263dac84ac209de451 WHIRLPOOL c3a04a1ac943eb1914edb21b43d28ee46fd9bb232832cad9dd772d207b8481b6459aaf2db6beeada3c05270fd68d002324e26cc5a560f14dc54cfee1627fea9b +AUX preload-0.6.4-use-make-dependencies.patch 533 SHA256 14370e962352510ed94bda04ddcd1882b5562fa1eaae93894ae485ec756591e7 SHA512 060c96b9b3fe38eac79d6a39945ff4efbe7639804e97715a290d5397fff523fb8d483393305187249c61ac1acbc719f4e56bb7e5a3c1513e6384ca915ad773a0 WHIRLPOOL 3bc1de6b69d6cdd27e7408c5efd964c0255763852a58b151c6e9717e30c68df189d9d865fb2b0c9070dac1e5fafc53818f12c0f9a02353c5fcd11746d3b5d45b +AUX preload-0.6.4.init.in-r2 1506 SHA256 121b763074156a3dcfdb15d23da5dabd89250565596e8b7b3a8388aded2e8071 SHA512 0e6a058f1825f537152ddf1495dc4101f8add5ca4ce759c3cf6425025c19c5a4361d9abed447511b7d9f081c665d65d7d2f828c13a59ddfcb5f88e5529958e95 WHIRLPOOL 6cf01e0565e423a236f5b268189f2007b72e2875aa169f543fe9d67cbea5a2f5125e327488be87c1d81b20252c47ae95d5e2bb01324c86391206a4cc18fe2420 +DIST preload-0.6.4.tar.gz 140750 SHA256 d0a558e83cb29a51d9d96736ef39f4b4e55e43a589ad1aec594a048ca22f816b SHA512 ffb533059b8c9cd171b0d02d52fc8c9bc45284fb16e12b9698ab74345d0e4f66cee61e17922074f7fbfaa90db254e473f815718fc72a689bb55346fcda9e823c WHIRLPOOL dcee78e1933689e0860cee1b641625182c1cd35a30a71cb11d12dbd68dd513f7a49f69134f6623baa7fa9ab85f81fb45324ffd20aa191aac23ee054f939bb0d6 +EBUILD preload-0.6.4-r3.ebuild 1703 SHA256 e54520e940743c448972aa807ada060f1f9188082ca26318a9bbf6f584a715e6 SHA512 8091828a42c2aff05f2ec3e1e4995a7d50bc7468c0e004cdc568dbf5cb490bd8fc5ea12d74985eb23251befcc1df85189c897d4a13bb2b0a7b0677bc06228295 WHIRLPOOL a7f781cc5fc6f807adeb7b4c82e0af66ae12bf24c418512e61d8e3289d0c5579ca483b12942ca2e5c8f9cc29adc42e0381aa007f7b58a3463f559d0be2c873d5 +MISC ChangeLog 3152 SHA256 08074d2b7b172d13d975e89e1834e76d5abd7379eeb251474c245897782c43a6 SHA512 f93ac6761b04605e6580467c4620a6c265a8cb2c2ef087e82c808d3aca14f879f00ea1d6cc8e27be60f1b63b64a43c304e1460e94250ce11020e6f4ffd78159a WHIRLPOOL 0d399acf37ad07ee1705da6adba6cd78e6d5ea100f5ddeeb8fcfec19c641b3386168d03745dafbe9ba7bb083c322557accf44c0a1eb36ba7bc7eb41ba5cf74fe +MISC ChangeLog-2015 6530 SHA256 e7a62a5492138814e6fac1332261f3a054de16860892f82fa8b3712bbf36625c SHA512 52944f1096056647ea1f04e9ecdcd9ad8456cf0552a8f459dd7939e3e2c3b3e12ad05e3dcc919687088010cc9e290c840ec72ee2795fce907a0cf92bdc1ff623 WHIRLPOOL 00ba7dee1a5f171203bbb71954d606a0f4b235cb1fca99b5361c9c9432999c977f7a21b8db36515138700eaa3ffd460726020c8ce60c805a3de05c9a1e3e679f +MISC metadata.xml 501 SHA256 0e4a5ec82733dd6fc68b64d20a7801b607eab081a948a5a98cf6cf57bf6af542 SHA512 8909054cca7097e0d17a2bbbfc343065ade5a7d433b6729b8cf902ed9730856081303d7a3af13350a4fc78a20a00c01e8fd33b526cd28c82f5031fbe8abe7e76 WHIRLPOOL 9a8e50fddc7b1c8fd8c4dbbf305b07c4d79d44fadb40faa8448af24b65b76cf183f0e005d02e3224a6f4f6753e87f7784b0510f8ac07c017615c2826a8586dfe 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-r2 b/sys-apps/preload/files/preload-0.6.4.init.in-r2 new file mode 100644 index 000000000000..f8cae0c4d93e --- /dev/null +++ b/sys-apps/preload/files/preload-0.6.4.init.in-r2 @@ -0,0 +1,66 @@ +#!/sbin/openrc-run + +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..140f503ea594 --- /dev/null +++ b/sys-apps/preload/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <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..0a88e6470aff --- /dev/null +++ b/sys-apps/preload/preload-0.6.4-r3.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 +inherit eutils autotools + +DESCRIPTION="Adaptive readahead daemon" +HOMEPAGE="https://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 +} |