makedepends=(vim pam systemd)

description="Feature-rich cron implementation"
url="http://fcron.free.fr"

packager="Great-OS Team"
maintainer="Great-OS Team"

name=fcron
version=3.4.0
release=5

source=(http://fcron.free.fr/archives/$name-$version.src.tar.gz)

prepare() {
  unset MAKEFLAGS
}

build() {

	cd $name-$version

	./configure --prefix=/usr \
              --sysconfdir=/etc/fcron \
              --without-sendmail \
              --localstatedir=/var \
	            --with-boot-install=no \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
              --with-systemdsystemunitdir=/usr/lib/systemd/system \
              --with-piddir=/run \
              --with-editor=/usr/bin/vim \
              --with-answer-all=no
	make
  make DESTDIR=$PKG install

  mkdir -p $PKG/etc/pam.d

  for i in fcron fcrontab
  do
    install -D -m644 files/fcron.pam $PKG/etc/pam.d/$i
  done

  # Add cron.* directories

  for j in daily hourly monthly weekly
  do
    install -d -m755 $PKG/etc/cron.$j
  done
}