source: npl/overig/bc/bc.SlackBuild.orig @ cc2b9e2

ntopperl-5.22
Last change on this file since cc2b9e2 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# Copyright 2006, 2007, 2008, 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
3# All rights reserved.
4#
5# Redistribution and use of this script, with or without modification, is
6# permitted provided that the following conditions are met:
7#
8# 1. Redistributions of this script must retain the above copyright
9#    notice, this list of conditions and the following disclaimer.
10#
11#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
12#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
14#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
16#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
17#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
18#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
19#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
20#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
22
23PKGNAM=bc
24VERSION=${VERSION:-1.06.95}
25BUILD=${BUILD:-3}
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
37CWD=$(pwd)
38TMP=${TMP:-/tmp}
39PKG=$TMP/package-${PKGNAM}
40rm -rf $PKG
41mkdir -p $TMP $PKG
42
43if [ "$ARCH" = "i486" ]; then
44  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
45elif [ "$ARCH" = "s390" ]; then
46  SLKCFLAGS="-O2"
47elif [ "$ARCH" = "x86_64" ]; then
48  SLKCFLAGS="-O2 -fPIC"
49else
50  SLKCFLAGS="-O2"
51fi
52
53cd $TMP
54rm -rf ${PKGNAM}-${VERSION}
55tar xjvf $CWD/${PKGNAM}-$VERSION.tar.bz2 || exit 1
56cd ${PKGNAM}-$VERSION
57
58# Make sure ownerships and permissions are sane:
59chown -R root:root .
60find . \
61  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
62  -exec chmod 755 {} \; -o \
63  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
64  -exec chmod 644 {} \;
65
66# Configure:
67CFLAGS="$SLKCFLAGS" \
68./configure \
69  --prefix=/usr \
70  --sysconfdir=/etc \
71  --mandir=/usr/man \
72  --with-readline \
73  --program-prefix= \
74  --program-suffix= \
75  --build=$ARCH-slackware-linux
76
77# Build and install:
78make -j4 || exit 1
79make install DESTDIR=$PKG || exit 1
80
81# Strip binaries:
82( cd $PKG
83  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
84  #find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | 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
102# Compress info files, if any:
103if [ -d $PKG/usr/info ]; then
104  ( cd $PKG/usr/info
105    rm -f dir
106    gzip -9 *
107  )
108fi
109
110# Add a documentation directory:
111mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
112cp -a \
113  AUTHORS COPYING COPYING.LIB Examples FAQ INSTALL NEWS README Test \
114  $PKG/usr/doc/${PKGNAM}-$VERSION
115
116mkdir -p $PKG/install
117#zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
118cat $CWD/slack-desc > $PKG/install/slack-desc
119
120cd $PKG
121makepkg -l y -c n $TMP/${PKGNAM}-$VERSION-$ARCH-$BUILD.txz
122
Note: See TracBrowser for help on using the repository browser.