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

Diff of /eclass/cron.eclass

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

Revision 1.1.1.1 Revision 1.16
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2011 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.1.1.1 2005/11/30 09:59:18 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cron.eclass,v 1.16 2013/09/05 10:44:22 zx2c4 Exp $
4 4
5# @ECLASS: cron
6# @MAINTAINER:
7# cron-bugs@gentoo.org
8# @AUTHOR:
5# Original Author: Aaron Walker <ka0ttic@gentoo.org> 9# Original Author: Aaron Walker <ka0ttic@gentoo.org>
6# 10# @BLURB: Some functions for cron
11# @DESCRIPTION:
7# Purpose: The main motivation for this eclass was to simplify 12# Purpose: The main motivation for this eclass was to simplify
8# the jungle known as src_install() in cron ebuilds. Using these 13# the jungle known as src_install() in cron ebuilds. Using these
9# functions also ensures that permissions are *always* reset, 14# functions also ensures that permissions are *always* reset,
10# preventing the accidental installation of files with wrong perms. 15# preventing the accidental installation of files with wrong perms.
11# 16#
20 25
21SLOT="0" 26SLOT="0"
22 27
23DEPEND=">=sys-apps/sed-4.0.5" 28DEPEND=">=sys-apps/sed-4.0.5"
24 29
25RDEPEND="!virtual/cron
26 virtual/mta
27 >=sys-process/cronbase-0.2.1-r3" 30RDEPEND=">=sys-process/cronbase-0.3.2"
31for pn in vixie-cron bcron cronie dcron fcron; do
32 [[ ${pn} == "${PN}" ]] || RDEPEND="${RDEPEND} !sys-process/${pn}"
33done
28 34
29PROVIDE="virtual/cron" 35# @FUNCTION: docrondir
30 36# @USAGE: [ dir ] [ perms ]
31# docrondir [ dir ] [ perms ] 37# @DESCRIPTION:
32#
33# Creates crontab directory 38# Creates crontab directory
34# 39#
35# Both arguments are optional. Everything after 'dir' is considered 40# Both arguments are optional. Everything after 'dir' is considered
36# the permissions (same format as insopts). 41# the permissions (same format as insopts).
37# 42#
61 66
62 # reset perms to default 67 # reset perms to default
63 diropts -m0755 68 diropts -m0755
64} 69}
65 70
71# @FUNCTION: docron
66# docron [ exe ] [ perms ] 72# @USAGE: [ exe ] [ perms ]
67# 73# @DESCRIPTION:
68# Install cron executable 74# Install cron executable
69# 75#
70# Both arguments are optional. 76# Both arguments are optional.
71# 77#
72# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron") 78# ex: docron -m 0700 -o root -g root ('exe' defaults to "cron")
94 100
95 # reset perms to default 101 # reset perms to default
96 exeopts -m0755 102 exeopts -m0755
97} 103}
98 104
99# docrontab [ exe ] [ perms ] 105# @FUNCTION: docrontab
100# 106# @USAGE: [ exe ] [ perms ]
107# @DESCRIPTION:
101# Install crontab executable 108# Install crontab executable
102# 109#
103# Uses same semantics as docron. 110# Uses same semantics as docron.
104 111
105docrontab() { 112docrontab() {
130 dosym ${crontab##*/} /usr/bin/crontab || \ 137 dosym ${crontab##*/} /usr/bin/crontab || \
131 die "failed to create /usr/bin/crontab symlink" 138 die "failed to create /usr/bin/crontab symlink"
132 fi 139 fi
133} 140}
134 141
142# @FUNCTION: cron_pkg_postinst
143# @DESCRIPTION:
144# Outputs a message about system crontabs
145# daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
135cron_pkg_postinst() { 146cron_pkg_postinst() {
136 echo 147 echo
137 # vixie is the only daemon that has a true system crontab 148 # daemons that have a true system crontab set CRON_SYSTEM_CRONTAB="yes"
138 if [[ "${PN}" != "vixie-cron" ]] ; then 149 if [ "${CRON_SYSTEM_CRONTAB:-no}" != "yes" ] ; then
139 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:" 150 einfo "To activate /etc/cron.{hourly|daily|weekly|monthly} please run:"
140 einfo " crontab /etc/crontab" 151 einfo " crontab /etc/crontab"
141 einfo 152 einfo
142 einfo "!!! That will replace root's current crontab !!!" 153 einfo "!!! That will replace root's current crontab !!!"
143 einfo 154 einfo

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20