Magellan Linux

Contents of /branches/R11-unstable/core/fcron/fcron-3.1.2-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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