# If you ever want to uninstall strace, or just clean up files from an
# old version before installing the new one, skip down to the bottom for
# instructions.
# Prerequisites:
# Perl (configure looks for it, not sure if strace needs it or not)
# FYI: I was not able to build this on an old Slackware 12.2-based machine
# with gcc 4.2.4, but no problem with a Slackware 13.37-based one with
# GCC 4.5.2 I did not dig in to the reason, I don't particularly need a
# newer strace on the older one ATM.
# Get it
cd
test -f installed/strace-4.7.tar.xz &&
mv installed/strace-4.7.tar.xz .
test ! -f strace-4.7.tar.xz &&
wget http://download.sf.net/strace/strace-4.7.tar.xz
# Extract it
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "strace-*" -exec rm -r {} \;
tar xJvf ~/strace-4.7.tar.xz
cd strace-4.7
test $UID = 0 && chown -R root:root .
# Configure and build it
./configure --prefix=/usr --mandir=/usr/man
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg strace
# Install it, stripping binaries
make install-strip
# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .
# If you ever want to uninstall strace, this should do it:
cd
su
test -d src/strace-* && ( cd src/strace-* ; make uninstall )
( cd /usr/bin ; rm -f strace strace-graph strace-log-merge )
rm -f /usr/man/man1/strace.1
exit
find ~/src -maxdepth 1 -type d -name "strace-*" -exec rm -r {} \;
rm -f ~/installed/strace-*.tar.*