Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/fcron/
Date: Tue, 19 Oct 2021 20:26:35
Message-Id: 1634675098.b9d9761d3fc5fd321bcd3b4e283dd091b3748a0b.blueness@gentoo
1 commit: b9d9761d3fc5fd321bcd3b4e283dd091b3748a0b
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 19 20:17:28 2021 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 19 20:24:58 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9d9761d
7
8 sys-process/fcron: migrate to glep 81
9
10 Also updated to EAPI 7.
11
12 Bug: https://bugs.gentoo.org/781518
13 Package-Manager: Portage-3.0.28, Repoman-3.0.3
14 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
15 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
16
17 sys-process/fcron/fcron-3.2.1-r6.ebuild | 266 ++++++++++++++++++++++++++
18 sys-process/fcron/fcron-3.3.0_beta-r3.ebuild | 270 +++++++++++++++++++++++++++
19 2 files changed, 536 insertions(+)
20
21 diff --git a/sys-process/fcron/fcron-3.2.1-r6.ebuild b/sys-process/fcron/fcron-3.2.1-r6.ebuild
22 new file mode 100644
23 index 00000000000..eee51e1d3c3
24 --- /dev/null
25 +++ b/sys-process/fcron/fcron-3.2.1-r6.ebuild
26 @@ -0,0 +1,266 @@
27 +# Copyright 1999-2021 Gentoo Authors
28 +# Distributed under the terms of the GNU General Public License v2
29 +
30 +EAPI=7
31 +
32 +WANT_AUTOMAKE="none"
33 +
34 +inherit autotools cron flag-o-matic pam systemd
35 +
36 +DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
37 +HOMEPAGE="http://fcron.free.fr/"
38 +SRC_URI="http://fcron.free.fr/archives/${P}.src.tar.gz"
39 +
40 +LICENSE="GPL-2"
41 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
42 +IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
43 +
44 +DEPEND="
45 + acct-group/fcron
46 + acct-user/fcron
47 + virtual/libcrypt:=
48 + audit? ( sys-process/audit )
49 + pam? ( sys-libs/pam )
50 + readline? ( sys-libs/readline:= )
51 + selinux? ( sys-libs/libselinux )
52 +"
53 +
54 +RDEPEND="
55 + ${DEPEND}
56 + app-misc/editor-wrapper
57 + mta? ( virtual/mta )
58 + pam? ( sys-auth/pambase )
59 +"
60 +
61 +PATCHES=(
62 + "${FILESDIR}"/${PN}-3.1.1-noreadline.patch
63 + "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
64 + "${FILESDIR}"/${PN}-3.2.1-musl-getopt-order.patch
65 +)
66 +
67 +pkg_setup() {
68 + rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
69 + [[ ${rootuser} ]] || rootuser=root
70 + rootgroup=$(egetent group 0 | cut -d ':' -f 1)
71 + [[ ${rootgroup} ]] || rootgroup=root
72 +}
73 +
74 +src_prepare() {
75 + default
76 +
77 + # respect LDFLAGS
78 + sed "s:\(@LIBS@\):\$(LDFLAGS) \1:" -i Makefile.in || die "sed failed"
79 +
80 + # Adjust fcrontab path
81 + sed -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' -i script/check_system_crontabs.sh || die
82 +
83 + mv configure.in configure.ac || die
84 +
85 + cp "${FILESDIR}"/crontab.2 "${WORKDIR}"/crontab || die
86 +
87 + eautoconf
88 +}
89 +
90 +src_configure() {
91 + # Don't try to pass --with-debug as it'll play with cflags as
92 + # well, and run foreground which is a _very_ nasty idea for
93 + # Gentoo.
94 + use debug && append-cppflags -DDEBUG
95 +
96 + # bindir is used just for calling fcronsighup
97 + local myeconfargs=(
98 + --with-cflags="${CFLAGS}"
99 + --bindir=/usr/libexec
100 + --sbindir=/usr/libexec
101 + $(use_with audit)
102 + $(use_with mta sendmail)
103 + $(use_with pam)
104 + $(use_with readline)
105 + $(use_with selinux)
106 + --sysconfdir=/etc/fcron
107 + --with-username=fcron
108 + --with-groupname=fcron
109 + --with-piddir=/run
110 + --with-spooldir=/var/spool/fcron
111 + --with-fifodir=/run
112 + --with-fcrondyn=yes
113 + --disable-checks
114 + --with-editor=/usr/libexec/editor
115 + --with-shell=/bin/sh
116 + --without-db2man
117 + --without-dsssl-dir
118 + --with-rootname=${rootuser}
119 + --with-rootgroup=${rootgroup}
120 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
121 + )
122 +
123 + econf "${myeconfargs[@]}"
124 +}
125 +
126 +src_compile() {
127 + default
128 +
129 + # bug #216460
130 + sed \
131 + -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
132 + -e 's:/usr/local/etc:/etc:g' \
133 + -e 's:/usr/local/:/usr/:g' \
134 + -i doc/*/*/*.{txt,1,5,8,html} \
135 + || die "unable to fix documentation references"
136 +}
137 +
138 +src_install() {
139 + keepdir /var/spool/fcron
140 +
141 + exeinto /usr/libexec
142 + doexe fcron fcronsighup
143 +
144 + dobin fcrondyn fcrontab
145 +
146 + insinto /etc/fcron
147 + doins files/fcron.{allow,deny,conf}
148 +
149 + if use system-crontab; then
150 + dosym fcrontab /usr/bin/crontab
151 +
152 + exeinto /usr/libexec
153 + newexe script/check_system_crontabs.sh check_system_crontabs
154 +
155 + insinto /etc/fcron
156 + newins "${FILESDIR}"/fcrontab.2 fcrontab
157 +
158 + fowners ${rootuser}:fcron /etc/fcron/fcrontab
159 + fperms 0640 /etc/fcron/fcrontab
160 +
161 + insinto /etc
162 + newins "${FILESDIR}"/crontab.2 crontab
163 + fi
164 +
165 + fowners fcron:fcron \
166 + /var/spool/fcron \
167 + /usr/bin/fcron{dyn,tab}
168 +
169 + # fcronsighup needs to be suid root, because it sends a HUP to the
170 + # running fcron daemon, but only has to be called by the fcron group
171 + # anyway
172 + fowners ${rootuser}:fcron \
173 + /usr/libexec/fcronsighup \
174 + /etc/fcron/fcron.{allow,deny,conf} \
175 + /etc/fcron
176 +
177 + fperms 6770 /var/spool/fcron
178 + fperms 6775 /usr/bin/fcron{dyn,tab}
179 +
180 + fperms 4710 /usr/libexec/fcronsighup
181 +
182 + fperms 0750 /etc/fcron
183 + fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
184 +
185 + use pam && pamd_mimic system-services fcron auth account session
186 + cat > "${T}"/fcrontab.pam <<- EOF
187 + # Don't ask for the user's password; fcrontab will only allow to
188 + # change user if running as root.
189 + auth sufficient pam_permit.so
190 +
191 + # Still use the system-auth stack for account and session as the
192 + # sysadmin might have set up stuff properly, and also avoids
193 + # sidestepping limits (since fcrontab will run \$EDITOR).
194 + account include system-auth
195 + session include system-auth
196 + EOF
197 + use pam && newpamd "${T}"/fcrontab.pam fcrontab
198 +
199 + newinitd "${FILESDIR}"/fcron.init-r5 fcron
200 + systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
201 +
202 + newconfd "${FILESDIR}"/fcron.confd fcron
203 +
204 + local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
205 + DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
206 +
207 + local HTML_DOCS=( doc/en/HTML/. )
208 +
209 + einstalldocs
210 +
211 + newdoc files/fcron.conf fcron.conf.sample
212 + doman doc/en/man/*.{1,5,8}
213 +
214 + for lang in fr; do
215 + use l10n_${lang} || continue
216 +
217 + doman -i18n=${lang} doc/${lang}/man/*.{1,5,8}
218 +
219 + docinto html/${lang}
220 + dodoc -r doc/${lang}/HTML/.
221 + done
222 +}
223 +
224 +pkg_postinst() {
225 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
226 + # This is a new installation
227 + elog "Make sure you execute"
228 + elog ""
229 + elog " # emerge --config ${CATEGORY}/${PN}"
230 + elog ""
231 + elog "to install the default systab on this system."
232 + else
233 + local v
234 + for v in ${REPLACING_VERSIONS}; do
235 + if ! version_is_at_least "3.2.1" ${v}; then
236 + # This is an upgrade
237 +
238 + elog "fcron's default systab was updated since your last installation."
239 + elog "You can use"
240 + elog ""
241 + elog " # emerge --config ${CATEGORY}/${PN}"
242 + elog ""
243 + elog "to re-install systab (do not call this command before you"
244 + elog "have merged your configuration files)."
245 +
246 + # Show this elog only once
247 + break
248 + fi
249 + done
250 + fi
251 +
252 + if ! use system-crontab; then
253 + echo ""
254 + ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
255 + ewarn "due to USE=-system-crontab!"
256 + echo ""
257 + fi
258 +}
259 +
260 +pkg_config() {
261 + if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
262 + eerror "We're not going to make any change to your systab as long as"
263 + eerror "it contains data; please clear it before proceeding."
264 + eerror "You can do that with"
265 + eerror ""
266 + eerror " # fcrontab -u systab -r"
267 + eerror ""
268 + eerror "However you are advised to do this by hand to review existing"
269 + eerror "systab just in case."
270 + return 1
271 + fi
272 +
273 + if use system-crontab; then
274 + elog "This is going to set up fcron to execute check_system_crontabs."
275 + elog "In this configuration, /etc/crontab and /etc/cron.d are respected."
276 + elog "Per default fcron will check for modifications every 10 minutes."
277 + /usr/libexec/check_system_crontabs -v -i -f
278 + else
279 + elog "This is going to set up fcron to set up a default systab that"
280 + elog "executes /etc/cron.{hourly,daily,weekly,monthly} but will ignore"
281 + elog "/etc/crontab and /etc/cron.d."
282 + fcrontab -u systab - <<- EOF
283 + !serial(true)
284 + 00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
285 + 00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
286 + 00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
287 + 00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
288 + */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
289 + !serial(false)
290 + EOF
291 + fi
292 +}
293
294 diff --git a/sys-process/fcron/fcron-3.3.0_beta-r3.ebuild b/sys-process/fcron/fcron-3.3.0_beta-r3.ebuild
295 new file mode 100644
296 index 00000000000..7af1483a4c8
297 --- /dev/null
298 +++ b/sys-process/fcron/fcron-3.3.0_beta-r3.ebuild
299 @@ -0,0 +1,270 @@
300 +# Copyright 1999-2021 Gentoo Authors
301 +# Distributed under the terms of the GNU General Public License v2
302 +
303 +EAPI=7
304 +
305 +WANT_AUTOMAKE="none"
306 +
307 +inherit autotools cron flag-o-matic pam systemd
308 +
309 +MY_PV="${PV/_beta/}"
310 +MY_P="${PN}-${MY_PV}"
311 +
312 +DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
313 +HOMEPAGE="http://fcron.free.fr/"
314 +SRC_URI="http://fcron.free.fr/archives/${MY_P}.src.tar.gz -> ${P}.tar.gz"
315 +S="${WORKDIR}/${MY_P}"
316 +
317 +LICENSE="GPL-2"
318 +KEYWORDS="~riscv"
319 +IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
320 +
321 +DEPEND="
322 + acct-group/fcron
323 + acct-user/fcron
324 + virtual/libcrypt:=
325 + audit? ( sys-process/audit )
326 + pam? ( sys-libs/pam )
327 + readline? ( sys-libs/readline:= )
328 + selinux? ( sys-libs/libselinux )
329 +"
330 +
331 +RDEPEND="
332 + ${DEPEND}
333 + app-misc/editor-wrapper
334 + mta? ( virtual/mta )
335 + pam? ( sys-auth/pambase )
336 +"
337 +
338 +PATCHES=(
339 + "${FILESDIR}"/${PN}-3.1.1-noreadline.patch
340 + "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
341 + "${FILESDIR}"/${PN}-3.2.1-musl-getopt-order.patch
342 +)
343 +
344 +pkg_setup() {
345 + rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
346 + [[ ${rootuser} ]] || rootuser=root
347 + rootgroup=$(egetent group 0 | cut -d ':' -f 1)
348 + [[ ${rootgroup} ]] || rootgroup=root
349 +}
350 +
351 +src_prepare() {
352 + default
353 +
354 + # respect LDFLAGS
355 + sed "s:\(@LIBS@\):\$(LDFLAGS) \1:" -i Makefile.in || die "sed failed"
356 +
357 + # Adjust fcrontab path
358 + sed -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' -i script/check_system_crontabs.sh || die
359 +
360 + mv configure.in configure.ac || die
361 +
362 + cp "${FILESDIR}"/crontab.2 "${WORKDIR}"/crontab || die
363 +
364 + eautoconf
365 +}
366 +
367 +src_configure() {
368 + # Don't try to pass --with-debug as it'll play with cflags as
369 + # well, and run foreground which is a _very_ nasty idea for
370 + # Gentoo.
371 + use debug && append-cppflags -DDEBUG
372 +
373 + # bindir is used just for calling fcronsighup
374 + local myeconfargs=(
375 + --with-cflags="${CFLAGS}"
376 + --bindir=/usr/libexec
377 + --sbindir=/usr/libexec
378 + $(use_with audit)
379 + $(use_with mta sendmail)
380 + $(use_with pam)
381 + $(use_with readline)
382 + $(use_with selinux)
383 + --sysconfdir=/etc/fcron
384 + --with-username=fcron
385 + --with-groupname=fcron
386 + --with-piddir=/run
387 + --with-spooldir=/var/spool/fcron
388 + --with-fifodir=/run
389 + --with-fcrondyn=yes
390 + --disable-checks
391 + --with-editor=/usr/libexec/editor
392 + --with-shell=/bin/sh
393 + --without-db2man
394 + --without-dsssl-dir
395 + --with-rootname=${rootuser}
396 + --with-rootgroup=${rootgroup}
397 + --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
398 + )
399 +
400 + econf "${myeconfargs[@]}"
401 +}
402 +
403 +src_compile() {
404 + default
405 +
406 + # bug #216460
407 + sed \
408 + -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
409 + -e 's:/usr/local/etc:/etc:g' \
410 + -e 's:/usr/local/:/usr/:g' \
411 + -i doc/*/*/*.{txt,1,5,8,html} \
412 + || die "unable to fix documentation references"
413 +}
414 +
415 +src_install() {
416 + keepdir /var/spool/fcron
417 +
418 + exeinto /usr/libexec
419 + doexe fcron fcronsighup
420 +
421 + dobin fcrondyn fcrontab
422 +
423 + insinto /etc/fcron
424 + doins files/fcron.{allow,deny,conf}
425 +
426 + if use system-crontab; then
427 + dosym fcrontab /usr/bin/crontab
428 +
429 + exeinto /usr/libexec
430 + newexe script/check_system_crontabs.sh check_system_crontabs
431 +
432 + insinto /etc/fcron
433 + newins "${FILESDIR}"/fcrontab.2 fcrontab
434 +
435 + fowners ${rootuser}:fcron /etc/fcron/fcrontab
436 + fperms 0640 /etc/fcron/fcrontab
437 +
438 + insinto /etc
439 + newins "${FILESDIR}"/crontab.2 crontab
440 + fi
441 +
442 + fowners fcron:fcron \
443 + /var/spool/fcron \
444 + /usr/bin/fcron{dyn,tab}
445 +
446 + # fcronsighup needs to be suid root, because it sends a HUP to the
447 + # running fcron daemon, but only has to be called by the fcron group
448 + # anyway
449 + fowners ${rootuser}:fcron \
450 + /usr/libexec/fcronsighup \
451 + /etc/fcron/fcron.{allow,deny,conf} \
452 + /etc/fcron
453 +
454 + fperms 6770 /var/spool/fcron
455 + fperms 6775 /usr/bin/fcron{dyn,tab}
456 +
457 + fperms 4710 /usr/libexec/fcronsighup
458 +
459 + fperms 0750 /etc/fcron
460 + fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
461 +
462 + use pam && pamd_mimic system-services fcron auth account session
463 + cat > "${T}"/fcrontab.pam <<- EOF
464 + # Don't ask for the user's password; fcrontab will only allow to
465 + # change user if running as root.
466 + auth sufficient pam_permit.so
467 +
468 + # Still use the system-auth stack for account and session as the
469 + # sysadmin might have set up stuff properly, and also avoids
470 + # sidestepping limits (since fcrontab will run \$EDITOR).
471 + account include system-auth
472 + session include system-auth
473 + EOF
474 + use pam && newpamd "${T}"/fcrontab.pam fcrontab
475 +
476 + newinitd "${FILESDIR}"/fcron.init-r5 fcron
477 + systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
478 +
479 + newconfd "${FILESDIR}"/fcron.confd fcron
480 +
481 + local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
482 + DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
483 +
484 + local HTML_DOCS=( doc/en/HTML/. )
485 +
486 + einstalldocs
487 +
488 + newdoc files/fcron.conf fcron.conf.sample
489 + doman doc/en/man/*.{1,5,8}
490 +
491 + for lang in fr; do
492 + use l10n_${lang} || continue
493 +
494 + doman -i18n=${lang} doc/${lang}/man/*.{1,5,8}
495 +
496 + docinto html/${lang}
497 + dodoc -r doc/${lang}/HTML/.
498 + done
499 +}
500 +
501 +pkg_postinst() {
502 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
503 + # This is a new installation
504 + elog "Make sure you execute"
505 + elog ""
506 + elog " # emerge --config ${CATEGORY}/${PN}"
507 + elog ""
508 + elog "to install the default systab on this system."
509 + else
510 + local v
511 + for v in ${REPLACING_VERSIONS}; do
512 + if ! version_is_at_least "3.2.1" ${v}; then
513 + # This is an upgrade
514 +
515 + elog "fcron's default systab was updated since your last installation."
516 + elog "You can use"
517 + elog ""
518 + elog " # emerge --config ${CATEGORY}/${PN}"
519 + elog ""
520 + elog "to re-install systab (do not call this command before you"
521 + elog "have merged your configuration files)."
522 +
523 + # Show this elog only once
524 + break
525 + fi
526 + done
527 + fi
528 +
529 + if ! use system-crontab; then
530 + echo ""
531 + ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
532 + ewarn "due to USE=-system-crontab!"
533 + echo ""
534 + fi
535 +}
536 +
537 +pkg_config() {
538 + if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
539 + eerror "We're not going to make any change to your systab as long as"
540 + eerror "it contains data; please clear it before proceeding."
541 + eerror "You can do that with"
542 + eerror ""
543 + eerror " # fcrontab -u systab -r"
544 + eerror ""
545 + eerror "However you are advised to do this by hand to review existing"
546 + eerror "systab just in case."
547 + return 1
548 + fi
549 +
550 + if use system-crontab; then
551 + elog "This is going to set up fcron to execute check_system_crontabs."
552 + elog "In this configuration, /etc/crontab and /etc/cron.d are respected."
553 + elog "Per default fcron will check for modifications every 10 minutes."
554 + /usr/libexec/check_system_crontabs -v -i -f
555 + else
556 + elog "This is going to set up fcron to set up a default systab that"
557 + elog "executes /etc/cron.{hourly,daily,weekly,monthly} but will ignore"
558 + elog "/etc/crontab and /etc/cron.d."
559 + fcrontab -u systab - <<- EOF
560 + !serial(true)
561 + 00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
562 + 00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
563 + 00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
564 + 00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
565 + */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
566 + !serial(false)
567 + EOF
568 + fi
569 +}