Linux HOWTOs

About | Home | Search

HOWTO: ctags
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

# Exuberant Ctags 5.8
# ===================
# Slackware 13.37, 14.0, 14.1 and 14.2: vim package includes ctags 5.8
# vim and ctags are both included in the Slack 'vim' and 'xvim' (< 11.0),
# 'vim-gvim' (>= 11.0) packages

# If you ever want to uninstall Ctags, skip down to the bottom for
# instructions.

# Get it
test -f installed/ctags-5.8.tar.gz && mv installed/ctags-5.8.tar.gz .
test ! -f ctags-5.8.tar.gz &&

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

# You no longer get the etags links by default, to enable that pass
# --enable-etags to configure
# To see the other options, run './configure --help'

# Configure the build
./configure --prefix=/usr --mandir=/usr/man

# Build it

# Become root to install it

# ctags is part of the 'vim' package(s) along with vim itself.  If you were
# to remove the vim/xvim/vim-gvim packages, as you might if you were
# upgrading vim, you would loose ctags also.
# If you are planning on installing vim from source after this, remove the
# vim Slackware packages.
test -x /sbin/removepkg && /sbin/removepkg vim xvim vim-gvim
# Otherwise, only remove old Ctags files:
rm -f /usr/bin/ctags /usr/man/man1/ctags.1* \
/usr/bin/etags /usr/man/man1/etags.1*
find /usr/doc -maxdepth 1 -mindepth 1 -type d -name "ctags-*" \
-exec rm -r {} \;
rm -f /usr/man/man1/ctags.1* /usr/man/man1/etags.1*

# Install it
make install

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

# Become yourself again

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

# If you ever want to uninstall ctags, this should do it:
test -d src/ctags-* && ( cd src/ctags-* ; make uninstall )
( cd /usr/bin ; rm -f ctags etags )
find /usr/doc -maxdepth 1 -type d -name "ctags-*" -exec rm -r {} \;
( cd /usr/man/man1 ; rm -f ctags.1* etags.1* )
rm -f /usr/include/readtags.h /usr/lib/readtags.o
find ~/src -maxdepth 1 -type d -name "ctags-*" -exec rm -r {} \;
rm -f ~/installed/ctags-*.tar.*

Back to the list

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