diff options
Diffstat (limited to 'development/fpc/fpc.SlackBuild')
-rw-r--r-- | development/fpc/fpc.SlackBuild | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/development/fpc/fpc.SlackBuild b/development/fpc/fpc.SlackBuild index f6bdf874e1..858756f41f 100644 --- a/development/fpc/fpc.SlackBuild +++ b/development/fpc/fpc.SlackBuild @@ -24,24 +24,34 @@ # Modified by the SlackBuilds.org project. PRGNAM=fpc -VERSION=${SRCVER:-2.2.4} -ARCH=${ARCH:-i386} +VERSION=${SRCVER:-2.4.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$( uname -m ) ;; + esac +fi + CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "x86_64" ]; then +if [ "$ARCH" = "i486" ]; then + ARCH=i386 + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then ARCH=x86_64 LIBDIRSUFFIX="64" - echo "NOTICE: $ARCH is UNSUPPORTED." - exit else - ARCH=i386 - LIBDIRSUFFIX="" + printf "$ARCH is not supported...\n" + exit 1 fi set -e @@ -70,10 +80,11 @@ tar xvf $CWD/$PRGNAM-$VERSION.$ARCH-linux.tar # Install program cd $PKG/usr -for file in `ls $TMP/$PRGNAM-$VERSION/binary/*tar.gz` +for file in $(ls $TMP/$PRGNAM-$VERSION/binary/*tar.gz) do tar xvf $file done +[ "$LIBDIRSUFFIX" = "64" ] && mv $PKG/usr/lib $PKG/usr/lib${LIBDIRSUFFIX} cd $PKG/usr/bin if [ "$ARCH" = "x86_64" ]; then @@ -85,18 +96,20 @@ fi # copy docs mv $PKG/usr/share/doc $PKG/usr/doc rmdir $PKG/usr/share -mv $TMP/$PRGNAM-$VERSION/docs/share/doc/fpdocs-$VERSION/*.pdf \ - $PKG/usr/doc/$PRGNAM-$VERSION/ +# No idea why, but the pdf docs are in different places depending on arch +if [ "$ARCH" = "x86_64" ]; then + mv $TMP/$PRGNAM-$VERSION/docs/doc/*.pdf $PKG/usr/doc/$PRGNAM-$VERSION +else + mv $TMP/$PRGNAM-$VERSION/docs/share/doc/fpdocs-$VERSION/*.pdf \ + $PKG/usr/doc/$PRGNAM-$VERSION/ +fi +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +find $PKG/usr/doc -type d -name '.svn' | xargs rm -rf -# Strip binaries and libraries. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -# Compress man pages. -( 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 -) +find $PKG/usr/man -type f -exec gzip -9 {} \; # Create compiler config file. mkdir -p $PKG/etc $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/ide/text @@ -109,8 +122,6 @@ sed -i -e "s:$PKG::g" $PKG/etc/fpc.cfg sed -i -e "s:$PKG::g" $PKG/usr/lib$LIBDIRSUFFIX/fpc/$VERSION/ide/text/fp.cfg mv $PKG/etc/fpc.cfg $PKG/etc/fpc.cfg.new -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild - mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh |