# fss-0002

main:
  if [[ $(grep -m 1 -o '^t_cron:[^:]*:' /etc/passwd) == "" ]] ; then adduser -l /bin/bash -t target -g t_cron -n cron ; fi
  sed -i -e "s|/usr/bin/env perl|$(type -p perl)|" script/{has_usrgrp.pl,boot-install,boot-uninstall,gen-in.pl,sysVinit-launcher,gen-in.pl,user-group}
  ./configure $CONF --with-docdir=$documentation_directory --with-piddir=/var/run/cron --with-run-non-privileged=yes --with-rootname=$root_user_name --with-rootgroup=u_$root_user_name --with-pam=no --without-sendmail --with-fcrondyn=yes --with-spooldir=/home/targets/cron/data/spool --with-boot-install=no --with-selinux=no --with-username=t_cron --with-groupname=t_cron --with-fifodir=/var/run/cron/fifo --with-etcdir=/home/targets/cron/settings --with-shell=/bin/bash --sysconfdir=/home/targets/cron/settings
  echo "#undef USE_SETE_ID" >> config.h
  make
  make install
  cp -v ${PR}fcron.conf /home/targets/cron/settings/
  chown t_cron /bin/{fcrondyn,fcronsighup,fcrontab}
  chgrp e_cron /bin/{fcrondyn,fcronsighup,fcrontab}
  chmod u+rwx,g+rxs-w,o-rwx /bin/{fcrondyn,fcronsighup,fcrontab}
  chgrp t_cron /sbin/fcron
  chmod o-rx /sbin/fcron
  mv -v ${documentation_directory}fcron-$version /fcron
  mkdir -vp /fcron-html/fcron
  mkdir -vp /fcron-doc/fcron
  mv -v /fcron/en/HTML/* /fcron-html/fcron/
  mv -v /fcron/en/txt/* /fcron-doc/fcron/
  tkis_handle_documentation html standard /fcron-html/fcron/
  tkis_handle_documentation doc standard /fcron-doc/fcron/
  rm -Rf /fcron{,-html,-doc}
  ## fcron butchers the directory permissions, so fix them now!
  chgrp d_program /bin
  chgrp d_program_system /sbin
  chgrp d_setting /etc
  chgrp d_library /lib
