Ignore:
File:
1 edited

Legend:

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

    r1a19ecd rc5c522c  
    1 #!/bin/bash
     1#!/bin/sh
     2
     3#DEP:gmp
     4#DEP:mpfr
     5
     6# Copyright 2010, 2011  Patrick J. Volkerding, Sebeka, Minnesota, USA
     7# All rights reserved.
    28#
    3 # Automaticly created by importpackage v1.0
    4 # Imported from: http://mirrors.slackware.com/slackware/slackware-current/source/l/libmpc/
    5 # Created at Tue Jan 31 00:15:39 CET 2017
    6 #DEP:mpfr
    7 #DEP:gmp
     9# Redistribution and use of this script, with or without modification, is
     10# permitted provided that the following conditions are met:
     11#
     12# 1. Redistributions of this script must retain the above copyright
     13#    notice, this list of conditions and the following disclaimer.
     14#
     15#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     16#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     17#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
     18#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     19#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     20#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     21#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     22#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     23#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     24#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    825
    9 ########### source original slackbuild (hopefully we dont need to modify it)
    10 CWD=`pwd`
    11 set -e
    12 source ./libmpc.SlackBuild.orig
     26
     27# I really do not like to package source under a different name than upstream,
     28# but in this case there is a media player frontend that is well-known as
     29# mpc already, and it appears that other projects are packaging this mpc as
     30# libmpc instead.  It is probably best to follow suit.
     31SRCNAM=mpc
     32PKGNAM=libmpc
     33VERSION=${VERSION:-$(echo $SRCNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
     34BUILD=${BUILD:-2}
     35
     36# Automatically determine the architecture we're building on:
     37if [ -z "$ARCH" ]; then
     38  case "$( uname -m )" in
     39    i?86) export ARCH=i486 ;;
     40    arm*) export ARCH=arm ;;
     41    # Unless $ARCH is already set, use uname -m for all other archs:
     42       *) export ARCH=$( uname -m ) ;;
     43  esac
     44fi
     45
     46NUMJOBS=${NUMJOBS:-" -j7 "}
     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"
     57else
     58  SLKCFLAGS="-O2"
     59  LIBDIRSUFFIX=""
     60fi
     61
     62CWD=$(pwd)
     63TMP=${TMP:-/tmp}
     64PKG=$TMP/package-$SRCNAM
     65rm -rf $PKG
     66mkdir -p $TMP $PKG
     67
     68cd $TMP
     69rm -rf $SRCNAM-$VERSION
     70tar xvf $CWD/$SRCNAM-$VERSION.tar.?z* || exit 1
     71cd $SRCNAM-$VERSION
     72chown -R root:root .
     73
     74CFLAGS="$SLKCFLAGS" \
     75./configure \
     76  --prefix=/usr \
     77  --libdir=/usr/lib${LIBDIRSUFFIX} \
     78  --infodir=/usr/info \
     79  --docdir=/usr/doc/$PKGNAM-$VERSION \
     80  --enable-static=yes \
     81  --enable-shared=yes \
     82  --build=$ARCH-slackware-linux
     83
     84make $NUMJOBS || make || exit 1
     85make install DESTDIR=$PKG || exit 1
     86
     87find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
     88  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
     89
     90# Hardly a savings doing this...
     91#strip -g $PKG/usr/lib${LIBDIRSUFFIX}/*.a
     92
     93rm -f $PKG/usr/info/dir
     94gzip -9 $PKG/usr/info/*
     95
     96mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
     97cp -a \
     98  AUTHORS COPYING* INSTALL NEWS README* TODO \
     99  $PKG/usr/doc/$PKGNAM-$VERSION
     100
     101# If there's a ChangeLog, installing at least part of the recent history
     102# is useful, but don't let it get totally out of control:
     103if [ -r ChangeLog ]; then
     104  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
     105  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
     106  touch -r ChangeLog $DOCSDIR/ChangeLog
     107fi
     108
     109mkdir -p $PKG/install
     110cat $CWD/slack-desc > $PKG/install/slack-desc
     111
     112cd $PKG
     113/sbin/makepkg -l y -c n $TMP/$PKGNAM-${VERSION}-${ARCH}-${BUILD}.txz
    13114
    14115
     
    16117cd $CWD
    17118for PKG in /tmp/package-*; do
    18         NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/g'`
     119        NAME=`echo $PKG| sed 's/.*-//'`
    19120
    20121        #seperate dev-package
Note: See TracChangeset for help on using the changeset viewer.