source: npl/overig/nettle/nettle.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.8 KB
Line 
1#!/bin/sh
2
3# Slackware build script for nettle
4
5# Copyright 2011  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=nettle
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
70# There is a "--disable-openssl" flag that shows this for help:
71# "Do not include openssl glue in the benchmark program"
72# Building without that flag does not appear to link any openssl libraries,
73# so I don't see any potential legal implications...  --rworkman
74CFLAGS="$SLKCFLAGS" \
75CXXFLAGS="$SLKCFLAGS" \
76./configure \
77  --prefix=/usr \
78  --libdir=/usr/lib${LIBDIRSUFFIX} \
79  --sysconfdir=/etc \
80  --localstatedir=/var \
81  --docdir=/usr/doc/$PKGNAM-$VERSION \
82  --infodir=/usr/info \
83  --enable-shared \
84  --build=$ARCH-slackware-linux \
85  || exit 1
86
87make $NUMJOBS || make || exit 1
88make install DESTDIR=$PKG || exit 1
89
90# Do not package static libraries:
91rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.a
92
93# Fix perms on shared objects
94find $PKG/usr/lib${LIBDIRSUFFIX} -type f -name "*.so.*" -exec chmod 0755 {} \;
95
96# Strip binaries:
97( cd $PKG
98  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
99  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
100)
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
110mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
111cp -a \
112  AUTHORS COPYING* INSTALL NEWS README TODO \
113  $PKG/usr/doc/$PKGNAM-$VERSION
114
115# If there's a ChangeLog, installing at least part of the recent history
116# is useful, but don't let it get totally out of control:
117if [ -r ChangeLog ]; then
118  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
119  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
120  touch -r ChangeLog $DOCSDIR/ChangeLog
121fi
122
123mkdir -p $PKG/install
124cat $CWD/slack-desc > $PKG/install/slack-desc
125
126cd $PKG
127/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.