Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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