Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • npl/system/gmp/gmp.SlackBuild

    r1a19ecd rc5c522c  
    1 #!/bin/bash
     1#!/bin/sh
     2
     3# Copyright 2008, 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
     4# All rights reserved.
    25#
    3 # Automaticly created by importpackage v1.0
    4 # Imported from: http://mirrors.slackware.com/slackware/slackware-current/source/l/gmp/
    5 # Created at Mon Jan 30 23:49:35 CET 2017
     6# Redistribution and use of this script, with or without modification, is
     7# permitted provided that the following conditions are met:
     8#
     9# 1. Redistributions of this script must retain the above copyright
     10#    notice, this list of conditions and the following disclaimer.
     11#
     12#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     13#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     14#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
     15#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     16#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     17#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     18#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     19#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     20#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     21#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    622
     23# Modified 2011 by Eric Hameleers <alien at slackware.com> for ARM port.
    724
    8 ########### source original slackbuild (hopefully we dont need to modify it)
    9 CWD=`pwd`
    10 set -e
    11 source ./gmp.SlackBuild.orig
     25VERSION=${VERSION:-$(echo gmp-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
     26BUILD=${BUILD:-1}
     27
     28# Automatically determine the architecture we're building on:
     29MARCH=$( uname -m )
     30if [ -z "$ARCH" ]; then
     31  case "$MARCH" in
     32    i?86)    export ARCH=i486 ;;
     33    armv7hl) export ARCH=$MARCH ;;
     34    arm*)    export ARCH=arm ;;
     35    # Unless $ARCH is already set, use uname -m for all other archs:
     36    *)       export ARCH=$MARCH ;;
     37  esac
     38fi
     39
     40NUMJOBS=${NUMJOBS:-" -j7 "}
     41
     42CWD=$(pwd)
     43TMP=${TMP:-/tmp}
     44PKG=/$TMP/package-gmp
     45rm -rf $PKG
     46mkdir -p $TMP $PKG/usr
     47
     48if [ "$ARCH" = "i486" ]; then
     49  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
     50  LIBDIRSUFFIX=""
     51elif [ "$ARCH" = "s390" ]; then
     52  SLKCFLAGS="-O2"
     53  LIBDIRSUFFIX=""
     54elif [ "$ARCH" = "x86_64" ]; then
     55  SLKCFLAGS="-O2 -fPIC"
     56  LIBDIRSUFFIX="64"
     57elif [ "$ARCH" = "armv7hl" ]; then
     58  SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
     59  LIBDIRSUFFIX=""
     60else
     61  SLKCFLAGS="-O2"
     62  LIBDIRSUFFIX=""
     63fi
     64
     65case "$ARCH" in
     66    arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
     67    *)    TARGET=$ARCH-slackware-linux ;;
     68esac
     69
     70cd $TMP
     71rm -rf gmp-$VERSION
     72tar xvf $CWD/gmp-$VERSION.tar.xz || exit 1
     73cd gmp-$VERSION
     74chown -R root:root .
     75find . \
     76  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
     77  -exec chmod 755 {} \; -o \
     78  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
     79  -exec chmod 644 {} \;
     80
     81# End of preparations
     82if echo "$*" | grep -qw -- --prep ; then
     83  exit 0
     84fi
     85
     86CFLAGS="$SLKCFLAGS" \
     87./configure \
     88  --prefix=/usr \
     89  --libdir=/usr/lib${LIBDIRSUFFIX} \
     90  --infodir=/usr/info \
     91  --with-gnu-ld \
     92  --enable-cxx \
     93  --build=$TARGET
     94
     95make $NUMJOBS || make || exit 1
     96make install DESTDIR=$PKG || exit 1
     97
     98rm $PKG/usr/info/dir
     99gzip -9 $PKG/usr/info/*
     100
     101find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
     102  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
     103
     104mkdir -p $PKG/usr/doc/gmp-$VERSION
     105cp -a \
     106  AUTHORS COPYING* NEWS README \
     107  $PKG/usr/doc/gmp-$VERSION
     108
     109# If there's a ChangeLog, installing at least part of the recent history
     110# is useful, but don't let it get totally out of control:
     111if [ -r ChangeLog ]; then
     112  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
     113  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
     114  touch -r ChangeLog $DOCSDIR/ChangeLog
     115fi
     116
     117mkdir -p $PKG/install
     118cat $CWD/slack-desc > $PKG/install/slack-desc
     119
     120cd /$TMP/package-gmp
     121/sbin/makepkg -l y -c n $TMP/gmp-$VERSION-$ARCH-$BUILD.txz
     122
     123############ syn3 patches
     124
     125ln -s libgmp.so.10 /tmp/package-gmp/usr/lib/libgmp.so.3 || exit 1
    12126
    13127
     
    15129cd $CWD
    16130for PKG in /tmp/package-*; do
    17         NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/g'`
     131        NAME=`echo $PKG| sed 's/.*-//'`
    18132
    19133        #seperate dev-package
Note: See TracChangeset for help on using the changeset viewer.