2010-05-12 02:00:36 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for lilypond
|
|
|
|
# Written by Kyle Guinn <elyk03@gmail.com>
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
PRGNAM=lilypond
|
2010-05-13 06:28:04 +08:00
|
|
|
VERSION=2.12.2
|
2010-05-12 02:00:36 +08:00
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-13 06:28:04 +08:00
|
|
|
|
2010-05-12 02:00:36 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
2010-05-13 06:28:04 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 02:00:36 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
2010-05-13 06:28:04 +08:00
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-05-12 02:00:36 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-13 06:28:04 +08:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
2010-05-12 02:00:36 +08:00
|
|
|
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 06:28:04 +08:00
|
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \
|
2010-05-12 02:00:36 +08:00
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--disable-debugging
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-13 06:28:04 +08:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-12 02:00:36 +08: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
|
|
|
|
)
|
|
|
|
|
|
|
|
rm -f $PKG/usr/info/dir
|
|
|
|
gzip -9 $PKG/usr/info/*.info*
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-05-13 06:28:04 +08:00
|
|
|
cp -a AUTHORS.txt COPYING DEDICATION HACKING INSTALL.txt NEWS.txt \
|
2010-05-12 02:00:36 +08:00
|
|
|
README.txt ROADMAP THANKS VERSION $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
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 06:28:04 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|