Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-process/fcron: metadata.xml fcron-3.0.6-r3.ebuild ChangeLog fcron-3.0.5-r2.ebuild
Date: Wed, 29 Aug 2012 17:39:11
Message-Id: 20120829173840.E1DCC20B7C@flycatcher.gentoo.org
1 flameeyes 12/08/29 17:38:40
2
3 Modified: metadata.xml ChangeLog
4 Added: fcron-3.0.6-r3.ebuild
5 Removed: fcron-3.0.5-r2.ebuild
6 Log:
7 Remove old. Add new ebuild that avoid spitting pages-long documentation and instead relies on users knowing what they are doing and use pkg_config to set up the package with its systab. Do not change files' permissions at postinst time as that's bad practice.
8
9 (Portage version: 2.2.0_alpha123/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.7 sys-process/fcron/metadata.xml
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/metadata.xml?rev=1.7&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/metadata.xml?rev=1.7&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/metadata.xml?r1=1.6&r2=1.7
17
18 Index: metadata.xml
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-process/fcron/metadata.xml,v
21 retrieving revision 1.6
22 retrieving revision 1.7
23 diff -u -r1.6 -r1.7
24 --- metadata.xml 27 Aug 2010 17:52:44 -0000 1.6
25 +++ metadata.xml 29 Aug 2012 17:38:40 -0000 1.7
26 @@ -11,13 +11,7 @@
27 <email>flameeyes@g.o</email>
28 </maintainer>
29 <use>
30 - <flag name="debug" restrict="&lt;sys-process/fcron-3.0.5">
31 - Enable debug code, output and allocation checks. Warning: in
32 - ebuilds before 3.0.5, enabling this flag will prevent fcron from
33 - running as a proper service.
34 - </flag>
35 -
36 - <flag name="debug" restrict="&gt;=sys-process/fcron-3.0.5">
37 + <flag name="debug">
38 Enable debug code and output. Since version 3.0.5 this will no
39 longer force foreground execution, and fcron will be able to run
40 as a service properly.
41 @@ -29,5 +23,12 @@
42 fcrontab will use the "fcrontab" stack to authenticate the user
43 before editing its crontab file.
44 </flag>
45 +
46 + <flag name="system-crontab">
47 + Set up fcron to respect /etc/crontab and /etc/cron.d. If this
48 + flag is disabled, /etc/cron.d and /etc/crontab will be ignored,
49 + but /etc/cron.{hourly,daily,weekly,monthly} will still be
50 + respected.
51 + </flag>
52 </use>
53 </pkgmetadata>
54
55
56
57 1.93 sys-process/fcron/ChangeLog
58
59 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/ChangeLog?rev=1.93&view=markup
60 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/ChangeLog?rev=1.93&content-type=text/plain
61 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/ChangeLog?r1=1.92&r2=1.93
62
63 Index: ChangeLog
64 ===================================================================
65 RCS file: /var/cvsroot/gentoo-x86/sys-process/fcron/ChangeLog,v
66 retrieving revision 1.92
67 retrieving revision 1.93
68 diff -u -r1.92 -r1.93
69 --- ChangeLog 24 May 2012 05:51:09 -0000 1.92
70 +++ ChangeLog 29 Aug 2012 17:38:40 -0000 1.93
71 @@ -1,6 +1,15 @@
72 # ChangeLog for sys-process/fcron
73 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
74 -# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/ChangeLog,v 1.92 2012/05/24 05:51:09 vapier Exp $
75 +# $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/ChangeLog,v 1.93 2012/08/29 17:38:40 flameeyes Exp $
76 +
77 +*fcron-3.0.6-r3 (29 Aug 2012)
78 +
79 + 29 Aug 2012; Diego E. Pettenò <flameeyes@g.o> +fcron-3.0.6-r3.ebuild,
80 + +files/fcron.init.3, +files/fcrontab.2, -fcron-3.0.5-r2.ebuild, metadata.xml:
81 + Remove old. Add new ebuild that avoid spitting pages-long documentation and
82 + instead relies on users knowing what they are doing and use pkg_config to set
83 + up the package with its systab. Do not change files' permissions at postinst
84 + time as that's bad practice.
85
86 24 May 2012; Mike Frysinger <vapier@g.o> fcron-3.0.5-r2.ebuild,
87 fcron-3.0.6-r1.ebuild, fcron-3.0.6-r2.ebuild:
88
89
90
91 1.1 sys-process/fcron/fcron-3.0.6-r3.ebuild
92
93 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/fcron-3.0.6-r3.ebuild?rev=1.1&view=markup
94 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-process/fcron/fcron-3.0.6-r3.ebuild?rev=1.1&content-type=text/plain
95
96 Index: fcron-3.0.6-r3.ebuild
97 ===================================================================
98 # Copyright 1999-2012 Gentoo Foundation
99 # Distributed under the terms of the GNU General Public License v2
100 # $Header: /var/cvsroot/gentoo-x86/sys-process/fcron/fcron-3.0.6-r3.ebuild,v 1.1 2012/08/29 17:38:40 flameeyes Exp $
101
102 EAPI=4
103
104 inherit cron pam eutils flag-o-matic user
105
106 MY_P=${P/_/-}
107 DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
108 HOMEPAGE="http://fcron.free.fr/"
109 SRC_URI="http://fcron.free.fr/archives/${MY_P}.src.tar.gz"
110
111 LICENSE="GPL-2"
112 KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
113 IUSE="debug pam selinux linguas_fr +system-crontab"
114
115 DEPEND="selinux? ( sys-libs/libselinux )
116 pam? ( virtual/pam )"
117
118 # see bug 282214 for the reason to depend on bash
119 RDEPEND="${DEPEND}
120 app-shells/bash
121 >=app-misc/editor-wrapper-3
122 pam? ( >=sys-auth/pambase-20100310 )"
123
124 S="${WORKDIR}/${MY_P}"
125
126 pkg_setup() {
127 enewgroup fcron
128 enewuser fcron -1 -1 -1 fcron
129 rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
130 [[ ${rootuser} ]] || rootuser=root
131 rootgroup=$(egetent group 0 | cut -d ':' -f 1)
132 [[ ${rootgroup} ]] || rootgroup=root
133 }
134
135 src_unpack() {
136 unpack ${A}
137 cd "${S}"
138
139 # respect LDFLAGS
140 sed -i "s:\(@LIBS@\):\$(LDFLAGS) \1:" Makefile.in || die "sed failed"
141
142 sed -i -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' script/check_system_crontabs.sh || die
143 }
144
145 src_configure() {
146 local myconf
147
148 # Don't try to pass --with-debug as it'll play with cflags as
149 # well, and run foreground which is a _very_ nasty idea for
150 # Gentoo.
151 use debug && append-flags -DDEBUG
152
153 # bindir is used just for calling fcronsighup
154 econf \
155 --with-cflags="${CFLAGS}" \
156 --bindir=/usr/libexec \
157 $(use_with pam) \
158 $(use_with selinux) \
159 --sysconfdir=/etc/fcron \
160 --with-username=fcron \
161 --with-groupname=fcron \
162 --with-piddir=/var/run \
163 --with-spooldir=/var/spool/fcron \
164 --with-fifodir=/var/run \
165 --with-fcrondyn=yes \
166 --disable-checks \
167 --with-editor=/usr/libexec/editor \
168 --with-sendmail=/usr/sbin/sendmail \
169 --with-shell=/bin/sh \
170 --without-db2man --without-dsssl-dir \
171 --with-rootname=${rootuser} \
172 --with-rootgroup=${rootgroup}
173 }
174
175 src_compile() {
176 emake || die "make failed"
177
178 # bug #216460
179 sed -i \
180 -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
181 -e 's:/usr/local/etc:/etc:g' \
182 -e 's:/usr/local/:/usr/:g' \
183 doc/*/*/*.{txt,1,5,8,html} \
184 || die "unable to fix documentation references"
185 }
186
187 src_install() {
188 keepdir /var/spool/fcron
189
190 exeinto /usr/libexec
191 doexe fcron fcronsighup
192
193 dobin fcrondyn fcrontab
194
195 insinto /etc/fcron
196 doins files/fcron.{allow,deny,conf}
197
198 if use system-crontab; then
199 dosym /usr/bin/fcrontab crontab
200
201 exeinto /usr/libexec
202 newexe script/check_system_crontabs.sh check_system_crontabs
203
204 insinto /etc/fcron
205 newins "${FILESDIR}"/fcrontab.2 fcrontab
206
207 fowners ${rootuser}:fcron /etc/fcron/fcrontab
208 fperms 0640 /etc/fcron/fcrontab
209
210 insinto /etc
211 doins "${FILESDIR}"/crontab
212 fi
213
214 fowners fcron:fcron \
215 /var/spool/fcron \
216 /usr/bin/fcron{dyn,tab}
217
218 # fcronsighup needs to be suid root, because it sends a HUP to the
219 # running fcron daemon, but only has to be called by the fcron group
220 # anyway
221 fowners ${rootuser}:fcron \
222 /usr/libexec/fcronsighup \
223 /etc/fcron \
224 /etc/fcron/fcron.{allow,deny,conf} \
225
226 fperms 6770 /var/spool/fcron
227 fperms 2775 /usr/bin/fcron{dyn,tab}
228
229 fperms 4710 /usr/libexec/fcronsighup
230
231 fperms 0750 /etc/fcron
232 fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
233
234 pamd_mimic system-services fcron auth account session
235 cat - > "${T}"/fcrontab.pam <<EOF
236 # Don't ask for the user's password; fcrontab will only allow to
237 # change user if running as root.
238 auth sufficient pam_permit.so
239
240 # Still use the system-auth stack for account and session as the
241 # sysadmin might have set up stuff properly, and also avoids
242 # sidestepping limits (since fcrontab will run $EDITOR).
243 account include system-auth
244 session include system-auth
245 EOF
246 newpamd "${T}"/fcrontab.pam fcrontab
247
248 newinitd "${FILESDIR}"/fcron.init.3 fcron
249
250 dodoc MANIFEST VERSION "${FILESDIR}"/crontab \
251 doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt
252 newdoc files/fcron.conf fcron.conf.sample
253 dohtml doc/en/HTML/*.html
254 doman doc/en/man/*.{1,5,8}
255
256 for lang in fr; do
257 use linguas_${lang} || continue
258
259 doman -i18n=${lang} doc/${lang}/man/*.{1,5,8} || die
260 docinto html/${lang}
261 dohtml doc/${lang}/HTML/*.html || die
262 done
263 }
264
265 pkg_postinst() {
266 elog "If it's the first time you install fcron make sure to execute"
267 elog " emerge --config ${CATEGORY}/${PN}"
268 elog "to configure the proper settings."
269 if ! use system-crontab; then
270 ewarn ""
271 ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
272 ewarn ""
273 fi
274 }
275
276 pkg_config() {
277 if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
278 eerror "We're not going to make any change to your systab as long as"
279 eerror "it contains data; please clear it before proceeding."
280 return 1
281 fi
282
283 if use system-crontab; then
284 elog "This is going to set up fcron to execute check_system_crontabs."
285 elog "In this configuration, you're no longer free to edit the systab"
286 elog "at your leisure, at it'll be rewritten the moment the crontabs"
287 elog "are modified."
288 /usr/libexec/check_system_crontabs -v -i -f
289 else
290 elog "This is going to set up fcron to set up a default systab that"
291 elog "executes /etc/cron.{hourly,daily,weekly,monthly}."
292 fcrontab -u systab - <<EOF
293 0 * * * * rm -f /var/spool/cron/lastrun/cron.hourly
294 1 3 * * * rm -f /var/spool/cron/lastrun/cron.daily
295 15 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
296 30 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly
297 EOF
298 fi
299 }