Linux HOWTOs

About | Home | Search


HOWTO: source-highlight
Description: Given a source file, produces a document with syntax highlighting
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


# GNU Source-highlight 2.3
# ========================
# gawk
# grep
# boost's regex library
# bison
# flex
# valgrind (optional)
# help2man
# ctags
# tar
# texi2html (optional)

cd
test -f installed/source-highlight-2.3.tar.gz &&
 mv installed/source-highlight-2.3.tar.gz .
test ! -f source-highlight-2.3.tar.gz &&
 wget http://ftp.gnu.org/gnu/src-highlite/source-highlight-2.3.tar.gz

# Verify tarball w/ md5sum:
echo "321d7e5142aae85261054bc9f7cb8394  source-highlight-2.3.tar.gz" | \
 md5sum -c

# Verify tarball w/ sha1sum:
echo "d7b94846bb611adf448586a8ee6ffdaf757fa103  source-highlight-2.3.tar.\
gz" | sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys 9E629EAC > /dev/null 2>&1 || gpg --recv-keys 9E629EAC ) &&
 wget -nc http://ftp.gnu.org/gnu/src-highlite/\
source-highlight-2.3.tar.gz.sig &&
  gpg --verify source-highlight-2.3.tar.gz.sig &&
   rm source-highlight-2.3.tar.gz.sig

mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "source-highlight-*" -exec rm -r {} \;
tar xzvf ~/source-highlight-2.3.tar.gz
cd source-highlight-2.3
test $UID = 0 && chown -R root:root .
./configure
make
su -c "make install"
cd
mkdir -p -m 0700 installed
rm -f installed/source-highlight-*.tar.*
mv source-highlight-2.3.tar.gz installed/


# If you ever want to uninstall source-highlight, this should do it:
cd
su
test -d src/source-highlight-* &&
 ( cd src/source-highlight-* ; make uninstall )
( cd /usr/local/bin ; rm -f cpp2html java2html source-highlight \
 src-hilite-lesspipe.sh )
test -d /usr/local/share/source-highlight &&
 rm -r /usr/local/share/source-highlight
test -d /usr/local/share/doc/source-highlight &&
 rm -r /usr/local/share/doc/source-highlight
rm -f /usr/local/info/source-highlight.info \
 /usr/local/man/man1/source-highlight.1
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "source-highlight-*" -exec rm -r {} \;
rm -f ~/installed/source-highlight-*.tar.*

Back to the list


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