Contents of /branches/magellan-next/core/fcron/fcron-3.0.6-r5.smage2
Parent Directory | Revision Log
Revision 8829 -
(show annotations)
(download)
Tue Aug 2 10:19:30 2011 UTC (13 years, 1 month ago) by niro
File size: 4733 byte(s)
Tue Aug 2 10:19:30 2011 UTC (13 years, 1 month ago) by niro
File size: 4733 byte(s)
-use new system-auth stack
1 | # $Id$ |
2 | |
3 | PNAME="fcron" |
4 | PVER="3.0.6" |
5 | PBUILD="r5" |
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 | RC_CVS_REV=1.2 |
28 | |
29 | SRC_URI=( |
30 | ftp://ftp.seul.org/pub/${PNAME}/${SRCFILE} |
31 | http://fcron.free.fr/archives/${SRCFILE} |
32 | mirror://${PNAME}/${SRCFILE} |
33 | mirror://${PNAME}/run-crons-0.3 |
34 | mirror://${PNAME}/fcron.allow |
35 | mirror://${PNAME}/fcron.deny |
36 | mirror://${PNAME}/fcron.conf-2.9.5.1 |
37 | mirror://${PNAME}/crontab |
38 | mirror://${PNAME}/fcron.rc-${RC_CVS_REV} |
39 | mirror://${PNAME}/fcron.pam-systemauth |
40 | mirror://${PNAME}/fcrontab.pam-systemauth |
41 | mirror://${PNAME}/fcron.service |
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 | # sysv init script |
108 | minstallrc fcron.rc-${RC_CVS_REV} fcron || die |
109 | |
110 | # systemd unit |
111 | minstallunit fcron.service || die |
112 | |
113 | # pam related |
114 | minstallpam fcron.pam-systemauth fcron || die |
115 | minstallpam fcrontab.pam-systemauth fcrontab || die |
116 | |
117 | # now fix all permissions |
118 | # |
119 | # fix owner (run it before suid bits are set, or they wil be reseted) |
120 | mchown cron:cron /var/spool/cron || die |
121 | mchown cron:cron /var/spool/cron/fcrontabs || die |
122 | mchown cron:cron /usr/bin/fcrontab || die |
123 | mchown cron:cron /usr/bin/fcrondyn || die |
124 | mchown root:cron /usr/bin/fcronsighup || die |
125 | mchown root:cron /etc/fcron/fcron.allow || die |
126 | mchown root:cron /etc/fcron/fcron.deny || die |
127 | mchown root:cron /etc/fcron/fcron.conf || die |
128 | # |
129 | # directories |
130 | mchmod 0750 /etc/cron.d || die |
131 | mchmod 0750 /etc/cron.hourly || die |
132 | mchmod 0750 /etc/cron.daily || die |
133 | mchmod 0750 /etc/cron.weekly || die |
134 | mchmod 0750 /etc/cron.monthly || die |
135 | mchmod 6770 /var/spool/cron || die |
136 | mchmod 0750 /var/spool/cron/lastrun || die |
137 | mchmod 0770 /var/spool/cron/fcrontabs || die |
138 | # |
139 | # files |
140 | mchmod 0755 /usr/sbin/fcron || die |
141 | mchmod 6755 /usr/bin/fcrontab || die |
142 | mchmod 6755 /usr/bin/fcrondyn || die |
143 | mchmod 6755 /usr/bin/fcronsighup || die |
144 | mchmod 0640 /etc/fcron/fcron.allow || die |
145 | mchmod 0640 /etc/fcron/fcron.deny || die |
146 | mchmod 0640 /etc/fcron/fcron.conf || die |
147 | |
148 | # temporary disabled, enable it as soon as docbook gets into the tree |
149 | # # man pages |
150 | # minstallman doc/man/*.1 || die |
151 | # minstallman doc/man/*.3 || die |
152 | # minstallman doc/man/*.5 || die |
153 | # minstallman doc/man/*.8 || die |
154 | |
155 | minstalldocs MANIFEST README VERSION || die |
156 | } |
157 | |
158 | postinstall() |
159 | { |
160 | # needed to run fcron |
161 | touch ${MROOT}/var/log/wtmp |
162 | |
163 | mstartservice fcron |
164 | mstartunit fcron.service |
165 | |
166 | echo |
167 | echo "Each user who uses fcron should be added to the cron group" |
168 | echo "in /etc/group and also be added in /etc/fcron/fcron.allow" |
169 | echo |
170 | echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: " |
171 | echo "crontab /etc/crontab" |
172 | echo |
173 | echo "To run fcron at system boot please run: " |
174 | echo "rc-config add fcron" |
175 | echo |
176 | echo "!!! That will replace root's current crontab !!!" |
177 | echo |
178 | } |
179 | |
180 | postremove() |
181 | { |
182 | mstopservice fcron |
183 | mstopunit fcron.service |
184 | } |