-#!/bin/sh
-set -o errexit
-
-# First argument of this script is the package name.
-
-# Reading system configuration informations, functions and package versions.
-source ../sysinfos
-source ../functions
-source ../packages-list
-
-# Applying patches (if any)
-apply_patches ${1}
-
-# Define to 1 to test this package.
-RUN_TESTS=0
-
-cd ${LFS_TMP}/${1}
-export WORKINGDIR=${PWD}
-
-# Non-debug optimized build
-export BUILD_OPT=1
-
-cd mozilla/security/nss
-make nss_build_all
-
-cd ../..
-
-export NSS_LINUXDIR=$(basename `ls -d $WORKINGDIR/mozilla/dist/Linux*`)
-
-if [ ${RUN_TESTS} -eq 1 ]; then
- # Running tests
- export DOMSUF="${DOMAIN}"
- export PATH=$PATH:$WORKINGDIR/mozilla/dist/$NSS_LINUXDIR/bin
- export TEST_RESULTSDIR=$WORKINGDIR/mozilla/tests_results/security
- cd security/nss/tests
- sed -i 's/gmake/make/' common/init.sh
- ./all.sh
- TEST_RESULTS=$(grep Passed $TEST_RESULTSDIR/$(hostname --short).1/results.html | wc -l)
- if [ ${TEST_RESULTS} -ne 770 ]; then
- echo "Number of tests that passed: ${TEST_RESULTS}"
- echo "Number of tests expected to pass: 770"
- exit 1
+#!/bin/bash
+
+hvbuild()
+{
+ # Define to 1 to test this package.
+ local RUN_TESTS=0
+
+ export WORKINGDIR=${LFS_TMP}/${PACKAGE}
+
+ # Non-debug optimized build
+ export BUILD_OPT=1
+
+ cd ${LFS_TMP}/${PACKAGE}/mozilla/security/nss
+ make nss_build_all
+
+ cd ${LFS_TMP}/${PACKAGE}/mozilla
+
+ export NSS_LINUXDIR=$(basename `ls -d $WORKINGDIR/mozilla/dist/Linux*`)
+
+ if [ ${RUN_TESTS} -eq 1 ]; then
+ # Running tests
+ export DOMSUF="${DOMAIN}"
+ export PATH=$PATH:$WORKINGDIR/mozilla/dist/$NSS_LINUXDIR/bin
+ export TEST_RESULTSDIR=$WORKINGDIR/mozilla/tests_results/security
+ cd security/nss/tests
+ sed -i 's/gmake/make/' common/init.sh
+ ./all.sh
+ TEST_RESULTS=$(grep Passed $TEST_RESULTSDIR/$(hostname --short).1/results.html | wc -l)
+ if [ ${TEST_RESULTS} -ne 770 ]; then
+ echo "Number of tests that passed: ${TEST_RESULTS}"
+ echo "Number of tests expected to pass: 770"
+ exit 1
+ fi
fi
-fi
-cd ${LFS_TMP}/${1}/mozilla
-install -v -m755 nsprpub/$NSS_LINUXDIR/config/nspr-config /usr/bin
+ cd ${LFS_TMP}/${PACKAGE}/mozilla
+ install -v -m755 nsprpub/$NSS_LINUXDIR/config/nspr-config /usr/bin
#install -v -m755 -d /usr/lib/pkgconfig
#install -v -m644 nsprpub/lib/pkgconfig/nspr.pc \
# security/nss/lib/pkgconfig/nss.pc \
# /usr/lib/pkgconfig
-cd dist
-install -v -m755 $NSS_LINUXDIR/lib/*.so /usr/lib
-install -v -m644 $NSS_LINUXDIR/lib/{*.chk,libcrmf.a} /usr/lib
-install -v -m755 -d /usr/include/{nss,nspr}
-install -v -m644 {public,private}/nss/* /usr/include/nss
-cp -v -RL $NSS_LINUXDIR/include/* /usr/include/nspr
-chmod -v 644 /usr/include/nspr/prvrsion.h
-
-ldconfig
-
-exit $?
+ cd dist
+ install -v -m755 $NSS_LINUXDIR/lib/*.so /usr/lib
+ install -v -m644 $NSS_LINUXDIR/lib/{*.chk,libcrmf.a} /usr/lib
+ install -v -m755 -d /usr/include/{nss,nspr}
+ install -v -m644 {public,private}/nss/* /usr/include/nss
+ cp -v -RL $NSS_LINUXDIR/include/* /usr/include/nspr
+ chmod -v 644 /usr/include/nspr/prvrsion.h
+}