# Description: CrackLib Library and Dictionaries
# URL: https://github.com/cracklib/cracklib
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on:

name=cracklib
version=2.9.11
release=1
source=(https://github.com/cracklib/cracklib/releases/download/v$version/$name-$version.tar.gz)

build() {
  cd $name-$version

  cp -p lib/packer.h lib/packer.h.in
  AUTOPOINT=true autoreconf -fi

  PYTHON=/usr/bin/python3 \
  ./configure --prefix=/usr \
    --sbindir=/usr/bin \
    --enable-static \
    --disable-nls

  make
  make DESTDIR=$PKG install

  mkdir -p $PKG/usr/share/dict
  ln -sf /usr/share/cracklib/cracklib-small $PKG/usr/share/dict/cracklib-small
  sh ./util/cracklib-format dicts/cracklib-small \
    | sh ./util/cracklib-packer $PKG/usr/share/cracklib/pw_dict
}
