Linux HOWTOs

About | Home | Search


HOWTO: libtasn1
Description: Tiny ASN.1 library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# LibtASN1 4.13 (Tiny ASN.1)
# =============
# Prerequisites:
# bison
# pkg-config
# gtk-doc (optional; part of Slackware's linuxdoc-tools package)
# valgrind (optional; for testing)

# If you ever want to uninstall LibtASN1, or cleanup files from an old
# version before installing a new one, skip down to the bottom for
# instructions.

# If you upgrade LibtASN1, you should check apps/libs that link to GnuTLS
# to make sure they're still OK.  If they link with GnuTLS, they probably
# also link with LibtASN1.  You may need to rebuild and reinstall them.

# If you have trouble with the download URL below, try one of these:
# http://ftp.gnu.org/gnu/libtasn1/
# ftp://ftp.gnu.org/gnu/libtasn1/

# The announcement for this release is archived here:
# http://lists.gnu.org/archive/html/help-libtasn1/2011-11/msg00003.html

# Get it
cd
test -f installed/libtasn1-4.13.tar.gz &&
 mv installed/libtasn1-4.13.tar.gz .
test ! -f libtasn1-4.13.tar.gz &&
 wget http://ftpmirror.gnu.org/libtasn1/libtasn1-4.13.tar.gz

# Verify tarball w/ sha1sum:
# (you can also check it with "openssl sha1 libtasn1-4.13.tar.gz")
echo "a84afb4cd8187c1fa5901c6bc1cf1486eea66635  libtasn1-4.13.tar.gz" | \
sha1sum -c

# Verify tarball w/ SHA-224 using sha256sum:
# (you can also check it with "openssl sha256 libtasn1-4.13.tar.gz")
echo "7e528e8c317ddd156230c4e31d082cd13e7ddeb7a54824be82632209550c8cca  l\
ibtasn1-4.13.tar.gz" | sha256sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 9013B842 > /dev/null 2>&1 || gpg --recv-keys 9013B842 ) &&
  wget -nc http://ftp.gnu.org/gnu/libtasn1/libtasn1-4.13.tar.gz.sig &&
    gpg --verify libtasn1-4.13.tar.gz.sig && rm libtasn1-4.13.tar.gz.sig

# Extract the tarball
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "libtasn1-*" -exec rm -r {} \;
tar xzvf ~/libtasn1-4.13.tar.gz
cd libtasn1-4.13
test $UID = 0 && chown -R root:root .

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64 \
--mandir=/usr/man

# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man

# Build it
make

# Become root to install it
su

# Install it
make install
ldconfig

# If you installed it over an older version, check here for older files
# that are no longer necessary.  Generally if files do not show today's
# date, and you did not customize them yourself, they are no longer needed.
# /usr/bin/asn1*
# /usr/lib/libtasn1.*
# /usr/lib64/libtasn1.*
# /usr/man/man1/asn1*.1
# /usr/man/man3/asn1_*.3
# /usr/man/man3/libtasn1_*.3

# Make sure your non-root account can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/libtasn1-*.tar.*
mv libtasn1-4.13.tar.gz installed/


# If you ever want to uninstall LibtASN1, this should do it:
cd
su
test -d src/libtasn1-* && ( cd src/libtasn1-* ; make uninstall )
( cd /usr/bin ; rm -f asn1Coding asn1Decoding asn1Parser )
( cd /usr/lib ; rm -f libtasn1.a libtasn1.la libtasn1.so libtasn1.so.* )
test -d /usr/lib64 &&
 ( cd /usr/lib64 ; rm -f libtasn1.a libtasn1.la libtasn1.so libtasn1.so.* )
( cd /usr/man/man1 ; rm -f asn1Coding.1 asn1Decoding.1 asn1Parser.1 )
( cd /usr/man/man3 ; rm -f asn1_*.3 libtasn1_*.3 )
rm -f /usr/include/libtasn1.h /usr/info/libtasn1.info \
 /usr/lib/pkgconfig/libtasn1.pc /usr/lib64/pkgconfig/libtasn1.pc
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "libtasn1-*" -exec rm -r {} \;
rm -f ~/installed/libtasn1-*.tar.*

Back to the list


Last updated: Tue, 07 Aug 2018 12:06:17 -0400
Jason Englander <jason at englanders dot us>