source: npl/overig/swig/swig.SlackBuild.orig @ fe3434a

Last change on this file since fe3434a 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.6 KB
Line 
1#!/bin/sh
2
3# Copyright 2009  Robby Workman, Northport, Alabama, USA
4# Copyright 2009, 2010, 2011  Patrick J. Volkerding, Sebeka, MN, USA
5# All rights reserved.
6#
7# Redistribution and use of this script, with or without modification, is
8# permitted provided that the following conditions are met:
9#
10# 1. Redistributions of this script must retain the above copyright
11#    notice, this list of conditions and the following disclaimer.
12#
13#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
14#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
16#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
18#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
19#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24PKGNAM=swig
25VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26BUILD=${BUILD:-1}
27
28# Automatically determine the architecture we're building on:
29if [ -z "$ARCH" ]; then
30  case "$( uname -m )" in
31    i?86) export ARCH=i586 ;;
32    arm*) export ARCH=arm ;;
33    # Unless $ARCH is already set, use uname -m for all other archs:
34       *) export ARCH=$( uname -m ) ;;
35  esac
36fi
37
38CWD=$(pwd)
39TMP=${TMP:-/tmp}
40PKG=${PKG:-$TMP/package-swig}
41
42if [ "$ARCH" = "i586" ]; then
43  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
44elif [ "$ARCH" = "i686" ]; then
45  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
46elif [ "$ARCH" = "x86_64" ]; then
47  SLKCFLAGS="-O2 -fPIC"
48else
49  SLKCFLAGS="-O2"
50fi
51
52NUMJOBS=${NUMJOBS:--j6}
53
54rm -rf $PKG
55mkdir -p $TMP $PKG
56cd $TMP
57rm -rf swig-$VERSION
58tar xvf $CWD/swig-$VERSION.tar.?z* || exit 1
59cd swig-$VERSION
60chown -R root:root .
61find . \
62 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
63 -exec chmod 755 {} \; -o \
64 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
65 -exec chmod 644 {} \;
66
67CFLAGS="$SLKCFLAGS" \
68CXXFLAGS="$SLKCFLAGS" \
69./configure \
70  --prefix=/usr \
71  --mandir=/usr/man \
72  --exec-prefix=/usr \
73  --sysconfdir=/etc \
74  --localstatedir=/var \
75  --build=$ARCH-slackware-linux || exit 1
76
77make $NUMJOBS || make || exit 1
78make install DESTDIR=$PKG || exit 1
79
80( cd $PKG
81  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
82    xargs strip --strip-unneeded 2> /dev/null || true
83  #find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
84  #  xargs strip --strip-unneeded 2> /dev/null
85)
86
87# Compress and link manpages, if any:
88if [ -d $PKG/usr/man ]; then
89  ( cd $PKG/usr/man
90    for manpagedir in $(find . -type d -name "man*") ; do
91      ( cd $manpagedir
92        for eachpage in $( find . -type l -maxdepth 1) ; do
93          ln -s $( readlink $eachpage ).gz $eachpage.gz
94          rm $eachpage
95        done
96        gzip -9 *.?
97      )
98    done
99  )
100fi
101
102mkdir -p $PKG/usr/doc/swig-$VERSION
103cp -a \
104  ANNOUNCE CHANGES*  INSTALL LICENSE README TODO \
105  Examples Doc/Manual Doc/Devel  \
106    $PKG/usr/doc/swig-$VERSION
107# Fix permissions and wipe the pdf bloat
108find $PKG/usr/doc/swig-$VERSION -type f -exec chmod 0644 {} \;
109find $PKG/usr/doc/swig-$VERSION -name "*.pdf" -exec rm -f {} \;
110
111mkdir -p $PKG/install
112cat $CWD/slack-desc > $PKG/install/slack-desc
113
114cd $PKG
115/sbin/makepkg -l y -c n $TMP/swig-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.