diff options
author | Yen-Ming Lee <leeym@FreeBSD.org> | 2008-01-23 08:05:18 +0000 |
---|---|---|
committer | Yen-Ming Lee <leeym@FreeBSD.org> | 2008-01-23 08:05:18 +0000 |
commit | 5538579020139a671917baddfe1ccfcc152c90ed (patch) | |
tree | 2908645920379b256506cba338e99a7bb4b78026 /sysutils/swapd | |
parent | ce6247b33b836919a74eb2af2fdf51893f02868f (diff) | |
download | ports-5538579020139a671917baddfe1ccfcc152c90ed.tar.gz ports-5538579020139a671917baddfe1ccfcc152c90ed.zip |
- add swapd-1.0.3
"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.
WWW: http://www.rkeene.org/oss/swapd/
Notes
Notes:
svn path=/head/; revision=206051
Diffstat (limited to 'sysutils/swapd')
-rw-r--r-- | sysutils/swapd/Makefile | 25 | ||||
-rw-r--r-- | sysutils/swapd/distinfo | 3 | ||||
-rw-r--r-- | sysutils/swapd/files/patch-Makefile.in | 11 | ||||
-rw-r--r-- | sysutils/swapd/files/swapd.in | 23 | ||||
-rw-r--r-- | sysutils/swapd/pkg-descr | 12 | ||||
-rw-r--r-- | sysutils/swapd/pkg-plist | 4 |
6 files changed, 78 insertions, 0 deletions
diff --git a/sysutils/swapd/Makefile b/sysutils/swapd/Makefile new file mode 100644 index 000000000000..896cf4a2cae1 --- /dev/null +++ b/sysutils/swapd/Makefile @@ -0,0 +1,25 @@ +# New ports collection makefile for: swapd +# Date created: August 16, 2007 +# Whom: Yen-Ming Lee <leeym@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= swapd +PORTVERSION= 1.0.3 +CATEGORIES= sysutils +MASTER_SITES= http://www.rkeene.org/files/oss/swapd/source/ + +MAINTAINER= leeym@FreeBSD.org +COMMENT= A daemon that watches free memory and manages swap files + +LIB_DEPENDS= statgrab:${PORTSDIR}/devel/libstatgrab + +USE_GMAKE= yes +GNU_CONFIGURE= yes + +USE_RC_SUBR= swapd +MAN5= swapd.conf.5 +MAN8= swapd.8 + +.include <bsd.port.mk> diff --git a/sysutils/swapd/distinfo b/sysutils/swapd/distinfo new file mode 100644 index 000000000000..70909a758a0d --- /dev/null +++ b/sysutils/swapd/distinfo @@ -0,0 +1,3 @@ +MD5 (swapd-1.0.3.tar.gz) = cb9ec64a5abd4535b95ec59311114ade +SHA256 (swapd-1.0.3.tar.gz) = 28e61c243268185a60e4012a612c054ebe9fd65215961df5e69fb32735984628 +SIZE (swapd-1.0.3.tar.gz) = 90981 diff --git a/sysutils/swapd/files/patch-Makefile.in b/sysutils/swapd/files/patch-Makefile.in new file mode 100644 index 000000000000..97ed304d9153 --- /dev/null +++ b/sysutils/swapd/files/patch-Makefile.in @@ -0,0 +1,11 @@ +--- Makefile.in.orig 2004-10-17 22:05:24.000000000 -0700 ++++ Makefile.in 2007-08-24 09:08:55.000000000 -0700 +@@ -35,6 +35,7 @@ + -$(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.conf $(sysconfdir)/swapd.conf.sample ++ if [ ! -f "$(sysconfdir)/swapd.conf" ]; then $(INSTALL) -m 644 swapd.conf $(sysconfdir)/swapd.conf; fi + $(INSTALL) -m 644 swapd.8 $(mandir)/man8/swapd.8 + $(INSTALL) -m 644 swapd.conf.5 $(mandir)/man5/swapd.conf.5 diff --git a/sysutils/swapd/files/swapd.in b/sysutils/swapd/files/swapd.in new file mode 100644 index 000000000000..231ebc36f36a --- /dev/null +++ b/sysutils/swapd/files/swapd.in @@ -0,0 +1,23 @@ +#!/bin/sh + +# PROVIDE: swapd +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable swapd: +# +# swapd_enable="YES" +# + +. %%RC_SUBR%% + +name=swapd +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/swapd + +load_rc_config $name + +swapd_enable=${swapd_enable:-"NO"} + +run_rc_command "$1" diff --git a/sysutils/swapd/pkg-descr b/sysutils/swapd/pkg-descr new file mode 100644 index 000000000000..258425c995e8 --- /dev/null +++ b/sysutils/swapd/pkg-descr @@ -0,0 +1,12 @@ +"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. + +"Linux swapd" (http://sourceforge.net/projects/swapd/) didn't work very well, +but the idea was good. I started making a version that would work and +would also be somewhat portable. It currently compiles on Linux and FreeBSD, +but requires `libstatgrab' (http://www.i-scream.org/libstatgrab/) to work on +platforms that don't have /proc/meminfo (i.e., platforms that aren't Linux). + +WWW: http://www.rkeene.org/oss/swapd/ diff --git a/sysutils/swapd/pkg-plist b/sysutils/swapd/pkg-plist new file mode 100644 index 000000000000..885e5305f83e --- /dev/null +++ b/sysutils/swapd/pkg-plist @@ -0,0 +1,4 @@ +sbin/swapd +@unexec if cmp -s %D/etc/swapd.conf %D/etc/swapd.conf.sample; then rm -f %D/etc/swapd.conf; fi +etc/swapd.conf.sample +@exec [ ! -f %B/swapd.conf ] && cp %B/%f %B/swapd.conf |