summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2010-10-10 11:30:26 +0200
committerMartin Väth <martin@mvath.de>2015-10-11 10:46:19 +0200
commitf160da1cf5890f86ee27c21bf05e7230fb46c752 (patch)
tree50e78377b6bfeebed18bcc42366eda2b213a7e18 /sys-block
parentBump noscript (diff)
downloadmv-f160da1cf5890f86ee27c21bf05e7230fb46c752.tar.gz
mv-f160da1cf5890f86ee27c21bf05e7230fb46c752.tar.bz2
mv-f160da1cf5890f86ee27c21bf05e7230fb46c752.zip
Add compcache-tools with init-files
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/compcache-tools/ChangeLog9
-rw-r--r--sys-block/compcache-tools/Manifest7
-rw-r--r--sys-block/compcache-tools/compcache-tools-0.6.2.ebuild42
-rw-r--r--sys-block/compcache-tools/files/compcache-tools-cc.patch9
-rw-r--r--sys-block/compcache-tools/files/compcache.confd26
-rw-r--r--sys-block/compcache-tools/files/compcache.initd105
-rw-r--r--sys-block/compcache-tools/metadata.xml5
7 files changed, 203 insertions, 0 deletions
diff --git a/sys-block/compcache-tools/ChangeLog b/sys-block/compcache-tools/ChangeLog
new file mode 100644
index 00000000..a7d1db11
--- /dev/null
+++ b/sys-block/compcache-tools/ChangeLog
@@ -0,0 +1,9 @@
+# ChangeLog for sys-block/compcache-tools
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header $
+
+ 10 Oct 2010; Martin Väth <martin@mvath.de>
+ Bump to 0.6.2. Add init.d/conf.d files.
+
+ 04 Jan 2010; Russell Harmon (eatnumber1) <russ@eatnumber1.com>
+ New ebuild for bug 299664. Thanks to Russell Harmon
diff --git a/sys-block/compcache-tools/Manifest b/sys-block/compcache-tools/Manifest
new file mode 100644
index 00000000..69dce724
--- /dev/null
+++ b/sys-block/compcache-tools/Manifest
@@ -0,0 +1,7 @@
+AUX compcache-tools-cc.patch 327 RMD160 c802f33b2baa54e7428c9ace8f103c23e4d7b0eb SHA1 01e05e6b25b6f79d2b413f3988f0ac2d3c0a1f55 SHA256 fb9b768d386b5b2fed3ad0efa92542f6bb717de9cfcb08e53a847ecba05a8887
+AUX compcache.confd 806 RMD160 62cda7d7922a3bce9d16e71c9d4de46470ce7da8 SHA1 5f8684b242e80e75255869d6caae1cfb3e9dfe65 SHA256 cedb1a7ed1a5c58f149746cd8b80b2800795b1d304a0b4088d561e5a52072abb
+AUX compcache.initd 1794 RMD160 011d113c3296c68b7ebefefd9f5539de0e8643f7 SHA1 69cecb788b8b07d3941e1b974c4f0437d42ac679 SHA256 81bfd2f559592e1ab3b72f6f82c69902381a56852e2c3d4b5d5898de8f323165
+DIST compcache-0.6.2.tar.gz 26618 RMD160 495f1fcd76f9585192327d33ab2f6f667b611c6c SHA1 d2844aff60517c93477031df0705553f1ee7e743 SHA256 969e39aa08c3c65fe104777156caef3e9c58fc87720d45801a6dce04745abac3
+EBUILD compcache-tools-0.6.2.ebuild 910 RMD160 793f99dd9b9ba8715c1311690c0643f65d582627 SHA1 6117237951d0e58abbcbb111d1c97df7b7fc4167 SHA256 f2fd6497f681a8323143b555e724ab7118b2bab2676cf508e3cf5e9d1d5896a8
+MISC ChangeLog 351 RMD160 0986dfe2786bf8d3c376479d94655affd6840888 SHA1 38498adab0cc477cd45f43b7c8e56300e5c53cae SHA256 36e40dc62d69ed2e404809c51700e1133d04c2ab9084342199f2a13bb6b31472
+MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/sys-block/compcache-tools/compcache-tools-0.6.2.ebuild b/sys-block/compcache-tools/compcache-tools-0.6.2.ebuild
new file mode 100644
index 00000000..c3d2f608
--- /dev/null
+++ b/sys-block/compcache-tools/compcache-tools-0.6.2.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=2
+
+inherit eutils toolchain-funcs
+
+MY_P="${P/-tools/}"
+DESCRIPTION="Compressed in-memory swap device for Linux"
+HOMEPAGE="http://code.google.com/p/compcache/"
+SRC_URI="http://compcache.googlecode.com/files/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+S="${WORKDIR}/${MY_P}/sub-projects/rzscontrol"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-cc.patch"
+}
+
+src_compile() {
+ tc-export CC
+ default
+}
+
+src_install() {
+ dobin rzscontrol || die
+ doman man/rzscontrol.1 || die
+ newinitd "${FILESDIR}/compcache.initd" compcache
+ newconfd "${FILESDIR}/compcache.confd" compcache
+}
+
+pkg_postinst() {
+ elog
+ elog "To use compcache, add ramzswap support to your kernel and add compcache"
+ elog "to your default runlevel (\"rc-config add compcache default\")."
+ elog
+}
diff --git a/sys-block/compcache-tools/files/compcache-tools-cc.patch b/sys-block/compcache-tools/files/compcache-tools-cc.patch
new file mode 100644
index 00000000..a79a1bde
--- /dev/null
+++ b/sys-block/compcache-tools/files/compcache-tools-cc.patch
@@ -0,0 +1,9 @@
+--- sub-projects/rzscontrol/Makefile
++++ sub-projects/rzscontrol/Makefile
+@@ -1,5 +1,5 @@
+ all:
+- @gcc -g -Wall -D_GNU_SOURCE rzscontrol.c -o rzscontrol -I ../include -I../..
++ $(CC) $(CFLAGS) -Wall -D_GNU_SOURCE rzscontrol.c -o rzscontrol -I ../include -I../.. $(LDFLAGS)
+
+ doc:
+ @xmllint --noout --valid man/rzscontrol.xml
diff --git a/sys-block/compcache-tools/files/compcache.confd b/sys-block/compcache-tools/files/compcache.confd
new file mode 100644
index 00000000..5ab6ebd8
--- /dev/null
+++ b/sys-block/compcache-tools/files/compcache.confd
@@ -0,0 +1,26 @@
+# compcache/ramzswap settings...
+
+# load ramzswap kernel module on start?
+LOAD_ON_START="yes"
+
+# unload ramzswap kernel module on stop?
+UNLOAD_ON_STOP="yes"
+
+# number of devices
+NUM_DEVICES="1"
+
+# for each /dev/ramzswapN, specify these arguments for rszcontrol
+# `man rzscontrol` for more informations.
+# The variable is eval'ed; you can use \${FSTAB_SWAP_0} ... \${FSTAB_SWAP_n}
+# to get the device names of the swap devices of fstab (mount point = "swap").
+#RAMZSWAP_OPTS_0="--backing_swap=/path/to/swap.dev --memlimit_kb=10240"
+#RAMZSWAP_OPTS_1="--disksize_kb=20480"
+RAMZSWAP_OPTS_0=""
+RAMZSWAP_OPTS_1="--backing_swap=\"\${FSTAB_SWAP_0}\""
+
+# Options passed to swapon (this is eval'ed)
+SWAPON_OPTS_0="-p 1"
+SWAPON_OPTS_1="-p 0"
+
+# Disable fstab swaps while compcache is running?
+DISABLE_FSTAB_SWAP="no"
diff --git a/sys-block/compcache-tools/files/compcache.initd b/sys-block/compcache-tools/files/compcache.initd
new file mode 100644
index 00000000..6287640a
--- /dev/null
+++ b/sys-block/compcache-tools/files/compcache.initd
@@ -0,0 +1,105 @@
+#!/sbin/runscript
+
+opts="start stop info reload"
+
+depend() {
+ need localmount swap
+ after bootmisc modules
+}
+
+RamzswapDefaults() {
+ : ${NUM_DEVICES:=1}
+}
+
+RamzswapEnableOpts() {
+ einfo "Enabling swap ${1}..."
+ eval "rzscontrol \"\${1}\" ${2} --init && swapon ${3} -- \"${1}\""
+ eend ${?}
+}
+
+RamzswapEnable() {
+ eval 'RamzswapEnableOpts "/dev/ramzswap${1}" \
+"${RAMZSWAP_OPTS_'${1}'}" "${SWAPON_OPTS_'${1}'}"'
+}
+
+RamzswapDisable() {
+ einfo "Disabling swap /dev/ramzswap${1}..."
+ swapoff "/dev/ramzswap${1}" && rzscontrol "/dev/ramzswap${1}" --reset
+ eend ${?}
+}
+
+RamzswapParseFstab() {
+ i=0
+ for a in `sed -ne \
+ 's/^\(\/[^[:space:]]*\)[[:space:]]*swap[[:space:]].*/\1/p' /etc/fstab`
+ do eval 'FSTAB_SWAP_'${i}'="${a}"'
+ i=$(( ${i} + 1 ))
+ done
+}
+
+start() {
+ RamzswapDefaults
+ if [ "${LOAD_ON_START}" = "yes" ]
+ then einfo "Loading ramzswap module..."
+ modprobe ramzswap num_devices=${NUM_DEVICES}
+ eend ${?}
+ fi
+
+ if [ "${DISABLE_FSTAB_SWAP}" = "yes" ]
+ then einfo "Disabling fstab swap"
+ swapoff -a
+ eend ${?}
+ fi
+
+ RamzswapParseFstab
+ i=0
+ while [ ${i} -lt "${NUM_DEVICES}" ]
+ do RamzswapEnable ${i}
+ i=$(( ${i} + 1 ))
+ done
+ :
+}
+
+stop() {
+ RamzswapDefaults
+ i=0
+ while [ ${i} -lt "${NUM_DEVICES}" ]
+ do RamzswapDisable ${i}
+ i=$(( ${i} + 1 ))
+ done
+
+ if [ "${UNLOAD_ON_STOP}" = "yes" ]
+ then einfo "Unloading ramzswap module..."
+ rmmod ramzswap
+ eend ${?}
+ fi
+
+ if [ "${DISABLE_FSTAB_SWAP}" = "yes" ]
+ then einfo "Enabling fstab swap"
+ swapon -a
+ eend ${?}
+ fi
+ :
+}
+
+info() {
+ RamzswapDefaults
+ i=0
+ while [ ${i} -lt "${NUM_DEVICES}" ]
+ do rzscontrol "/dev/ramzswap${i}" --stats
+ i=$(( ${i} + 1 ))
+ done
+ :
+}
+
+reload() {
+ RamzswapDefaults
+ RamzswapParseFstab
+ i=0
+ while [ ${i} -lt "${NUM_DEVICES}" ]
+ do RamzswapDisable ${i}
+ RamzswapEnable ${i}
+ i=$(( ${i} + 1 ))
+ done
+ :
+}
diff --git a/sys-block/compcache-tools/metadata.xml b/sys-block/compcache-tools/metadata.xml
new file mode 100644
index 00000000..7e328698
--- /dev/null
+++ b/sys-block/compcache-tools/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>maintainer-wanted</herd>
+</pkgmetadata>