#!/bin/sh
CWD=`pwd`
cd /tmp

# First, back up the good libintl.h and locale.alias, since
# 'make install' will stomp on them.  We don't include these
# libintl headers or libraries, since glibc already provides them.

mkdir -p /tmp/real-headers
cp -a /usr/include/libintl.h /tmp/real-headers
cp -a /usr/share/locale/locale.alias /tmp/real-headers

# Build and install:
tar xzvf $CWD/gettext-0.10.38.tar.gz
cd gettext-0.10.38
./configure --prefix=/usr \
   --with-included-gettext \
   --disable-shared \
   i386-slackware-linux
make CFLAGS=-O2
make CFLAGS=-O2 install

mkdir -p /usr/doc/gettext-0.10.38
cp -a ABOUT-NLS AUTHORS BUGS COPYING ChangeLog DISCLAIM INSTALL \
  NEWS README README-alpha README.gemtext THANKS TODO /usr/doc/gettext-0.10.38
chown root.root /usr/doc/gettext-0.10.38/*
chmod 644 /usr/doc/gettext-0.10.38/*

# Remove library that glibc2 makes obsolete:
rm /usr/lib/libintl.la
rm /usr/lib/libintl.a

# Now, put the real files back:
mv /tmp/real-headers/libintl.h /usr/include
mv /tmp/real-headers/locale.alias /usr/share/locale/locale.alias
rmdir /tmp/real-headers
