Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7881 - (show annotations) (download)
Thu Jun 2 21:23:04 2011 UTC (12 years, 10 months ago) by niro
File size: 4706 byte(s)
-rely on mtools service_exec determination
1 # $Id$
2
3 PNAME="fcron"
4 PVER="3.0.6"
5 PBUILD="r3"
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 mirror://${PNAME}/fcron.service
43 )
44
45 UP2DATE="updatecmd ftp://ftp.seul.org/pub/${PNAME} | lasttarball gz | sed s/.src//"
46
47 src_compile()
48 {
49 cd ${SRCDIR}
50
51 # using systemwide editor as default, but fallback to nano
52 mconfigure \
53 --with-username=cron \
54 --with-groupname=cron \
55 --with-piddir=/var/run \
56 --with-etcdir=/etc/fcron \
57 --with-spooldir=/var/spool/cron \
58 --with-fifodir=/var/run \
59 --with-fcrondyn=yes \
60 --with-editor=${EDITOR:=/usr/bin/nano} \
61 --with-sendmail=/usr/sbin/sendmail \
62 --with-pam=yes \
63 --with-selinux=no \
64 || die
65
66 mmake || die
67 }
68
69 src_install()
70 {
71 cd ${SRCDIR}
72
73 # this is needed to keep the correct rights for /var
74 minstalldir /var || die
75 # this is needed to keep the correct rights for /etc
76 minstalldir /etc || die
77
78 # general needed cron-files (dcron vcron etc, uses this also)
79 minstalldir /usr/sbin || die
80 minstallexec -s run-crons-0.3 /usr/sbin/run-crons || die
81 mkeepdir /etc/cron.d || die
82 mkeepdir /etc/cron.hourly || die
83 mkeepdir /etc/cron.daily || die
84 mkeepdir /etc/cron.weekly || die
85 mkeepdir /etc/cron.monthly || die
86 mkeepdir /var/spool/cron || die
87 mkeepdir /var/spool/cron/lastrun || die
88
89
90 # fcron needed directories
91 minstalldir /etc/fcron || die
92 minstalldir /usr/sbin || die
93 mkeepdir /var/spool/cron/fcrontabs || die
94
95 # install fcron bins
96 minstallexec fcron /usr/sbin || die
97 minstallexec fcrontab || die
98 minstallexec fcrondyn || die
99 minstallexec fcronsighup /usr/bin || die
100 mlink fcrontab /usr/bin/crontab || die
101
102 # install etc
103 minstallfile -s fcron.allow /etc/fcron || die
104 minstallfile -s fcron.deny /etc/fcron || die
105 minstallfile -s fcron.conf-2.9.5.1 /etc/fcron/fcron.conf || die
106 minstalletc crontab || die
107
108 # sysv init script
109 minstallrc fcron.rc-${RC_CVS_REV} fcron || die
110
111 # systemd unit
112 minstallunit fcron.service || die
113
114 # pam related
115 minstallpam fcron.pam fcron || die
116 minstallpam fcrontab.pam fcrontab || die
117
118 # now fix all permissions
119 #
120 # fix owner (run it before suid bits are set, or they wil be reseted)
121 mchown root:cron /var/spool/cron || die
122 mchown cron:cron /var/spool/cron/fcrontabs || die
123 mchown cron:cron /usr/bin/fcrontab || die
124 mchown cron:cron /usr/bin/fcrondyn || die
125 mchown root:cron /usr/bin/fcronsighup || die
126 mchown root:cron /etc/fcron/fcron.allow || die
127 mchown root:cron /etc/fcron/fcron.deny || die
128 mchown root:cron /etc/fcron/fcron.conf || die
129 #
130 # directories
131 mchmod 0750 /etc/cron.d || die
132 mchmod 0750 /etc/cron.hourly || die
133 mchmod 0750 /etc/cron.daily || die
134 mchmod 0750 /etc/cron.weekly || die
135 mchmod 0750 /etc/cron.monthly || die
136 mchmod 0750 /var/spool/cron || die
137 mchmod 0750 /var/spool/cron/lastrun || die
138 mchmod 0770 /var/spool/cron/fcrontabs || die
139 #
140 # files
141 mchmod 0755 /usr/sbin/fcron || die
142 mchmod 6755 /usr/bin/fcrontab || die
143 mchmod 6755 /usr/bin/fcrondyn || die
144 mchmod 6755 /usr/bin/fcronsighup || die
145 mchmod 0640 /etc/fcron/fcron.allow || die
146 mchmod 0640 /etc/fcron/fcron.deny || die
147 mchmod 0640 /etc/fcron/fcron.conf || die
148
149 # temporary disabled, enable it as soon as docbook gets into the tree
150 # # man pages
151 # minstallman doc/man/*.1 || die
152 # minstallman doc/man/*.3 || die
153 # minstallman doc/man/*.5 || die
154 # minstallman doc/man/*.8 || die
155
156 minstalldocs MANIFEST README VERSION || die
157 }
158
159 postinstall()
160 {
161 # needed to run fcron
162 touch ${MROOT}/var/log/wtmp
163
164 mstartservice fcron
165 mstartunit fcron.service
166
167 echo
168 echo "Each user who uses fcron should be added to the cron group"
169 echo "in /etc/group and also be added in /etc/fcron/fcron.allow"
170 echo
171 echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: "
172 echo "crontab /etc/crontab"
173 echo
174 echo "To run fcron at system boot please run: "
175 echo "rc-config add fcron"
176 echo
177 echo "!!! That will replace root's current crontab !!!"
178 echo
179 }
180
181 postremove()
182 {
183 mstopservice fcron
184 mstopunit fcron.service
185 }