summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/tmpreaper')
-rw-r--r--app-admin/tmpreaper/Manifest1
-rw-r--r--app-admin/tmpreaper/files/tmpreaper-1.6.13-gentoo.patch47
-rw-r--r--app-admin/tmpreaper/files/tmpreaper-1.6.7-fix-protect.patch46
-rw-r--r--app-admin/tmpreaper/metadata.xml24
-rw-r--r--app-admin/tmpreaper/tmpreaper-1.6.13.ebuild45
5 files changed, 163 insertions, 0 deletions
diff --git a/app-admin/tmpreaper/Manifest b/app-admin/tmpreaper/Manifest
new file mode 100644
index 000000000000..fbe35798c580
--- /dev/null
+++ b/app-admin/tmpreaper/Manifest
@@ -0,0 +1 @@
+DIST tmpreaper_1.6.13+nmu1.tar.gz 141080 SHA256 c88f05b5d995b9544edb7aaf36ac5ce55c6fac2a4c21444e5dba655ad310b738 SHA512 c868d421a7757a47b81c8932743981ded2b415c83377f8781fdfd4dfda48c701991da17fa262dfa0680b2a315d6b46ee4c9035ba4c06f5a0c1bc32efa717f19f WHIRLPOOL 65a6717a19620ef85f301c38fab9fa6b5b82a2a43acace48a7c3578231b6a378a1c6dcbd6d716395f235c0184bf3cc171bc3326790c2241606a1a8f244165253
diff --git a/app-admin/tmpreaper/files/tmpreaper-1.6.13-gentoo.patch b/app-admin/tmpreaper/files/tmpreaper-1.6.13-gentoo.patch
new file mode 100644
index 000000000000..afd5f60f3a1c
--- /dev/null
+++ b/app-admin/tmpreaper/files/tmpreaper-1.6.13-gentoo.patch
@@ -0,0 +1,47 @@
+diff -ur tmpreaper-1.6.13+nmu1.orig//debian/cron.daily tmpreaper-1.6.13+nmu1/debian/cron.daily
+--- tmpreaper-1.6.13+nmu1.orig//debian/cron.daily 2008-05-19 10:10:16.000000000 -0700
++++ tmpreaper-1.6.13+nmu1/debian/cron.daily 2010-10-10 19:44:14.563252064 -0700
+@@ -32,28 +32,7 @@
+
+ # Set config defaults
+ SHOWWARNING=''
+-
+-# get the TMPREAPER_TIME value from /etc/default/rcS
+-
+-if grep '^TMPTIME=' /etc/default/rcS >/dev/null 2>&1; then
+- eval $(grep '^TMPTIME=' /etc/default/rcS)
+- if [ -n "$TMPTIME" ]; then
+- # Don't clean files if TMPTIME is negative or 'infinite'
+- # to mimic the way /lib/init/bootclean.sh works.
+- case "$TMPTIME" in
+- -*|infinite|infinity)
+- # don't use this as default
+- ;;
+- *)
+- if [ "$TMPTIME" -gt 0 ]; then
+- TMPREAPER_TIME=${TMPTIME}d
+- else
+- TMPREAPER_TIME=7d
+- fi
+- ;;
+- esac
+- fi
+-fi
++TMPREAPER_TIME=''
+
+ # ! Important ! The "set -f" below prevents the shell from expanding
+ # file paths, which is vital for the configuration below to work.
+diff -ur tmpreaper-1.6.13+nmu1.orig//debian/tmpreaper.conf tmpreaper-1.6.13+nmu1/debian/tmpreaper.conf
+--- tmpreaper-1.6.13+nmu1.orig//debian/tmpreaper.conf 2006-12-08 04:24:03.000000000 -0800
++++ tmpreaper-1.6.13+nmu1/debian/tmpreaper.conf 2010-10-10 19:45:53.251119766 -0700
+@@ -40,9 +40,7 @@
+ # TMPREAPER_ADDITIONALOPTIONS
+ # extra options that are passed to tmpreaper, e.g. --all
+
+-# uncomment and change the next line to overrule the /etc/default/rcS value
+-# TMPREAPER_TIME=7d
+-
++TMPREAPER_TIME=7d
+ TMPREAPER_PROTECT_EXTRA=''
+ TMPREAPER_DIRS='/tmp/.'
+ TMPREAPER_DELAY='256'
diff --git a/app-admin/tmpreaper/files/tmpreaper-1.6.7-fix-protect.patch b/app-admin/tmpreaper/files/tmpreaper-1.6.7-fix-protect.patch
new file mode 100644
index 000000000000..a76c80dd5fc7
--- /dev/null
+++ b/app-admin/tmpreaper/files/tmpreaper-1.6.7-fix-protect.patch
@@ -0,0 +1,46 @@
+--- tmpreaper.c.orig 2006-12-05 10:55:58.000000000 -0800
++++ tmpreaper.c 2006-12-05 10:56:46.000000000 -0800
+@@ -467,6 +467,21 @@
+ continue;
+ }
+
++ if (FLAGS_PROTECT_P (flags)) {
++ skip = i = 0;
++ do {
++ if (sb.st_ino == protect_table[i].inode) {
++ message (LOG_VERBOSE,
++ "Entry matching `--protect' pattern skipped. `%s'\n",
++ protect_table[i].name);
++ skip = 1;
++ break;
++ }
++ } while (protect_table[i++].name);
++ if (skip)
++ continue;
++ }
++
+ if (S_ISDIR (sb.st_mode)) {
+ char *dst;
+
+@@ -489,21 +504,6 @@
+ (u_int) getpid(), ent->d_name);
+ }
+
+- if (FLAGS_PROTECT_P (flags)) {
+- skip = i = 0;
+- do {
+- if (sb.st_ino == protect_table[i].inode) {
+- message (LOG_VERBOSE,
+- "Entry matching `--protect' pattern skipped. `%s'\n",
+- protect_table[i].name);
+- skip = 1;
+- break;
+- }
+- } while (protect_table[i++].name);
+- if (skip)
+- continue;
+- }
+-
+ /* Decide whether to remove the file or not */
+ /* check for mtime on directory instead of atime if requested */
+ if ( FLAGS_MTIME_P(flags) ||
diff --git a/app-admin/tmpreaper/metadata.xml b/app-admin/tmpreaper/metadata.xml
new file mode 100644
index 000000000000..3fd73a03715e
--- /dev/null
+++ b/app-admin/tmpreaper/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ </maintainer>
+ <longdescription lang="en">
+ tmpreaper is a program that can be used to clean out temporary-file
+ directories. It recursively searches the directory, refusing to chdir()
+ across symlinks, and removes files that haven't been accessed in a
+ user-specified amount of time. You can specify a set of files to protect
+ from deletion with a shell pattern. It will not remove files owned by the
+ process EUID that have the `w' bit clear, unless you ask it to, much like
+ `rm -f'. `tmpreaper' will not remove symlinks, sockets, fifos, or special
+ files unless given a command line option enabling it to.
+
+ WARNING: Please do not run `tmpreaper' on `/'. There are no protections
+ against this written into the program, as that would prevent it from
+ functioning the way you'd expect it to in a `chroot(8)' environment.
+
+ The daily tmpreaper run can be configured through /etc/tmpreaper.conf .
+ </longdescription>
+</pkgmetadata>
diff --git a/app-admin/tmpreaper/tmpreaper-1.6.13.ebuild b/app-admin/tmpreaper/tmpreaper-1.6.13.ebuild
new file mode 100644
index 000000000000..8b9daeccc9df
--- /dev/null
+++ b/app-admin/tmpreaper/tmpreaper-1.6.13.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="3"
+inherit eutils
+
+MY_P="${PN}_${PV}+nmu1"
+DESCRIPTION="A utility for removing files based on when they were last accessed"
+HOMEPAGE="http://packages.debian.org/sid/tmpreaper"
+SRC_URI="mirror://debian/pool/main/t/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ppc x86"
+IUSE=""
+
+DEPEND=""
+RDEPEND=""
+
+S="${WORKDIR}/${MY_P/_/-}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-1.6.7-fix-protect.patch
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ insinto /etc
+ doins debian/tmpreaper.conf || die "failed to install"
+
+ exeinto /etc/cron.daily
+ newexe debian/cron.daily tmpreaper || die "failed to install cron script"
+ doman debian/tmpreaper.conf.5 || die
+ dodoc README ChangeLog debian/README* || die
+}
+
+pkg_postinst() {
+ elog "This package installs a cron script under /etc/cron.daily"
+ elog "You can configure it using /etc/tmpreaper.conf"
+ elog "Consult tmpreaper.conf man page for more information"
+ elog "Read /usr/share/doc/${P}/README.security and"
+ elog "remove SHOWWARNING from /etc/tmpreaper.conf afterwards"
+}