source: npl/overig/libgcrypt/libgcrypt.SlackBuild.orig @ 26ffad7

Last change on this file since 26ffad7 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.8 KB
Line 
1#!/bin/sh
2
3# Copyright 2006-2009  Robby Workman, Northport, AL, USA
4# Copyright 2007, 2008, 2009, 2010  Patrick J. Volkerding, Sebeka, MN, USA
5# All rights reserved.
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
24
25PKGNAM=libgcrypt
26VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
27BUILD=${BUILD:-1}
28
29# Automatically determine the architecture we're building on:
30if [ -z "$ARCH" ]; then
31  case "$( uname -m )" in
32    i?86) export ARCH=i586 ;;
33    arm*) export ARCH=arm ;;
34    # Unless $ARCH is already set, use uname -m for all other archs:
35       *) export ARCH=$( uname -m ) ;;
36  esac
37fi
38
39NUMJOBS=${NUMJOBS:-" -j7 "}
40
41CWD=$(pwd)
42TMP=${TMP:-/tmp}
43PKG=$TMP/package-$PKGNAM
44
45if [ "$ARCH" = "i586" ]; then
46  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
47  LIBDIRSUFFIX=""
48elif [ "$ARCH" = "s390" ]; then
49  SLKCFLAGS="-O2"
50  LIBDIRSUFFIX=""
51elif [ "$ARCH" = "x86_64" ]; then
52  SLKCFLAGS="-O2 -fPIC"
53  LIBDIRSUFFIX="64"
54else
55  SLKCFLAGS="-O2"
56  LIBDIRSUFFIX=""
57fi
58
59rm -rf $PKG
60mkdir -p $TMP $PKG
61cd $TMP
62rm -rf $PKGNAM-$VERSION
63tar xvf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1
64cd $PKGNAM-$VERSION
65chown -R root:root .
66find . \
67  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
68  -exec chmod 755 {} \; -o \
69  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
70  -exec chmod 644 {} \;
71
72CFLAGS="$SLKCFLAGS" \
73CXXFLAGS="$SLKCFLAGS" \
74./configure \
75  --prefix=/usr \
76  --libdir=/usr/lib${LIBDIRSUFFIX} \
77  --infodir=/usr/info \
78  --mandir=/usr/man \
79  --docdir=/usr/doc/libgcrypt-$VERSION \
80  --enable-shared=yes \
81  --enable-static=no \
82  --program-prefix="" \
83  --program-suffix="" \
84  --build=$ARCH-slackware-linux \
85  --host=$ARCH-slackware-linux
86
87make $NUMJOBS || make || exit 1
88make install DESTDIR=$PKG
89
90# Move the shared library to $PKG/lib${LIBDIRSUFFIX}:
91mkdir -p $PKG/lib${LIBDIRSUFFIX}
92( cd $PKG/usr/lib${LIBDIRSUFFIX}
93  for file in lib*.so.??.* ; do
94    mv $file ../../lib${LIBDIRSUFFIX}
95    ln -sf ../../lib${LIBDIRSUFFIX}/$file .
96  done
97  cp -a lib*.so.?? ../../lib${LIBDIRSUFFIX}
98)
99
100find $PKG | xargs file | grep -e "executable" -e "shared object" \
101  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
102
103find $PKG/usr/man -type f -exec gzip -9 {} \;
104
105rm -f $PKG/usr/info/dir
106gzip -9 $PKG/usr/info/*
107
108mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
109cp -a \
110  AUTHORS  COPYING* ChangeLog INSTALL NEWS \
111  README* THANKS TODO VERSION \
112  $PKG/usr/doc/$PKGNAM-$VERSION
113
114# If there's a ChangeLog, installing at least part of the recent history
115# is useful, but don't let it get totally out of control:
116if [ -r ChangeLog ]; then
117  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
118  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
119  touch -r ChangeLog $DOCSDIR/ChangeLog
120fi
121
122mkdir -p $PKG/install
123cat $CWD/slack-desc > $PKG/install/slack-desc
124
125cd $PKG
126/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
127
Note: See TracBrowser for help on using the repository browser.