[buildout]
extends =
  ../coreutils/buildout.cfg
  ../patch/buildout.cfg

parts = dcron-output

[dcron]
recipe = slapos.recipe.cmmi
shared = false
url = https://github.com/ptchinster/dcron/archive/refs/tags/v4.6.zip
md5sum = d5bd12863547daf499187bc9b4e863a8
configure-command = true
patch-binary = ${patch:location}/bin/patch
patches =
  ${:_profile_base_location_}/noroot-no-globals.patch#cd8d0f6d1d2ee133d6341d1515832c0d
  ${:_profile_base_location_}/support_old_gcc.patch#4dc8c81b1d94474c3c15e0db7b5b60de
patch-options = -p1
make-options =
  PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
post-install =
  chmod u-s %(location)s/bin/crontab

[dcron-output]
# Shared binary location to ease migration
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = ${coreutils-output:test} -x ${:crond} -a -x ${:crontab} -a ! -u ${:crontab}
crond = ${dcron:location}/sbin/crond
crontab = ${dcron:location}/bin/crontab
