CWD=`pwd`

VERSION=2.6.3
ARCH=${ARCH:-i486}

if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2"
fi

cd /tmp
rm -rf nautilus-$VERSION
tar xjvf $CWD/nautilus-$VERSION.tar.bz2
cd nautilus-$VERSION

# It's only fair that Slackware should get a link, too.
zcat $CWD/nautilus.bookmarks.diff.gz | patch -p1

chown -R root.root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
#
# Disabling the Mozilla component.  As a replacement, Galeon can be compiled so that
# it can function as the Nautilus web view component.  This removes the Nautilus
# dependency on Mozilla, which is a good thing, and improves stability since Galeon
# follows Mozilla changes more closely (also a good thing).  The only drawback is that
# compiling Galeon with the Nautilus view makes it link to all the Nautilus libraries.
# In fact, I find that messy enough that I'm not compiling Galeon that way, so Nautilus
# will be a file browser only, not a web browser.
#
# Whenever Nautilus-1.0.7 ships the Mozilla-view-component will be gone anyway, lest
# anyone thinks I've lost my mind.  ;-)
#
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --mandir=/usr/man \
  --infodir=/usr/info \
  --localstatedir=/var/lib \
  --disable-more-warnings \
  --disable-mozilla-component \
  --disable-static \
  $ARCH-slackware-linux
make -j3
make install
## [useless with gnome2...]
## This is the Scalable SVG theme that was recently announced on www.gnome.org,
## but with the non-redistributable trademarked logos removed:
#( cd /usr/share/pixmaps/nautilus ; tar xzf $CWD/nautilus-gorilla.tar.gz )
mkdir -p /usr/doc/nautilus-$VERSION
cp -a \
  AUTHORS COPYING COPYING-DOCS COPYING.LIB HACKING MAINTAINERS NEWS README THANKS TODO \
  /usr/doc/nautilus-$VERSION
mkdir -p /install
cat $CWD/slack-desc > /install/slack-desc

