summaryrefslogtreecommitdiffstats
path: root/source/d/rcs/rcs.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/rcs/rcs.SlackBuild')
-rwxr-xr-xsource/d/rcs/rcs.SlackBuild131
1 files changed, 88 insertions, 43 deletions
diff --git a/source/d/rcs/rcs.SlackBuild b/source/d/rcs/rcs.SlackBuild
index 7a3980179..8faa20ae0 100755
--- a/source/d/rcs/rcs.SlackBuild
+++ b/source/d/rcs/rcs.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2013 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,47 +20,61 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=5.7
-BUILD=${BUILD:-2}
+
+PKGNAM=rcs
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.xz | 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 ;;
- arm*) export ARCH=arm ;;
+ case "$(uname -m)" in
+ i?86) ARCH=i486 ;;
+ arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7lh ;;
# Unless $ARCH is already set, use uname -m for all other archs:
- *) export ARCH=$( uname -m ) ;;
+ *) ARCH=$(uname -m) ;;
esac
+ export ARCH
fi
-if [ "$ARCH" = "i486" ]; then
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+if [ "$ARCH" = "i386" ]; then
+ SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
else
SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
CWD=$(pwd)
TMP=${TMP:-/tmp}
-PKG=$TMP/package-rcs
+PKG=$TMP/package-$PKGNAM
rm -rf $PKG
mkdir -p $TMP $PKG
-# Explode the package framework:
-cd $PKG
-explodepkg $CWD/_rcs.tar.gz
-
-echo "+=========+"
-echo "| rcs-$VERSION |"
-echo "+=========+"
cd $TMP
-rm -rf rcs-$VERSION
-tar xvf $CWD/rcs-$VERSION.tar.gz || exit 1
-cd rcs-$VERSION
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
+cd $PKGNAM-$VERSION
chown -R root:root .
find . \
@@ -69,35 +83,66 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-zcat $CWD/rcs-$VERSION.diff.gz | patch -p0 || exit 1
-
-./configure --prefix=/usr
-
-make CFLAGS="$SLKCFLAGS" LDFLAGS=-s || exit 1
+# Configure:
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --build=$ARCH-slackware-linux
+
+# Build and install:
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# 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
+)
+
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS COPYING* HACKING INSTALL NEWS README* THANKS TODO \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+# Compress and if needed symlink the man pages:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
-cd src
-cat ci > $PKG/usr/bin/ci
-cat co > $PKG/usr/bin/co
-cat ident > $PKG/usr/bin/ident
-cat merge > $PKG/usr/bin/merge
-cat rcs > $PKG/usr/bin/rcs
-cat rcsclean > $PKG/usr/bin/rcsclean
-cat rcsdiff > $PKG/usr/bin/rcsdiff
-cat rcsmerge > $PKG/usr/bin/rcsmerge
-cat rcstest > $PKG/usr/bin/rcstest
-cat rlog > $PKG/usr/bin/rlog
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ ( cd $PKG/usr/info
+ rm -f dir
+ gzip -9 *
+ )
+fi
-cd ../man
-for page in ci.1 co.1 ident.1 merge.1 rcs.1 rcsclean.1 rcsdiff.1 rcsfreeze.1 \
-rcsintro.1 rcsmerge.1 rlog.1 ; do
- cat $page | gzip -9c > $PKG/usr/man/man1/$page.gz
-done
-cat rcsfile.5 | gzip -9c > $PKG/usr/man/man5/rcsfile.5.gz
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-# Build the package:
cd $PKG
-/sbin/makepkg -l y -c n $TMP/rcs-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz