2010-05-11 15:00:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for mpc
|
|
|
|
|
|
|
|
# Written by Meckafett thumpadoodle@hotmail.com
|
|
|
|
|
|
|
|
PRGNAM=mpc
|
|
|
|
VERSION=0.12.1
|
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-13 00:21:43 +02:00
|
|
|
|
2010-05-11 15:00:27 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2010-05-13 00:21:43 +02:00
|
|
|
DOCS="AUTHORS COPYING ChangeLog INSTALL README
|
|
|
|
doc/mpc-bashrc doc/mppledit doc/pls-handler.sh
|
|
|
|
doc/m3u-handler.sh"
|
2010-05-11 15:00:27 +02:00
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 00:21:43 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 15:00:27 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:21:43 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-11 15:00:27 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-13 00:21:43 +02:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 15:00:27 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
2010-05-13 00:21:43 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 15:00:27 +02:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--datarootdir=/usr \
|
|
|
|
--localstatedir=/var
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
|
|
|
( cd $PKG
|
2010-05-13 00:21:43 +02:00
|
|
|
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
|
2010-05-11 15:00:27 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
( cd $PKG/usr/man
|
|
|
|
find . -type f -exec gzip -9 {} \;
|
|
|
|
for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
|
|
|
|
)
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
|
|
|
|
# Remove the documentation wrongly installed in /usr/share/doc
|
|
|
|
rm -rf $PKG/usr/share/
|
|
|
|
# Remove empty folder /usr/mpc
|
|
|
|
rm -rf $PKG/usr/mpc/
|
|
|
|
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 00:21:43 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|