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:

# The announcement for this release is archived here:

# Get it
test -f installed/libtasn1-4.13.tar.gz &&
 mv installed/libtasn1-4.13.tar.gz .
test ! -f 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 &&
    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 \

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

# Build it

# Become root to install it

# Install it
make install

# 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

# Save the source for later
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:
test -d src/libtasn1-* && ( cd src/libtasn1-* ; make uninstall )
( cd /usr/bin ; rm -f asn1Coding asn1Decoding asn1Parser )
( cd /usr/lib ; rm -f libtasn1.a* )
test -d /usr/lib64 &&
 ( cd /usr/lib64 ; rm -f libtasn1.a* )
( 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/ \
 /usr/lib/pkgconfig/libtasn1.pc /usr/lib64/pkgconfig/libtasn1.pc
find ~/src -maxdepth 1 -type d -name "libtasn1-*" -exec rm -r {} \;
rm -f ~/installed/libtasn1-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>