#!/bin/sh
VERSION=0.93.94

CWD=`pwd`
cd /tmp
tar xjvf $CWD/lesstif-$VERSION.tar.bz2
cd lesstif-$VERSION
chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;

CFLAGS="-O2 -march=i486 -mcpu=i686" \
./configure --enable-shared \
            --enable-static \
            --enable-build-21 \
            --enable-build-Xlt \
            --enable-build-Xbae \
            --enable-xbae-24bit \
            --enable-xbae-row-heights \
            --disable-debug \
            --enable-production \
            --prefix=/usr/X11R6 \
            i486-slackware-linux
make
# I'm taking these out to see if anyone cares
#            --enable-build-12
#            --enable-build-20
rm -rf /etc/X11/mwm /usr/X11R6/lib/X11/mwm
# I know this is destructive, but that's the way the cookie crumbles:
rm -f /usr/X11R6/lib/X11/config/host.def
make install
( cd /usr/doc ; rm -rf lesstif-$VERSION ; ln -sf /usr/X11R6/LessTif lesstif-$VERSION )
mkdir -p /usr/X11R6/lib/X11/config
cp -a /usr/X11R6/lib/LessTif/config/* /usr/X11R6/lib/X11/config
( cd /usr/X11R6/lib/X11/config ; mv host.def host.def-lesstif )
( cd /usr/X11R6/lib/X11 ; cp -a mwm /etc/X11 ; rm -rf mwm ; ln -sf ../../../../etc/X11/mwm . )
# Look out for this one, too:
rm -rf /install
mkdir /install
zcat $CWD/doinst.sh.gz > /install/doinst.sh
cat $CWD/slack-desc > /install/slack-desc