# Description: Display a random fortune
# URL: http://www.ibiblio.org/pub/Linux/games/amusements/fortune/
# Maintainer: John McQuah, jmcquah at disroot dot org

name=fortune
version=0.2
release=6
source=(https://www.ibiblio.org/pub/Linux/games/amusements/$name/$name-$version.tar.gz \
        $name-$version.patch \
  https://crux.nu/~tek/fortune_big.zip \
  https://www.schwarzvogel.de/pkgs/kernelcookies-8.tar.gz \
  https://www.splitbrain.org/_media/projects/fortunes/fortune-simpsons-chalkboard.tgz \
  https://www.splitbrain.org/_media/projects/fortunes/fortune-discworld.tgz \
  https://crux.nu/files/distfiles/fortune-mod-prog-style.tar.gz)

build(){
  local cookie
  cd $name-$version

  patch -p1 -i $SRC/$name-$version.patch
  make

  mkdir -p $PKG/usr/{bin,share/man/man6,share/games/fortunes}

  install -m 755 $name $PKG/usr/bin/$name
  install -m 644 debian/$name.6 $PKG/usr/share/man/man6/

  cd $SRC
  for cookie in */prog-style */discworld */chalkboard */kernelcookies fortune
  do
    install -m 644 $cookie $PKG/usr/share/games/fortunes/
  done
}
