source: npl/X/gobject_introspection/gobject-introspection.SlackBuild.orig @ 26ffad7

Last change on this file since 26ffad7 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
RevLine 
[c5c522c]1#!/bin/sh
2
3# Slackware build script for gobject-introspection
4
5# Copyright 2009 Andrew Psaltis <ampsaltis@gmail.com>
6# All rights reserved.
7#
8# Redistribution and use of this script, with or without modification, is
9# permitted provided that the following conditions are met:
10#
11# 1. Redistributions of this script must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13#
14#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
15#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16#  MERCHANTABILITY AND FITNESS:wOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
17#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25PKGNAM=gobject-introspection
26VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
27BUILD=${BUILD:-1}
28
29# Automatically determine the architecture we're building on:
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) ARCH=i586 ;;
33    arm*) ARCH=arm ;;
34    # Unless $ARCH is already set, use uname -m for all other archs:
35       *) ARCH=$( uname -m ) ;;
36  esac
37fi
38
39NUMJOBS=${NUMJOBS:-" -j7 "}
40
41CWD=$(pwd)
42TMP=${TMP:-/tmp}
43PKG=$TMP/package-$PKGNAM
44
45if [ "$ARCH" = "i486" ]; then
46  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
47  LIBDIRSUFFIX=""
48elif [ "$ARCH" = "i586" ]; then
49  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
50  LIBDIRSUFFIX=""
51elif [ "$ARCH" = "i686" ]; then
52  SLKCFLAGS="-O2 -march=i686"
53  LIBDIRSUFFIX=""
54elif [ "$ARCH" = "s390" ]; then
55  SLKCFLAGS="-O2"
56  LIBDIRSUFFIX=""
57elif [ "$ARCH" = "x86_64" ]; then
58  SLKCFLAGS="-O2 -fPIC"
59  LIBDIRSUFFIX="64"
60elif [ "$ARCH" = "armv7hl" ]; then
61  SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
62  LIBDIRSUFFIX=""
63else
64  SLKCFLAGS="-O2"
65  LIBDIRSUFFIX=""
66fi
67
68rm -rf $PKG
69mkdir -p $TMP $PKG
70cd $TMP
71rm -rf $PKGNAM-$VERSION
72tar xvf $CWD/$PKGNAM-$VERSION.tar.xz
73cd $PKGNAM-$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
81CFLAGS="$SLKCFLAGS" \
82CXXFLAGS="$SLKCFLAGS" \
83./configure \
84  --prefix=/usr \
85  --sysconfdir=/etc \
86  --libdir=/usr/lib$LIBDIRSUFFIX \
87  --mandir=/usr/man \
88  --disable-static \
89  --build=$ARCH-slackware-linux || exit 1
90
91make $NUMJOBS || make || exit 1
92make install DESTDIR=$PKG || exit 1
93
94find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
95  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
96
97# Compress and link manpages, if any:
98if [ -d $PKG/usr/man ]; then
99  ( cd $PKG/usr/man
100    for manpagedir in $(find . -type d -name "man*") ; do
101      ( cd $manpagedir
102        for eachpage in $( find . -type l -maxdepth 1) ; do
103          ln -s $( readlink $eachpage ).gz $eachpage.gz
104          rm $eachpage
105        done
106        gzip -9 *.?
107      )
108    done
109  )
110fi
111
112mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
113cp -a \
114  AUTHORS CONTRIBUTORS COPYING* NEWS README* TODO \
115  $PKG/usr/doc/$PKGNAM-$VERSION
116
117# If there's a ChangeLog, installing at least part of the recent history
118# is useful, but don't let it get totally out of control:
119if [ -r ChangeLog ]; then
120  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
121  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
122  touch -r ChangeLog $DOCSDIR/ChangeLog
123fi
124
125mkdir -p $PKG/install
126cat $CWD/slack-desc > $PKG/install/slack-desc
127
128cd $PKG
129/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.