source: npl/system/pkg_config/pkg-config.SlackBuild

Last change on this file 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# Copyright 2008, 2009, 2010  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
23PKGNAM=pkg-config
24VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
25BUILD=${BUILD:-1}
26
27# Automatically determine the architecture we're building on:
28if [ -z "$ARCH" ]; then
29  case "$( uname -m )" in
30    i?86) export ARCH=i486 ;;
31    arm*) export ARCH=arm ;;
32    # Unless $ARCH is already set, use uname -m for all other archs:
33       *) export ARCH=$( uname -m ) ;;
34  esac
35fi
36
37NUMJOBS=${NUMJOBS:-" -j7 "}
38
39CWD=$(pwd)
40TMP=${TMP:-/tmp}
41PKG=$TMP/package-pkg-config
42rm -rf $PKG
43mkdir -p $TMP $PKG/usr
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"
54elif [ "$ARCH" = "arm" ]; then
55  SLKCFLAGS="-O2 -march=armv4 -mtune=xscale"
56  LIBDIRSUFFIX=""
57elif [ "$ARCH" = "armel" ]; then
58  SLKCFLAGS="-O2 -march=armv4t"
59  LIBDIRSUFFIX=""
60else
61  SLKCFLAGS="-O2"
62  LIBDIRSUFFIX=""
63fi
64
65cd $TMP
66rm -rf pkg-config-$VERSION
67tar xvf $CWD/pkg-config-$VERSION.tar.?z* || exit 1
68cd pkg-config-$VERSION || exit 1
69chown -R root:root .
70find . \
71  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
72  -exec chmod 755 {} \; -o \
73  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
74  -exec chmod 644 {} \;
75
76CFLAGS="$SLKCFLAGS" \
77./configure \
78  --prefix=/usr \
79  --libdir=/usr/lib${LIBDIRSUFFIX} \
80  --mandir=/usr/man \
81  --docdir=/usr/doc/pkg-config-$VERSION \
82  --build=${ARCH}-slackware-linux
83
84make $NUMJOBS || make || exit 1
85make install DESTDIR=$PKG || exit 1
86
87mkdir -p $PKG/etc/profile.d/
88for script in $(ls $CWD/scripts/*) ; do
89  cat ${script} | sed -e "s#/lib/#/lib${LIBDIRSUFFIX}/#g" \
90    > $PKG/etc/profile.d/$(basename ${script})
91done
92chown root:root $PKG/etc/profile.d/*
93chmod 755 $PKG/etc/profile.d/*
94
95find $PKG | xargs file | grep -e "executable" -e "shared object" \
96  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
97
98gzip -9 $PKG/usr/man/man?/*.?
99
100mkdir -p $PKG/usr/doc/pkg-config-$VERSION
101cp -a \
102  AUTHORS COPYING NEWS README \
103  $PKG/usr/doc/pkg-config-$VERSION
104
105mkdir -p $PKG/install
106zcat $CWD/doinst.sh.gz | sed -e "s#/lib/#/lib${LIBDIRSUFFIX}/#g" \
107  > $PKG/install/doinst.sh
108cat $CWD/slack-desc > $PKG/install/slack-desc
109
110cd $TMP/package-pkg-config
111/sbin/makepkg -l y -c n $TMP/pkg-config-$VERSION-$ARCH-$BUILD.txz
112
113
114############ make syn3 packages
115cd $CWD
116for PKG in /tmp/package-*; do
117        NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/'`
118
119        #seperate dev-package
120        syn3_move_dev $PKG $PKG""_dev
121        syn3_makepkg $PKG""_dev $NAME""_dev $VERSION $ARCH || exit 1
122
123        #make main package
124        syn3_makepkg $PKG $NAME $VERSION $ARCH || exit 1
125done
Note: See TracBrowser for help on using the repository browser.