source: npl/system/libmpc/libmpc.SlackBuild @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 3.8 KB
Line 
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.
8#
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.
25
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
114
115
116############ make syn3 packages
117cd $CWD
118for PKG in /tmp/package-*; do
119        NAME=`echo $PKG| sed 's/.*-//'`
120
121        #seperate dev-package
122        syn3_move_dev $PKG $PKG""_dev
123        syn3_makepkg $PKG""_dev $NAME""_dev $VERSION $ARCH || exit 1
124
125        #make main package
126        syn3_makepkg $PKG $NAME $VERSION $ARCH || exit 1
127done
Note: See TracBrowser for help on using the repository browser.