source: npl/overig/libtasn1/libtasn1.SlackBuild.orig @ 5160d62

perl-5.22
Last change on this file since 5160d62 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# Slackware build script for libtasn1
4
5# Copyright 2010-2012  Robby Workman, Northport, Alabama, USA
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=libtasn1
25VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
26BUILD=${BUILD:-1}
27
28if [ -z "$ARCH" ]; then
29  case "$( uname -m )" in
30    i?86) export ARCH=i586 ;;
31    arm*) export ARCH=arm ;;
32       *) export ARCH=$( uname -m ) ;;
33  esac
34fi
35
36NUMJOBS=${NUMJOBS:--j6}
37
38CWD=$(pwd)
39TMP=${TMP:-/tmp}
40PKG=$TMP/package-$PKGNAM
41
42if [ "$ARCH" = "i586" ]; then
43  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
44  LIBDIRSUFFIX=""
45elif [ "$ARCH" = "x86_64" ]; then
46  SLKCFLAGS="-O2 -fPIC"
47  LIBDIRSUFFIX="64"
48else
49  SLKCFLAGS="-O2"
50  LIBDIRSUFFIX=""
51fi
52
53rm -rf $PKG
54mkdir -p $TMP $PKG
55cd $TMP
56rm -rf $PKGNAM-$VERSION
57tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1
58cd $PKGNAM-$VERSION || exit 1
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
66CFLAGS="$SLKCFLAGS" \
67CXXFLAGS="$SLKCFLAGS" \
68./configure \
69  --prefix=/usr \
70  --libdir=/usr/lib${LIBDIRSUFFIX} \
71  --sysconfdir=/etc \
72  --localstatedir=/var \
73  --mandir=/usr/man \
74  --infodir=/usr/info \
75  --enable-shared \
76  --disable-static \
77  --build=$ARCH-slackware-linux || exit 1
78  #--disable-gtk-doc \
79 
80make $NUMJOBS || make || exit 1
81make install DESTDIR=$PKG || exit 1
82
83# Don't ship .la files:
84rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
85
86find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
87  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
88
89# Compress and link manpages, if any:
90if [ -d $PKG/usr/man ]; then
91  ( cd $PKG/usr/man
92    for manpagedir in $(find . -type d -name "man*") ; do
93      ( cd $manpagedir
94        for eachpage in $( find . -type l -maxdepth 1) ; do
95          ln -s $( readlink $eachpage ).gz $eachpage.gz
96          rm $eachpage
97        done
98        gzip -9 *.?
99      )
100    done
101  )
102fi
103
104rm -f $PKG/usr/info/dir
105gzip -9 $PKG/usr/info/*
106
107mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
108cp -a \
109  AUTHORS COPYING* NEWS README* THANKS \
110  $PKG/usr/doc/$PKGNAM-$VERSION
111
112# If there's a ChangeLog, installing at least part of the recent history
113# is useful, but don't let it get totally out of control:
114if [ -r ChangeLog ]; then
115  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
116  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
117  touch -r ChangeLog $DOCSDIR/ChangeLog
118fi
119
120mkdir -p $PKG/install
121cat $CWD/slack-desc > $PKG/install/slack-desc
122
123cd $PKG
124/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.