summaryrefslogtreecommitdiffstats
path: root/source/a/tcsh/tcsh.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/tcsh/tcsh.SlackBuild')
-rwxr-xr-xsource/a/tcsh/tcsh.SlackBuild80
1 files changed, 47 insertions, 33 deletions
diff --git a/source/a/tcsh/tcsh.SlackBuild b/source/a/tcsh/tcsh.SlackBuild
index 44e398c0a..2fe0f1c22 100755
--- a/source/a/tcsh/tcsh.SlackBuild
+++ b/source/a/tcsh/tcsh.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010, 2012, 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2008, 2009, 2010, 2012, 2013, 2015 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,25 +21,28 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=6.18.01
-BUILD=${BUILD:-2}
+PKGNAM=tcsh
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
CWD=$(pwd)
TMP=${TMP:-/tmp}
-PKG=$TMP/package-tcsh
+PKG=$TMP/package-${PKGNAM}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
@@ -47,18 +50,16 @@ elif [ "$ARCH" = "x86_64" ]; then
fi
rm -rf $PKG
-mkdir -p $TMP $PKG
+mkdir -p $TMP $PKG/etc
cd $TMP
-rm -rf tcsh-$VERSION
-tar xvf $CWD/tcsh-$VERSION.tar.?z* || exit 1
-cd tcsh-$VERSION
-
-zcat $CWD/tcsh-6.18.01-crypt.diff.gz | patch -p0 --verbose || exit 1
+rm -rf ${PKGNAM}-$VERSION
+tar xvf $CWD/${PKGNAM}-$VERSION.tar.?z* || exit 1
+cd ${PKGNAM}-$VERSION || exit 1
# The LS_COLORS variable shared by tcsh has new options in recent
# versions of coreutils that cause tcsh to exit, so disable the
# built-in color ls:
-zcat $CWD/tcsh.nobuiltincolorls.diff.gz | patch -p1 --verbose || exit 1
+zcat $CWD/${PKGNAM}.nobuiltincolorls.diff.gz | patch -p1 --verbose || exit 1
chown -R root:root .
find . \
@@ -67,36 +68,49 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Configure:
CFLAGS="$SLKCFLAGS" \
./configure \
- --prefix= \
- $ARCH-slackware-linux
-make -j4 || exit 1
-mkdir -p $PKG/etc
-mkdir -p $PKG/bin
-cat tcsh > $PKG/bin/tcsh
-chmod 755 $PKG/bin/tcsh
-mkdir -p $PKG/usr/man/man1
-cat tcsh.man | gzip -9c > $PKG/usr/man/man1/tcsh.1.gz
-echo '.so man1/tcsh.1' | gzip -9c > $PKG/usr/man/man1/csh.1.gz
+ --prefix=/usr \
+ --bindir=/bin \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --build=$ARCH-slackware-linux || exit 1
+
+# Build and install:
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+( cd $PKG/bin ; ln -sf tcsh csh )
+( cd $PKG/usr/share/man/man1 ; ln -sf tcsh.1 csh.1 )
+mv $PKG/usr/share/man $PKG/usr
+
+# Strip binaries:
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
-mkdir -p $PKG/usr/doc/tcsh-$VERSION
+
+# Compress manual pages:
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz
+ rm $i
+done
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
cp -a \
- BUGS FAQ Fixes NewThings Ported README README.imake WishList Y2K \
- $PKG/usr/doc/tcsh-$VERSION
+ BUGS Copyright FAQ Fixes NewThings Ported README* WishList Y2K \
+ complete.tcsh \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Build the package:
cd $PKG
-makepkg -l y -c n $TMP/tcsh-$VERSION-$ARCH-$BUILD.txz
+makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
-# Clean up the extra stuff:
-if [ "$1" = "--cleanup" ]; then
- rm -rf $TMP/tcsh-${VERSION}
- rm -rf $PKG
-fi