source: npl/overig/gdb/gdb.SlackBuild.orig @ 34a7c56

perl-5.22
Last change on this file since 34a7c56 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.7 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2011, 2012  Patrick J. Volkerding, Sebeka, MN, 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
24PKGNAM=gdb
25VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26BUILD=${BUILD:-1}
27
28NUMJOBS=${NUMJOBS:-" -j7 "}
29
30# Automatically determine the architecture we're building on:
31if [ -z "$ARCH" ]; then
32  case "$( uname -m )" in
33    i?86) export ARCH=i486 ;;
34    arm*) export ARCH=arm ;;
35    # Unless $ARCH is already set, use uname -m for all other archs:
36       *) export ARCH=$( uname -m ) ;;
37  esac
38fi
39
40if [ "$ARCH" = "x86_64" ]; then
41  LIBDIRSUFFIX="64"
42else
43  LIBDIRSUFFIX=""
44fi
45
46CWD=$(pwd)
47TMP=${TMP:-/tmp}
48PKG=$TMP/package-gdb
49
50rm -rf $PKG
51mkdir -p $TMP $PKG
52
53cd $TMP
54rm -rf gdb-$VERSION
55tar xvf $CWD/gdb-$VERSION.tar.?z* || exit 1
56cd gdb-$VERSION || exit 1
57chown -R root:root .
58find . \
59  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
60  -exec chmod 755 {} \; -o \
61  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
62  -exec chmod 644 {} \;
63
64./configure \
65  --prefix=/usr \
66  --libdir=/usr/lib${LIBDIRSUFFIX} \
67  --mandir=/usr/man \
68  --infodir=/usr/info \
69  --with-python \
70  --build=$ARCH-slackware-linux
71
72#( cd readline ; make )
73
74make $NUMJOBS || make || exit 1
75make install DESTDIR=$PKG || exit 1
76
77# None of this stuff has ever been included in this package:
78rm -f $PKG/usr/lib${LIBDIRSUFFIX}/{libbfd*,libiberty*,libopcodes*}
79#rmdir $PKG/usr/lib${LIBDIRSUFFIX} 2> /dev/null
80rm -f $PKG/usr/info/{annotate*,bfd*,configure*,standards*}
81rm -rf $PKG/usr/include
82
83# Use the -tui option if you want this.
84# Including a whole extra copy of the gdb binary is obnoxious:
85rm -f $PKG/usr/bin/gdbtui $PKG/usr/man/man1/gdbtui.1*
86
87mkdir -p $PKG/usr/doc/gdb-$VERSION/gdb
88cp -a COPYING* README $PKG/usr/doc/gdb-$VERSION
89cd gdb
90cp -a NEWS README $PKG/usr/doc/gdb-$VERSION/gdb
91cp -a gdbserver/README $PKG/usr/doc/gdb-$VERSION/README.gdbserver
92find $PKG/usr/doc/gdb-$VERSION -type f -exec chmod 644 {} \;
93
94# Strip binaries:
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
98# Compress and link manpages, if any:
99if [ -d $PKG/usr/man ]; then
100  ( cd $PKG/usr/man
101    for manpagedir in $(find . -type d -name "man*") ; do
102      ( cd $manpagedir
103        for eachpage in $( find . -type l -maxdepth 1) ; do
104          ln -s $( readlink $eachpage ).gz $eachpage.gz
105          rm $eachpage
106        done
107        gzip -9 *.?
108      )
109    done
110  )
111fi
112
113# Compress info files, if any:
114if [ -d $PKG/usr/info ]; then
115  ( cd $PKG/usr/info
116    rm -f dir
117    gzip -9 *
118  )
119fi
120
121mkdir -p $PKG/install
122cat $CWD/slack-desc > $PKG/install/slack-desc
123
124# Build the package:
125cd $PKG
126/sbin/makepkg -l y -c n $TMP/gdb-$VERSION-$ARCH-$BUILD.txz
127
Note: See TracBrowser for help on using the repository browser.