Update for new BUILD_DIR and SRC_DIR variables
[hvlinux.git] / stage5 / pkg / nss
index e81e231..cddbc5e 100644 (file)
@@ -2,49 +2,26 @@
 
 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
-
-    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 ${SRC_DIR}/nss
+
+    # This package does not support parallel build
+    make BUILD_OPT=1 \
+        NSPR_INCLUDE_DIR=/usr/include/nspr \
+        USE_SYSTEM_ZLIB=1 \
+        ZLIB_LIBS=-lz \
+        $([ $(uname -m) = x86_64 ] && echo USE_64=1) \
+        $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1)
+}
 
-    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
+hvbuild_post()
+{
+    cd ${SRC_DIR}/dist
+
+    install -v -m755 Linux*/lib/*.so /usr/lib
+    install -v -m644 Linux*/lib/{*.chk,libcrmf.a} /usr/lib
+    install -v -m755 -d /usr/include/nss
+    cp -v -RL {public,private}/nss/* /usr/include/nss
+    chmod 644 /usr/include/nss/*
+    install -v -m755 Linux*/bin/{certutil,nss-config,pk12util} /usr/bin
+    install -v -m644 Linux*/lib/pkgconfig/nss.pc /usr/lib/pkgconfig
 }