source: npl/system/libmpc/libmpc.SlackBuild.orig @ 9b9dbbb

Last change on this file since 9b9dbbb was 1a19ecd, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

upgrade glibc/gcc to gcc 5.4.0 and glibc 2.24

  • Property mode set to 100755
File size: 3.4 KB
Line 
1#!/bin/sh
2
3# Copyright 2010, 2011, 2015  Patrick J. Volkerding, Sebeka, Minnesota, USA
4# All rights reserved.
5#
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.
22
23
24# I really do not like to package source under a different name than upstream,
25# but in this case there is a media player frontend that is well-known as
26# mpc already, and it appears that other projects are packaging this mpc as
27# libmpc instead.  It is probably best to follow suit.
28SRCNAM=mpc
29PKGNAM=libmpc
30VERSION=${VERSION:-$(echo $SRCNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
31BUILD=${BUILD:-1}
32
33# Automatically determine the architecture we're building on:
34if [ -z "$ARCH" ]; then
35  case "$( uname -m )" in
36    i?86) export ARCH=i486 ;;
37    arm*) export ARCH=arm ;;
38    # Unless $ARCH is already set, use uname -m for all other archs:
39       *) export ARCH=$( uname -m ) ;;
40  esac
41fi
42
43NUMJOBS=${NUMJOBS:-" -j7 "}
44
45if [ "$ARCH" = "i486" ]; then
46  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
47  LIBDIRSUFFIX=""
48elif [ "$ARCH" = "s390" ]; then
49  SLKCFLAGS="-O2"
50  LIBDIRSUFFIX=""
51elif [ "$ARCH" = "x86_64" ]; then
52  SLKCFLAGS="-O2 -fPIC"
53  LIBDIRSUFFIX="64"
54else
55  SLKCFLAGS="-O2"
56  LIBDIRSUFFIX=""
57fi
58
59CWD=$(pwd)
60TMP=${TMP:-/tmp}
61PKG=$TMP/package-$SRCNAM
62rm -rf $PKG
63mkdir -p $TMP $PKG
64
65cd $TMP
66rm -rf $SRCNAM-$VERSION
67tar xvf $CWD/$SRCNAM-$VERSION.tar.?z* || exit 1
68cd $SRCNAM-$VERSION
69chown -R root:root .
70
71CFLAGS="$SLKCFLAGS" \
72./configure \
73  --prefix=/usr \
74  --libdir=/usr/lib${LIBDIRSUFFIX} \
75  --infodir=/usr/info \
76  --docdir=/usr/doc/$PKGNAM-$VERSION \
77  --enable-static=yes \
78  --enable-shared=yes \
79  --build=$ARCH-slackware-linux
80
81make $NUMJOBS || make || exit 1
82make install DESTDIR=$PKG || exit 1
83
84find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
85  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
86
87# Hardly a savings doing this...
88#strip -g $PKG/usr/lib${LIBDIRSUFFIX}/*.a
89
90rm -f $PKG/usr/info/dir
91gzip -9 $PKG/usr/info/*
92
93mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
94cp -a \
95  AUTHORS COPYING* INSTALL NEWS README* TODO \
96  $PKG/usr/doc/$PKGNAM-$VERSION
97
98# If there's a ChangeLog, installing at least part of the recent history
99# is useful, but don't let it get totally out of control:
100if [ -r ChangeLog ]; then
101  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
102  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
103  touch -r ChangeLog $DOCSDIR/ChangeLog
104fi
105
106mkdir -p $PKG/install
107cat $CWD/slack-desc > $PKG/install/slack-desc
108
109cd $PKG
110/sbin/makepkg -l y -c n $TMP/$PKGNAM-${VERSION}-${ARCH}-${BUILD}.txz
111
Note: See TracBrowser for help on using the repository browser.