summaryrefslogtreecommitdiff
path: root/sysutils/swapd
diff options
context:
space:
mode:
authorxtraeme <xtraeme@pkgsrc.org>2004-10-30 05:06:14 +0000
committerxtraeme <xtraeme@pkgsrc.org>2004-10-30 05:06:14 +0000
commite4aca5a5ea277194397f8241176a3a6e7919eb92 (patch)
treebb7bee9f181cab3baf77a36054c68d9bbc863f1f /sysutils/swapd
parentfe233569467a807e14b48a8fd77913c8f81aa1af (diff)
downloadpkgsrc-e4aca5a5ea277194397f8241176a3a6e7919eb92.tar.gz
Initial import of swapd-1.0.
"Swapd" is a daemon that watches free memory and manages swap files. If free memory drops too low, additional swap files are created. Additionally, if there is too much free memory, swap files are deactivated and disk space may be reclaimed.
Diffstat (limited to 'sysutils/swapd')
-rw-r--r--sysutils/swapd/DESCR4
-rw-r--r--sysutils/swapd/Makefile25
-rw-r--r--sysutils/swapd/PLIST6
-rw-r--r--sysutils/swapd/distinfo7
-rw-r--r--sysutils/swapd/files/swapd.sh22
-rw-r--r--sysutils/swapd/patches/patch-aa18
-rw-r--r--sysutils/swapd/patches/patch-ab33
-rw-r--r--sysutils/swapd/patches/patch-ac17
8 files changed, 132 insertions, 0 deletions
diff --git a/sysutils/swapd/DESCR b/sysutils/swapd/DESCR
new file mode 100644
index 00000000000..0f97e0f8e54
--- /dev/null
+++ b/sysutils/swapd/DESCR
@@ -0,0 +1,4 @@
+"Swapd" is a daemon that watches free memory and manages swap files. If free
+memory drops too low, additional swap files are created. Additionally, if there
+is too much free memory, swap files are deactivated and disk space may be
+reclaimed.
diff --git a/sysutils/swapd/Makefile b/sysutils/swapd/Makefile
new file mode 100644
index 00000000000..0381a173cf4
--- /dev/null
+++ b/sysutils/swapd/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/10/30 05:06:14 xtraeme Exp $
+#
+
+DISTNAME= swapd-1.0
+CATEGORIES= sysutils
+MASTER_SITES= http://www.rkeene.org/files/oss/swapd/source/
+
+MAINTAINER= xtraeme@NetBSD.org
+HOMEPAGE= http://www.rkeene.org/oss/swapd/
+COMMENT= Watches free memory and manages swap files
+
+ONLY_FOR_PLATFORM= NetBSD-*-* SunOS-*-* Linux-*-*
+
+USE_BUILDLINK3= yes
+USE_GNU_TOOLS+= make
+USE_PKGINSTALL= yes
+GNU_CONFIGURE= yes
+
+RCD_SCRIPTS= swapd
+
+EGDIR= ${PREFIX}/share/examples/swapd
+CONF_FILES= ${EGDIR}/swapd.conf ${PKG_SYSCONFDIR}/swapd.conf
+
+.include "../../devel/libstatgrab/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/sysutils/swapd/PLIST b/sysutils/swapd/PLIST
new file mode 100644
index 00000000000..5b4f8cca322
--- /dev/null
+++ b/sysutils/swapd/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/10/30 05:06:14 xtraeme Exp $
+man/man5/swapd.conf.5
+man/man8/swapd.8
+sbin/swapd
+share/examples/swapd/swapd.conf
+@dirrm share/examples/swapd
diff --git a/sysutils/swapd/distinfo b/sysutils/swapd/distinfo
new file mode 100644
index 00000000000..b0787607615
--- /dev/null
+++ b/sysutils/swapd/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1.1.1 2004/10/30 05:06:14 xtraeme Exp $
+
+SHA1 (swapd-1.0.tar.gz) = 371ee3ebc8e76cecfb6f3821c001aa04d4cba5ac
+Size (swapd-1.0.tar.gz) = 89331 bytes
+SHA1 (patch-aa) = 23fb511f56514a9e49fa957dc1b60f00c8b58d8c
+SHA1 (patch-ab) = 739bd4dca1287676b5a32304f96bc214da160b72
+SHA1 (patch-ac) = 896fdfe94f658f941cb2c9d75d0bb51b59d8bc1f
diff --git a/sysutils/swapd/files/swapd.sh b/sysutils/swapd/files/swapd.sh
new file mode 100644
index 00000000000..60b8ef78a38
--- /dev/null
+++ b/sysutils/swapd/files/swapd.sh
@@ -0,0 +1,22 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: swapd.sh,v 1.1.1.1 2004/10/30 05:06:15 xtraeme Exp $
+#
+# PROVIDE: swapd
+# REQUIRE: DAEMON LOGIN swap
+
+
+name="swapd"
+command="@PREFIX@/sbin/${name}"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+pidfile="@VARBASE@/run/${name}.pid"
+sig_stop="KILL"
+
+. /etc/rc.subr
+
+load_rc_config $name
+run_rc_command "$1"
+
+if [ "$1" != "stop" ]; then
+ echo $(check_process $command) > $pidfile
+fi
diff --git a/sysutils/swapd/patches/patch-aa b/sysutils/swapd/patches/patch-aa
new file mode 100644
index 00000000000..0e5876aa2b4
--- /dev/null
+++ b/sysutils/swapd/patches/patch-aa
@@ -0,0 +1,18 @@
+$NetBSD: patch-aa,v 1.1.1.1 2004/10/30 05:06:15 xtraeme Exp $
+
+--- configure.orig 2004-10-29 23:52:36.000000000 +0200
++++ configure 2004-10-30 05:39:59.000000000 +0200
+@@ -12163,6 +12163,13 @@
+ _ACEOF
+
+ ;;
++ netbsd*)
++
++cat >>confdefs.h <<\_ACEOF
++#define SWAPD_SWAPOFF_CMDLINE "/sbin/swapctl -d \"%s\""
++_ACEOF
++ ;;
++
+ esac
+
+
diff --git a/sysutils/swapd/patches/patch-ab b/sysutils/swapd/patches/patch-ab
new file mode 100644
index 00000000000..1b1803c1831
--- /dev/null
+++ b/sysutils/swapd/patches/patch-ab
@@ -0,0 +1,33 @@
+$NetBSD: patch-ab,v 1.1.1.1 2004/10/30 05:06:15 xtraeme Exp $
+
+--- Makefile.in.orig 2004-10-30 05:53:53.000000000 +0200
++++ Makefile.in 2004-10-30 05:56:22.000000000 +0200
+@@ -10,7 +10,7 @@
+ prefix = @prefix@
+ mandir = @mandir@
+ sysconfdir = @sysconfdir@
+-datadir = @datadir@
++datadir = @datadir@/examples/swapd
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+ sbindir = @sbindir@
+@@ -30,11 +30,11 @@
+ rm -f Makefile config.h config.status config.log swapd.8 swapd.conf.5
+
+ install: all
+- -$(INSTALL) -d $(sbindir)
+- -$(INSTALL) -d $(sysconfdir)
+- -$(INSTALL) -d $(mandir)/man8
+- -$(INSTALL) -d $(mandir)/man5
+- $(INSTALL) -m 755 swapd$(EXEEXT) $(sbindir)/swapd$(EXEEXT)
+- $(INSTALL) -m 644 swapd.conf $(sysconfdir)/swapd.conf
+- $(INSTALL) -m 644 swapd.8 $(mandir)/man8/swapd.8
+- $(INSTALL) -m 644 swapd.conf.5 $(mandir)/man5/swapd.conf.5
++ $(BSD_INSTALL_DATA_DIR) $(sbindir)
++ $(BSD_INSTALL_DATA_DIR) $(datadir)
++ $(BSD_INSTALL_MAN_DIR) $(mandir)/man8
++ $(BSD_INSTALL_MAN_DIR) $(mandir)/man5
++ $(BSD_INSTALL_PROGRAM) swapd$(EXEEXT) $(sbindir)/swapd$(EXEEXT)
++ $(BSD_INSTALL_DATA) swapd.conf $(datadir)/swapd.conf
++ $(BSD_INSTALL_MAN) swapd.8 $(mandir)/man8/swapd.8
++ $(BSD_INSTALL_MAN) swapd.conf.5 $(mandir)/man5/swapd.conf.5
diff --git a/sysutils/swapd/patches/patch-ac b/sysutils/swapd/patches/patch-ac
new file mode 100644
index 00000000000..4da54722c1b
--- /dev/null
+++ b/sysutils/swapd/patches/patch-ac
@@ -0,0 +1,17 @@
+$NetBSD: patch-ac,v 1.1.1.1 2004/10/30 05:06:15 xtraeme Exp $
+
+--- swapd.c.orig 2004-10-30 06:28:26.000000000 +0200
++++ swapd.c 2004-10-30 06:29:03.000000000 +0200
+@@ -114,9 +114,11 @@
+ return(-1);
+ }
+
+- retval = meminfo->free + meminfo->cache + swapinfo->free;
++ retval = meminfo->free + swapinfo->free;
+
++ if (!meminfo)
+ free(meminfo);
++ if (!swapinfo)
+ free(swapinfo);
+
+ return(retval);