source: npl/overig/itstool/itstool.SlackBuild.orig @ 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.5 KB
Line 
1#!/bin/sh
2
3# Copyright 2013  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=itstool
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) ARCH=i486 ;;
31    arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
32    # Unless $ARCH is already set, use uname -m for all other archs:
33    *) ARCH=$(uname -m) ;;
34  esac
35  export ARCH
36fi
37
38NUMJOBS=${NUMJOBS:-" -j7 "}
39
40CWD=$(pwd)
41TMP=${TMP:-/tmp}
42PKG=$TMP/package-$PKGNAM
43
44if [ "$ARCH" = "i486" ]; then
45  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
46  LIBDIRSUFFIX=""
47elif [ "$ARCH" = "i686" ]; then
48  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
49  LIBDIRSUFFIX=""
50elif [ "$ARCH" = "x86_64" ]; then
51  SLKCFLAGS="-O2 -fPIC"
52  LIBDIRSUFFIX="64"
53else
54  SLKCFLAGS="-O2"
55  LIBDIRSUFFIX=""
56fi
57
58rm -rf $PKG
59mkdir -p $TMP $PKG
60cd $TMP
61rm -rf $PKGNAM-$VERSION
62tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
63cd $PKGNAM-$VERSION || exit 1
64chown -R root:root .
65find . \
66 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
67 -exec chmod 755 {} \; -o \
68 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
69 -exec chmod 644 {} \;
70
71CFLAGS="$SLKCFLAGS" \
72CXXFLAGS="$SLKCFLAGS" \
73./configure \
74  --prefix=/usr \
75  --libdir=/usr/lib${LIBDIRSUFFIX} \
76  --sysconfdir=/etc \
77  --localstatedir=/var \
78  --mandir=/usr/man \
79  --docdir=/usr/doc/$PKGNAM-$VERSION \
80  --build=$ARCH-slackware-linux || exit 1
81
82make $NUMJOBS || make || exit 1
83make install DESTDIR=$PKG || exit 1
84
85# Compress manual pages:
86find $PKG/usr/man -type f -exec gzip -9 {} \;
87for i in $( find $PKG/usr/man -type l ) ; do
88  ln -s $( readlink $i ).gz $i.gz
89  rm $i
90done
91
92find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
93  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
94
95mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
96cp -a AUTHORS COPYING* INSTALL NEWS README $PKG/usr/doc/$PKGNAM-$VERSION
97
98# If there's a ChangeLog, installing at least part of the recent history
99# is useful, but don't let it get totally out of control:
100if [ -r ChangeLog ]; then
101  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
102  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
103  touch -r ChangeLog $DOCSDIR/ChangeLog
104fi
105
106mkdir -p $PKG/install
107cat $CWD/slack-desc > $PKG/install/slack-desc
108
109cd $PKG
110/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.