Files
BMLFS/build-scripts/cracklib.build
2024-08-09 12:03:07 -05:00

69 lines
2.6 KiB
Bash

#! /bin/bash
# CrackLib
# Source: https://github.com/cracklib/cracklib/releases/download/v2.10.0/cracklib-2.10.0.tar.xz
# Source: https://github.com/cracklib/cracklib/releases/download/v2.10.0/cracklib-words-2.10.0.xz
#
# $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 ../pkgs/cracklib-words-2.10.0.xz \
$BUILD/usr/share/dict/cracklib-words.xz &&
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 unxz -v usr/share/dict/cracklib-words.xz
sudo -S ln -v -sf cracklib-words usr/share/dict/words
sudo -S install -v -m755 -d usr/lib/cracklib
cat > /tmp/doinst.sh << "EOF"
echo $(hostname) >> /usr/share/dict/cracklib-extra-words
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.10.0-$PSUFFIX &&
sudo -S rm -rf ${BUILD}/*