/[gentoo-x86]/eclass/cron.eclass
Gentoo

Diff of /eclass/cron.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.8
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.3 2005/03/04 23:25:25 ciaranm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.8 2005/07/11 15:08:06 swegener Exp $
4 4
5# Original Author: Aaron Walker <ka0ttic@gentoo.org> 5# Original Author: Aaron Walker <ka0ttic@gentoo.org>
6# 6#
7# Purpose: The main motivation for this eclass was to simplify 7# Purpose: The main motivation for this eclass was to simplify
8# the jungle known as src_install() in cron ebuilds. Using these 8# the jungle known as src_install() in cron ebuilds. Using these
14# 14#
15# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org. 15# Please assign any bugs regarding this eclass to cron-bugs@gentoo.org.
16 16
17inherit eutils flag-o-matic 17inherit eutils flag-o-matic
18 18
19ECLASS="cron"
20INHERITED="$INHERITED $ECLASS"
21EXPORT_FUNCTIONS pkg_postinst 19EXPORT_FUNCTIONS pkg_postinst
22 20
23SLOT="0" 21SLOT="0"
24 22
25DEPEND="${DEPEND} 23DEPEND="virtual/libc
26 virtual/libc
27 >=sys-apps/sed-4.0.5" 24 >=sys-apps/sed-4.0.5"
28 25
29RDEPEND="${RDEPEND} 26RDEPEND="!virtual/cron
30 !virtual/cron
31 virtual/mta 27 virtual/mta
32 >=sys-process/cronbase-0.2.1-r3" 28 >=sys-process/cronbase-0.2.1-r3"
33 29
34PROVIDE="virtual/cron" 30PROVIDE="virtual/cron"
35 31
45# docrondir -m0700 (uses default dir) 41# docrondir -m0700 (uses default dir)
46 42
47docrondir() { 43docrondir() {
48 # defaults 44 # defaults
49 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs" 45 local perms="-m0750 -o root -g cron" dir="/var/spool/cron/crontabs"
50 46
51 if [[ -n "$1" ]] ; then 47 if [[ -n "$1" ]] ; then
52 case "$1" in 48 case "$1" in
53 */*) 49 */*)
54 dir="$1" 50 dir="$1"
55 shift 51 shift
76# 72#
77# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron") 73# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
78# docron crond -m 0110 74# docron crond -m 0110
79 75
80docron() { 76docron() {
81 local cron="cron" perms="-m 0750 -o root -g root" 77 local cron="cron" perms="-m 0750 -o root -g wheel"
82 78
83 if [[ -n "$1" ]] ; then 79 if [[ -n "$1" ]] ; then
84 case "$1" in 80 case "$1" in
85 -*) 81 -*)
86 perms="$@" 82 perms="$@"
135 dosym ${crontab##*/} /usr/bin/crontab || \ 131 dosym ${crontab##*/} /usr/bin/crontab || \
136 die "failed to create /usr/bin/crontab symlink" 132 die "failed to create /usr/bin/crontab symlink"
137 fi 133 fi
138} 134}
139 135
140cron-pkg_postinst() { 136cron_pkg_postinst() {
141 echo 137 echo
142 # vixie is the only daemon that has a true system crontab 138 # vixie is the only daemon that has a true system crontab
143 if [[ "${PN}" != "vixie-cron" ]] ; then 139 if [[ "${PN}" != "vixie-cron" ]] ; then
144 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:" 140 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:"
145 einfo " crontab /etc/crontab" 141 einfo " crontab /etc/crontab"
146 einfo 142 einfo
147 einfo "!!! That will replace root's current crontab !!!" 143 einfo "!!! That will replace root's current crontab !!!"
148 einfo 144 einfo
149 fi 145 fi
150 146
151 einfo "You may wish to read the Gentoo Linux Cron Guide, which can be" 147 einfo "You may wish to read the Gentoo Linux Cron Guide, which can be"
152 einfo "found online at:" 148 einfo "found online at:"
153 einfo " http://www.gentoo.org/doc/en/cron-guide.xml" 149 einfo " http://www.gentoo.org/doc/en/cron-guide.xml"
154 echo 150 echo
155} 151}

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20