Files
BMLFS/build-scripts/cracklib.build
2022-03-05 23:33:20 -06:00

65 lines
2.5 KiB
Bash

#! /bin/bash
# CrackLib
# Source: https://github.com/cracklib/cracklib/releases/download/v2.9.7/cracklib-2.9.7.tar.bz2
# Source: https://github.com/cracklib/cracklib/releases/download/v2.9.7/cracklib-words-2.9.7.bz2
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
#autoreconf -fiv &&
sed -i '/skipping/d' util/packer.c &&
./configure --prefix=/usr \
--disable-static \
--with-default-dict=/usr/lib/cracklib/pw_dict $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S install -v -m644 -D ../cracklib-words-2.9.7.bz2 \
$BUILD/usr/share/dict/cracklib-words.bz2 &&
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
cracklib: cracklib (password crack library)
cracklib:
cracklib: CrackLib is a library containing a C function (well, lots of functions
cracklib: really, but you only need to use one of them) which may be used in a
cracklib: "passwd"-like program.
cracklib:
cracklib: The idea is simple: try to prevent users from choosing passwords that
cracklib: could be guessed by "Crack" by filtering them out, at source.
cracklib:
cracklib:
cracklib:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
#sudo -S mkdir -v lib &&
#sudo -S mv -v usr/lib/libcrack.so.* lib &&
#sudo -S ln -sfv ../../lib/libcrack.so.2.9.0 usr/lib/libcrack.so &&
sudo -S bunzip2 -v usr/share/dict/cracklib-words.bz2 &&
sudo -S ln -v -sf cracklib-words usr/share/dict/words &&
#sudo -S install -v -m755 -d lib/cracklib &&
sudo -S makepkg -l y -c n $PKGS/cracklib-2.9.7-$(uname -m)-mlfs.txz &&
cp -v install/doinst.sh /tmp/ &&
cat >> /tmp/doinst.sh << "EOF"
create-cracklib-dict /usr/share/dict/cracklib-words \
/usr/share/dict/cracklib-extra-words
EOF
sudo -S mv /tmp/doinst.sh install/ &&
sudo -S makepkg -l y -c n $PKGS/cracklib-2.9.7-$(uname -m)-mlfs.txz &&
sudo -S rm -rf ${BUILD}/*