Files
shadow/source.sh
T

43 lines
1.7 KiB
Bash

# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
# Disable installation of groups binary as coreutils provides a better alternative
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
# Disable installation of man pages found in man-pages package
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;
./configure --sysconfdir=/etc \
--disable-static \
--with-{b,yes}crypt \
--with-libbsd \
--with-group-name-max-length=32 \
--disable-logind
make
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
make DESTDIR="$BPM_OUTPUT" exec_prefix=/usr pamdir= install
# Install man pages
make -C man DESTDIR="$BPM_OUTPUT" install-man
# Install pam configuration files
install -d "$BPM_OUTPUT"/etc/pam.d
install -Dm644 "$BPM_WORKDIR"/pam.d/* -t "$BPM_OUTPUT"/etc/pam.d/
# Install login.defs configuration file
cp ../login.defs "$BPM_OUTPUT"/etc/login.defs
# Install package license
install -Dm644 COPYING "$BPM_OUTPUT"/usr/share/licenses/shadow/COPYING
}