Files
nss/source.sh
T

35 lines
1.6 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 prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"
# Patch from Beyond Linux from Scratch
patch -Np1 -i ../nss.patch
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
cd nss
make BUILD_OPT=1 NSPR_INCLUDE_DIR=/usr/include/nspr USE_SYSTEM_ZLIB=1 ZLIB_LIBS=-lz NSS_ENABLE_WERROR=0 USE_64=1 NSS_USE_SYSTEM_SQLITE=1
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
cd dist
install -dm755 "$BPM_OUTPUT"/usr/{lib/pkgconfig,bin,include/nss}
install -Dm755 Linux*/lib/*.so "$BPM_OUTPUT"/usr/lib
install -Dm644 Linux*/lib/{*.chk,libcrmf.a} "$BPM_OUTPUT"/usr/lib
cp -v -RL {public,private}/nss/* "$BPM_OUTPUT"/usr/include/nss
install -Dm755 Linux*/bin/{certutil,nss-config,pk12util} "$BPM_OUTPUT"/usr/bin
install -Dm644 Linux*/lib/pkgconfig/nss.pc "$BPM_OUTPUT"/usr/lib/pkgconfig
ln -sf pkcs11/p11-kit-trust.so "$BPM_OUTPUT"/usr/lib/p11-kit-trust.so
ln -sf p11-kit-trust.so "$BPM_OUTPUT"/usr/lib/libnssckbi.so
}