1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#! /bin/sh
# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
TMP=/tmp
fi
PACKAGE=@PACKAGE@
VERSION=@VERSION@
if [ "$ARCH" = "" ]; then
ARCH="`arch`"
if [ "$ARCH" = "" ]; then
ARCH="i486"
fi
fi
BUILD=1
# |-----handy-ruler------------------------------------------------------|"
DESC="\
microdc: microdc (a command-line based Direct Connect client)
microdc:
microdc: microdc is a command-line based Direct Connect client that uses the
microdc: GNU Readline library for user interaction. It was developed from
microdc: ground up and does not depend on any other program. Despite the
microdc: command-line user interface, microdc was designed to be user
microdc: friendly and simple to use.
microdc:
microdc: microdc is currently in beta state - there may be many bugs not yet
microdc: discovered. It also lacks some features that other clients support,
microdc: such as file hashing, multiple hub connections, and hub list support.
microdc:
microdc: microdc homepage: http://www.nongnu.org/microdc/"
PKG=$TMP/package-$PACKAGE
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "powerpc" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2 -march=$ARCH"
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP # location to build the source
fi
rm -rf $PKG
if [ ! -d $PKG ]; then
mkdir -p $PKG # place for the package to be built
fi
cd $TMP || exit 1
rm -rf $PACKAGE-$VERSION
tar xzvf $CWD/$PACKAGE-$VERSION.tar.gz
cd $PACKAGE-$VERSION || exit 1
chown -R root:root .
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=/usr/lib$LIBDIRSUFFIX \
$ARCH-slackware-linux || exit 1
make || exit 1
make install DESTDIR=$PKG
gzip -9 $PKG/usr/man/man?/*.?
mkdir -p $PKG/usr/doc/$PACKAGE-$VERSION
cp -a \
ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL INTERNALS NEWS README TODO \
$PKG/usr/doc/$PACKAGE-$VERSION/
rm -rf $PKG/usr/share/doc
chmod 644 $PKG/usr/doc/$PACKAGE-$VERSION/*
chown -R root:root $PKG/
chgrp -R bin $PKG/usr/bin
( cd $PKG || exit 1
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/install
echo "$DESC" > $PKG/install/slack-desc
# Build the package:
cd $PKG || exit 1
makepkg --linkadd y --chown n $CWD/$PACKAGE-$VERSION-$ARCH-$BUILD.tgz
# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
rm -rf $TMP/$PACKAGE-$VERSION
rm -rf $PKG
fi
|