Magellan Linux

Contents of /trunk/core/fcron/fcron-3.0.6-r6.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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