Initial Commit

This commit is contained in:
2025-05-08 17:15:36 +03:00
commit 5de4457a5b
3 changed files with 322 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
# 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
DOWNLOAD="https://archive.mozilla.org/pub/security/nss/releases/NSS_${BPM_PKG_VERSION/./_}_RTM/src/nss-${BPM_PKG_VERSION}.tar.gz"
FILENAME="${DOWNLOAD##*/}"
# The prepare function is executed in the root of the temp directory
# This function is used for downloading files and putting them into the correct location
prepare() {
wget "$DOWNLOAD"
tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE"
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 check function is executed in the source directory
# This function is used to run tests to verify the package has been compiled correctly
check() {
cd nss/tests
HOST=localhost DOMSUF=localdomain ./all.sh
}
# 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
}