source: npl/overig/p11_kit/p11-kit.SlackBuild.orig @ 929bb42

Last change on this file since 929bb42 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.2 KB
Line 
1#!/bin/sh
2
3# Slackware build script for p11-kit
4
5# Copyright 2011, 2012, 2014  Robby Workman, Northport, Alabama, USA
6# All rights reserved.
7#
8# Redistribution and use of this script, with or without modification, is
9# permitted provided that the following conditions are met:
10#
11# 1. Redistributions of this script must retain the above copyright
12#    notice, this list of conditions and the following disclaimer.
13#
14#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
15#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
17#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25PKGNAM=p11-kit
26VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
27BUILD=${BUILD:-1}
28
29NUMJOBS=${NUMJOBS:--j6}
30
31if [ -z "$ARCH" ]; then
32  case "$( uname -m )" in
33    i?86) ARCH=i586 ;;
34    arm*) ARCH=arm ;;
35       *) ARCH=$( uname -m ) ;;
36  esac
37fi
38
39CWD=$(pwd)
40TMP=${TMP:-/tmp}
41PKG=$TMP/package-$PKGNAM
42
43if [ "$ARCH" = "i586" ]; then
44  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
45  LIBDIRSUFFIX=""
46elif [ "$ARCH" = "i686" ]; then
47  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "x86_64" ]; then
50  SLKCFLAGS="-O2 -fPIC"
51  LIBDIRSUFFIX="64"
52else
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55fi
56
57rm -rf $PKG
58mkdir -p $TMP $PKG
59cd $TMP
60rm -rf $PKGNAM-$VERSION
61tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
62cd $PKGNAM-$VERSION
63chown -R root:root .
64find . \
65 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
66 -exec chmod 755 {} \; -o \
67 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
68 -exec chmod 644 {} \;
69
70CFLAGS="$SLKCFLAGS" \
71CXXFLAGS="$SLKCFLAGS" \
72./configure \
73  --prefix=/usr \
74  --libdir=/usr/lib${LIBDIRSUFFIX} \
75  --sysconfdir=/etc \
76  --localstatedir=/var \
77  --without-trust-paths \
78  --build=$ARCH-slackware-linux \
79  || exit 1
80
81make $NUMJOBS || make || exit 1
82make install DESTDIR=$PKG || exit 1
83
84# Create the module dir
85mkdir -p $PKG/etc/pkcs11/modules
86
87find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
88  grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
89
90mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
91cp -a \
92  AUTHORS COPYING* NEWS README* \
93  $PKG/usr/doc/$PKGNAM-$VERSION
94
95# If there's a ChangeLog, installing at least part of the recent history
96# is useful, but don't let it get totally out of control:
97if [ -r ChangeLog ]; then
98  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
99  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
100  touch -r ChangeLog $DOCSDIR/ChangeLog
101fi
102
103mkdir -p $PKG/install
104cat $CWD/slack-desc > $PKG/install/slack-desc
105
106cd $PKG
107/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.