# Get the source tarball
cd
test -f installed/nspr-4.35.tar.gz && mv installed/nspr-4.35.tar.gz .
test ! -f nspr-4.35.tar.gz &&
wget https://ftp.mozilla.org/pub/nspr/releases/v4.35/src/nspr-4.35.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "nspr-*" -exec rm -r {} \;
tar xzvf ~/nspr-4.35.tar.gz
cd nspr-4.35
test $UID = 0 && chown -R root:root .
cd nspr
# Create a build directory
mkdir obj-`build/autoconf/config.guess`
cd obj-`build/autoconf/config.guess`
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
../configure --prefix=/usr --libdir=/usr/lib64 --enable-optimize \
--disable-debug --enable-strip --enable-64bit
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
../configure --prefix=/usr --enable-optimize --disable-debug --enable-strip
# Build it
make
# Tests
# There is a ./pr/tests that you build them in, but see README.txt in
# ../pr/tests
# Become root to install it
su
# Remove the mozilla-nss (and nspr) package, if there is one
# Once you're finished here, move on to the nss HOWTO
test -x /sbin/removepkg && /sbin/removepkg mozilla-nss
# If you did not remove old versions of NSPR, look here for old
# versions of files and zap them if you're 100% sure they're not in use
# (or just leave them there and hope for the best)
test -d /usr/include/nspr && rm -r /usr/include/nspr
( cd /usr/lib ; rm -f libnspr4.* libplc4.* libplds4.* )
test -d /usr/lib64 &&
( cd /usr/lib64 ; rm -f libnspr4.* libplc4.* libplds4.* )
# Install it
make install
ldconfig
test $(uname -m) = 'x86_64' && test -d /usr/lib64/pkgconfig &&
( cd /usr/lib64/pkgconfig
test ! -L mozilla-nspr.pc && test -f nspr.pc &&
ln -sf nspr.pc mozilla-nspr.pc )
test $(uname -m) != 'x86_64' && test -d /usr/lib/pkgconfig &&
( cd /usr/lib/pkgconfig
test ! -L mozilla-nspr.pc && test -f nspr.pc &&
ln -sf nspr.pc mozilla-nspr.pc )
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/nspr-*.tar.*
mv nspr-4.35.tar.gz installed/
# If you ever want to uninstall NSPR, this should do it:
cd
su
for pfx in /usr /usr/local;
do
rm -f ${pfx}/bin/nspr-config ${pfx}/share/aclocal/nspr.m4
test -d ${pfx}/include/nspr && rm -r ${pfx}/include/nspr
for libdir in ${pfx}/lib ${pfx}/lib64;
do
test -d $libdir &&
( cd $libdir
rm -f libnspr4.* libplc4.* libplds4.* pkgconfig/nspr.pc )
done
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "nspr-*" -exec rm -r {} \;
rm -f ~/installed/nspr-*.tar.*