pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

preload: Import preload-0.6.4



Module Name:	pkgsrc-wip
Committed By:	Mateusz Poszwa <old4%o2.pl@localhost>
Pushed By:	f8l
Date:		Fri Jul 1 11:56:28 2016 +0200
Changeset:	32ba9c11e5774abc954745143d5f625d4f1b7fb4

Modified Files:
	Makefile
Added Files:
	preload/DESCR
	preload/Makefile
	preload/PLIST
	preload/TODO
	preload/distinfo
	preload/files/preload.sh
	preload/patches/patch-configure
	preload/patches/patch-preload.init.in
	preload/patches/patch-src_Makefile.in
	preload/patches/patch-src_gen.preload.conf.sh
	preload/patches/patch-src_readahead.c

Log Message:
preload: Import preload-0.6.4

preload is an adaptive readahead daemon. It monitors applications
that users run, and by analyzing this data, predicts what
applications users might run next, and fetches those binaries
and their dependencies into memory for faster startup times.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=32ba9c11e5774abc954745143d5f625d4f1b7fb4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                      |  1 +
 preload/DESCR                                 |  4 +++
 preload/Makefile                              | 36 +++++++++++++++++++++++++++
 preload/PLIST                                 | 11 ++++++++
 preload/TODO                                  |  3 +++
 preload/distinfo                              | 11 ++++++++
 preload/files/preload.sh                      | 17 +++++++++++++
 preload/patches/patch-configure               | 24 ++++++++++++++++++
 preload/patches/patch-preload.init.in         | 12 +++++++++
 preload/patches/patch-src_Makefile.in         | 14 +++++++++++
 preload/patches/patch-src_gen.preload.conf.sh | 15 +++++++++++
 preload/patches/patch-src_readahead.c         | 23 +++++++++++++++++
 12 files changed, 171 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 6ed7af7..f063f45 100644
--- a/Makefile
+++ b/Makefile
@@ -2546,6 +2546,7 @@ SUBDIR+=	povray
 SUBDIR+=	ppp
 SUBDIR+=	ppr
 SUBDIR+=	praat
+SUBDIR+=	preload
 SUBDIR+=	premake
 SUBDIR+=	premake4
 SUBDIR+=	premake5
diff --git a/preload/DESCR b/preload/DESCR
new file mode 100644
index 0000000..1ac4fca
--- /dev/null
+++ b/preload/DESCR
@@ -0,0 +1,4 @@
+preload is an adaptive readahead daemon. It monitors applications
+that users run, and by analyzing this data, predicts what
+applications users might run next, and fetches those binaries
+and their dependencies into memory for faster startup times.
diff --git a/preload/Makefile b/preload/Makefile
new file mode 100644
index 0000000..6680b76
--- /dev/null
+++ b/preload/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD$
+
+DISTNAME=	preload-0.6.4
+CATEGORIES=	wip
+MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=preload/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://preload.sourceforge.net/
+COMMENT=	Adaptive readahead daemon
+LICENSE=	gnu-gpl-v2
+
+GNU_CONFIGURE=	yes
+USE_TOOLS+=	pkg-config gawk
+# The makefiles only seem to be compatible with BSD make
+USE_TOOLS+=	gmake
+
+RCD_SCRIPTS+=	preload
+
+EGDIR=	${PREFIX}/share/examples/${PKGBASE}
+
+CONF_FILES+=	${EGDIR}/logrotate.d/preload ${PKG_SYSCONFDIR}/logrotate.d/preload
+CONF_FILES+=	${EGDIR}/preload.conf ${PKG_SYSCONFDIR}/preload.conf
+
+SUBST_CLASSES+=			fix-paths
+SUBST_STAGE.fix-paths=		pre-configure
+SUBST_MESSAGE.fix-paths=	Fixing absolute paths.
+SUBST_FILES.fix-paths+=		configure src/Makefile.in
+SUBST_SED.fix-paths+=		-e '/initddir=/s,$${sysconfdir}/rc.d,${EGDIR},g'
+SUBST_SED.fix-paths+=		-e '/sysconfigdir=/s,$${sysconfdir},${EGDIR},g'
+SUBST_SED.fix-paths+=		-e '/logrotatedir=/s,$${sysconfdir},${EGDIR},g'
+SUBST_SED.fix-paths+=		-e '/nodist_sysconfDATA_INSTALL/s,$$(sysconfdir),${EGDIR},g'
+SUBST_SED.fix-paths+=		-e '/MKDIR_P/s,$$(sysconfdir),${EGDIR},g'
+
+BUILDLINK_API_DEPENDS.glib2+=           glib2>=2.14.0
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/preload/PLIST b/preload/PLIST
new file mode 100644
index 0000000..e64386d
--- /dev/null
+++ b/preload/PLIST
@@ -0,0 +1,11 @@
+@comment $NetBSD$
+man/man8/preload.8
+sbin/preload
+share/doc/${PKGNAME}/index.txt
+share/doc/${PKGNAME}/proposal.txt
+share/examples/preload/init.d/preload
+share/examples/preload/logrotate.d/preload
+share/examples/preload/preload.conf
+share/examples/preload/sysconfig/preload
+var/lib/preload/preload.state
+var/log/preload.log
diff --git a/preload/TODO b/preload/TODO
new file mode 100644
index 0000000..73075fc
--- /dev/null
+++ b/preload/TODO
@@ -0,0 +1,3 @@
+* Tweak autoconf and readahead.c to use readahead if it’s available.
+* Allow custom VARBASE.
+* Try to make makefiles compatible with BSD make.
diff --git a/preload/distinfo b/preload/distinfo
new file mode 100644
index 0000000..ff85dc3
--- /dev/null
+++ b/preload/distinfo
@@ -0,0 +1,11 @@
+$NetBSD$
+
+SHA1 (preload-0.6.4.tar.gz) = 2313a7f9c8713fbc0efaf649b29dbe36ed0b3945
+RMD160 (preload-0.6.4.tar.gz) = 93de2090e7d5c21cdb5e74531dab480117f95c36
+SHA512 (preload-0.6.4.tar.gz) = ffb533059b8c9cd171b0d02d52fc8c9bc45284fb16e12b9698ab74345d0e4f66cee61e17922074f7fbfaa90db254e473f815718fc72a689bb55346fcda9e823c
+Size (preload-0.6.4.tar.gz) = 140750 bytes
+SHA1 (patch-configure) = 16560fbfa008e2d118f09a2296059b6a0e69a7dd
+SHA1 (patch-preload.init.in) = 2f73b46366a9133ee244eeedd3f6b012a62333b5
+SHA1 (patch-src_Makefile.in) = f7614afeaedb9672120025e3d10fdefcadf0f6c4
+SHA1 (patch-src_gen.preload.conf.sh) = 1f34459dd35f09e01498af4d6ca03e072416307e
+SHA1 (patch-src_readahead.c) = e381c44ceec51f40cb5cd21a58f38c44ccaf27d1
diff --git a/preload/files/preload.sh b/preload/files/preload.sh
new file mode 100755
index 0000000..f2a1c43
--- /dev/null
+++ b/preload/files/preload.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# $NetBSD$
+#
+
+# PROVIDE: preload
+# REQUIRE: DAEMON
+# BEFORE:  LOGIN
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="preload"
+rcvar=$name
+command="/usr/pkg/sbin/${name}"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/preload/patches/patch-configure b/preload/patches/patch-configure
new file mode 100644
index 0000000..522bbdf
--- /dev/null
+++ b/preload/patches/patch-configure
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Require posix_fadvise instead of readahead for greater portability.
+
+--- configure.orig	2009-04-15 21:49:29.000000000 +0000
++++ configure
+@@ -5735,7 +5735,7 @@ fi
+ 
+ # Checks for library functions and headers.
+ 
+-for ac_func in readahead
++for ac_func in posix_fadvise
+ do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+@@ -5833,7 +5833,7 @@ as_val=`eval 'as_val=${'$as_ac_var'}
+ _ACEOF
+ 
+ else
+-  echo "*** readahead(2) system call required but not found.";
++  echo "*** posix_fadvise(2) system call required but not found.";
+ 			   echo "*** get yourself a recent Linux and glibc";
+ 			   echo "*** Exiting";
+ 			   exit 1;
diff --git a/preload/patches/patch-preload.init.in b/preload/patches/patch-preload.init.in
new file mode 100644
index 0000000..3207fa9
--- /dev/null
+++ b/preload/patches/patch-preload.init.in
@@ -0,0 +1,12 @@
+$NetBSD$
+
+Use sh instead of Bash, as the script seems to be bashism-free.
+
+--- preload.init.in.orig	2008-10-23 01:08:20.000000000 +0000
++++ preload.init.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ #	@initddir@/@PACKAGE@
+ #
diff --git a/preload/patches/patch-src_Makefile.in b/preload/patches/patch-src_Makefile.in
new file mode 100644
index 0000000..9bc454a
--- /dev/null
+++ b/preload/patches/patch-src_Makefile.in
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Define default rm command.
+
+--- src/Makefile.in.orig	2009-04-15 21:49:28.000000000 +0000
++++ src/Makefile.in
+@@ -121,6 +121,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ PATH_SEPARATOR = @PATH_SEPARATOR@
+ PKG_CONFIG = @PKG_CONFIG@
++RM = rm
+ SET_MAKE = @SET_MAKE@
+ SHELL = @SHELL@
+ SITE_URL = @SITE_URL@
diff --git a/preload/patches/patch-src_gen.preload.conf.sh b/preload/patches/patch-src_gen.preload.conf.sh
new file mode 100644
index 0000000..cb942d5
--- /dev/null
+++ b/preload/patches/patch-src_gen.preload.conf.sh
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Substitute a tab character for \t, as \t is generally not special.
+
+--- src/gen.preload.conf.sh.orig	2008-10-23 01:08:21.000000000 +0000
++++ src/gen.preload.conf.sh
+@@ -3,7 +3,7 @@
+ IN="$1"
+ KEYS="$2"
+ 
+-I='[ \t]*\([^, \t]*\)[ \t]*'
++I='[ 	]*\([^, 	]*\)[ 	]*'
+ SEDSCRIPT=`sed -e "s/confkey($I,$I,$I,$I,$I)/s@default_\3@\4@g; s@unit_\3@\5@g;/;" < "$KEYS"`
+ 
+ sed -e "$SEDSCRIPT" "$IN"
diff --git a/preload/patches/patch-src_readahead.c b/preload/patches/patch-src_readahead.c
new file mode 100644
index 0000000..548f7cc
--- /dev/null
+++ b/preload/patches/patch-src_readahead.c
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Use posix_fadvise and pread instead of readahead for greater portability.
+
+--- src/readahead.c.orig	2008-10-23 01:08:21.000000000 +0000
++++ src/readahead.c
+@@ -152,7 +152,15 @@ process_file(const char *path, size_t of
+ 	   );
+   if (fd >= 0)
+     {
+-      readahead(fd, offset, length);
++      char buf[4096];
++      size_t end = offset + length;
++
++      posix_fadvise(fd, offset, length, POSIX_FADV_WILLNEED);
++      for (size_t i = offset; i < end; i += 4096)
++	{
++	  size_t unread = end - i, nbytes = unread < 4096 ? unread : 4096;
++	  pread(fd, buf, nbytes, i);
++	}
+ 
+       close (fd);
+     }


Home | Main Index | Thread Index | Old Index