Magellan Linux

Contents of /branches/magellan-next/core/fcron/fcron-3.0.6-r6.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8971 - (show annotations) (download)
Fri Aug 26 19:29:16 2011 UTC (12 years, 9 months ago) by niro
File size: 4576 byte(s)
-dropped SysV support
1 # $Id$
2
3 PNAME="fcron"
4 PVER="3.0.6"
5 PBUILD="r6"
6
7 PCATEGORIE="sys-apps"
8
9 DESCRIPTION="A periodical command scheduler which aims at replacing Vixie Cron."
10 HOMEPAGE="http://fcron.free.fr/"
11
12 DEPEND=">= virtual/glibc
13 >= virtual/editor
14 >= virtual/mta
15 >= sys-libs/pam-1.1"
16
17 SDEPEND=">= sys-dev/autoconf-5
18 >= sys-dev/automake-4"
19
20 PROVIDE="virtual/cron"
21
22 SRCFILE="${PNAME}-${PVER}.src.tar.gz"
23 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
24
25 sminclude mtools mbuild
26
27 SRC_URI=(
28 ftp://ftp.seul.org/pub/${PNAME}/${SRCFILE}
29 http://fcron.free.fr/archives/${SRCFILE}
30 mirror://${PNAME}/${SRCFILE}
31 mirror://${PNAME}/run-crons-0.3
32 mirror://${PNAME}/fcron.allow
33 mirror://${PNAME}/fcron.deny
34 mirror://${PNAME}/fcron.conf-2.9.5.1
35 mirror://${PNAME}/crontab
36 mirror://${PNAME}/fcron.pam-systemauth
37 mirror://${PNAME}/fcrontab.pam-systemauth
38 mirror://${PNAME}/fcron.service
39 )
40
41 UP2DATE="updatecmd ftp://ftp.seul.org/pub/${PNAME} | lasttarball gz | sed s/.src//"
42
43 src_compile()
44 {
45 cd ${SRCDIR}
46
47 # using systemwide editor as default, but fallback to nano
48 mconfigure \
49 --with-username=cron \
50 --with-groupname=cron \
51 --with-piddir=/var/run \
52 --with-etcdir=/etc/fcron \
53 --with-spooldir=/var/spool/cron \
54 --with-fifodir=/var/run \
55 --with-fcrondyn=yes \
56 --with-editor=${EDITOR:=/usr/bin/nano} \
57 --with-sendmail=/usr/sbin/sendmail \
58 --with-pam=yes \
59 --with-selinux=no \
60 || die
61
62 mmake || die
63 }
64
65 src_install()
66 {
67 cd ${SRCDIR}
68
69 # this is needed to keep the correct rights for /var
70 minstalldir /var || die
71 # this is needed to keep the correct rights for /etc
72 minstalldir /etc || die
73
74 # general needed cron-files (dcron vcron etc, uses this also)
75 minstalldir /usr/sbin || die
76 minstallexec -s run-crons-0.3 /usr/sbin/run-crons || die
77 mkeepdir /etc/cron.d || die
78 mkeepdir /etc/cron.hourly || die
79 mkeepdir /etc/cron.daily || die
80 mkeepdir /etc/cron.weekly || die
81 mkeepdir /etc/cron.monthly || die
82 mkeepdir /var/spool/cron || die
83 mkeepdir /var/spool/cron/lastrun || die
84
85
86 # fcron needed directories
87 minstalldir /etc/fcron || die
88 minstalldir /usr/sbin || die
89 mkeepdir /var/spool/cron/fcrontabs || die
90
91 # install fcron bins
92 minstallexec fcron /usr/sbin || die
93 minstallexec fcrontab || die
94 minstallexec fcrondyn || die
95 minstallexec fcronsighup /usr/bin || die
96 mlink fcrontab /usr/bin/crontab || die
97
98 # install etc
99 minstallfile -s fcron.allow /etc/fcron || die
100 minstallfile -s fcron.deny /etc/fcron || die
101 minstallfile -s fcron.conf-2.9.5.1 /etc/fcron/fcron.conf || die
102 minstalletc crontab || die
103
104 # systemd unit
105 minstallunit fcron.service || die
106
107 # pam related
108 minstallpam fcron.pam-systemauth fcron || die
109 minstallpam fcrontab.pam-systemauth fcrontab || die
110
111 # now fix all permissions
112 #
113 # fix owner (run it before suid bits are set, or they wil be reseted)
114 mchown cron:cron /var/spool/cron || die
115 mchown cron:cron /var/spool/cron/fcrontabs || die
116 mchown cron:cron /usr/bin/fcrontab || die
117 mchown cron:cron /usr/bin/fcrondyn || die
118 mchown root:cron /usr/bin/fcronsighup || die
119 mchown root:cron /etc/fcron/fcron.allow || die
120 mchown root:cron /etc/fcron/fcron.deny || die
121 mchown root:cron /etc/fcron/fcron.conf || die
122 #
123 # directories
124 mchmod 0750 /etc/cron.d || die
125 mchmod 0750 /etc/cron.hourly || die
126 mchmod 0750 /etc/cron.daily || die
127 mchmod 0750 /etc/cron.weekly || die
128 mchmod 0750 /etc/cron.monthly || die
129 mchmod 6770 /var/spool/cron || die
130 mchmod 0750 /var/spool/cron/lastrun || die
131 mchmod 0770 /var/spool/cron/fcrontabs || die
132 #
133 # files
134 mchmod 0755 /usr/sbin/fcron || die
135 mchmod 6755 /usr/bin/fcrontab || die
136 mchmod 6755 /usr/bin/fcrondyn || die
137 mchmod 6755 /usr/bin/fcronsighup || die
138 mchmod 0640 /etc/fcron/fcron.allow || die
139 mchmod 0640 /etc/fcron/fcron.deny || die
140 mchmod 0640 /etc/fcron/fcron.conf || die
141
142 # temporary disabled, enable it as soon as docbook gets into the tree
143 # # man pages
144 # minstallman doc/man/*.1 || die
145 # minstallman doc/man/*.3 || die
146 # minstallman doc/man/*.5 || die
147 # minstallman doc/man/*.8 || die
148
149 minstalldocs MANIFEST README VERSION || die
150 }
151
152 postinstall()
153 {
154 # needed to run fcron
155 touch ${MROOT}/var/log/wtmp
156
157 mstartunit fcron.service
158
159 echo
160 echo "Each user who uses fcron should be added to the cron group"
161 echo "in /etc/group and also be added in /etc/fcron/fcron.allow"
162 echo
163 echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: "
164 echo "crontab /etc/crontab"
165 echo
166 echo "To run fcron at system boot please run: "
167 echo "systemctl enable fcron.service"
168 echo
169 echo "!!! That will replace root's current crontab !!!"
170 echo
171 }
172
173 postremove()
174 {
175 mstopunit fcron.service
176 }