[QA] Remove executable bit from files, bug 550434.
[gentoo.git] / sys-process / cronbase / cronbase-0.3.3.ebuild
1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 inherit user
6
7 DESCRIPTION="base for all cron ebuilds"
8 HOMEPAGE="http://www.gentoo.org/"
9
10 LICENSE="GPL-2"
11 SLOT="0"
12 KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
13 IUSE=""
14
15 pkg_setup() {
16         enewgroup cron 16
17         enewuser cron 16 -1 /var/spool/cron cron
18 }
19
20 src_install() {
21         newsbin "${FILESDIR}"/run-crons-${PV} run-crons || die
22
23         diropts -m0750; keepdir /etc/cron.hourly
24         diropts -m0750; keepdir /etc/cron.daily
25         diropts -m0750; keepdir /etc/cron.weekly
26         diropts -m0750; keepdir /etc/cron.monthly
27
28         diropts -m0750 -o root -g cron; keepdir /var/spool/cron
29
30         diropts -m0750; keepdir /var/spool/cron/lastrun
31 }
32
33 pkg_postinst() {
34         #Portage doesn't enforce proper permissions on already existing"
35         #directories (bug 141619).
36         echo
37         elog "Forcing proper permissions on"
38         elog "${ROOT}etc/cron.{hourly,daily,weekly,monthly},"
39         elog "${ROOT}var/spool/cron/ and ${ROOT}var/spool/cron/lastrun/"
40         echo
41         chmod 0750 "${ROOT}"etc/cron.{hourly,daily,weekly,monthly} \
42                 || die "chmod failed"
43         chmod 0750 "${ROOT}"var/spool/{cron,cron/lastrun} || die "chmod failed"
44         chown root:cron "${ROOT}var/spool/cron" || die "chown failed"
45 }