cd
test -f installed/ogmtools-1.5.tar.bz2 && mv installed/ogmtools-1.5.tar.bz2 .
test ! -f ogmtools-1.5.tar.bz2 &&
wget http://www.bunkus.org/videotools/ogmtools/ogmtools-1.5.tar.bz2
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "ogmtools-*" -exec rm -r {} \;
tar xjvf ~/ogmtools-1.5.tar.bz2
cd ogmtools-1.5
test $UID = 0 && chown -R root:root .
./configure
make
su -c "make install"
cd
mkdir -p -m 0700 installed
rm -f installed/ogmtools-*.tar.*
mv ogmtools-1.5.tar.bz2 installed/
# If you ever want to uninstall ogmtools, this should do it:
cd
su
test -d src/ogmtools-* && ( cd src/ogmtools-* ; make uninstall )
( cd /usr/local/bin
rm -f dvdxchap ogmcat ogmdemux ogminfo ogmmerge ogmsplit )
( cd /usr/local/man/man1
rm -f dvdxchap.1 ogmcat.1 ogmdemux.1 ogminfo.1 ogmmerge.1 ogmsplit.1 )
exit
find ~/src -maxdepth 1 -type d -name "ogmtools-*" -exec rm -r {} \;
rm -f ~/installed/ogmtools-*.tar.*