source: npl/overig/serf/serf.SlackBuild.orig

Last change on this file 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.0 KB
Line 
1#!/bin/sh
2
3# Slackware build script for serf
4
5# Copyright 2014  Andrzej Telszewski, Sabadell
6# Copyright 2015  Patrick J. Volkerding, Sebeka, MN, USA
7# All rights reserved.
8#
9# Redistribution and use of this script, with or without modification, is
10# permitted provided that the following conditions are met:
11#
12# 1. Redistributions of this script must retain the above copyright
13#    notice, this list of conditions and the following disclaimer.
14#
15#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
16#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
18#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26PKGNAM=serf
27VERSION=${VERSION:-$(echo serf-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
28BUILD=${BUILD:-1}
29
30# Automatically determine the architecture we're building on:
31if [ -z "$ARCH" ]; then
32  case "$( uname -m )" in
33    i?86) export ARCH=i586 ;;
34    arm*) export ARCH=arm ;;
35    # Unless $ARCH is already set, use uname -m for all other archs:
36       *) export ARCH=$( uname -m ) ;;
37  esac
38fi
39
40NUMJOBS=${NUMJOBS:--j6}
41
42CWD=$(pwd)
43TMP=${TMP:-/tmp}
44PKG=$TMP/package-serf
45
46if [ "$ARCH" = "i586" ]; then
47  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "s390" ]; then
50  SLKCFLAGS="-O2"
51  LIBDIRSUFFIX=""
52elif [ "$ARCH" = "x86_64" ]; then
53  SLKCFLAGS="-O2 -fPIC"
54  LIBDIRSUFFIX="64"
55else
56  SLKCFLAGS="-O2"
57  LIBDIRSUFFIX=""
58fi
59
60rm -rf $PKG
61mkdir -p $TMP $PKG
62cd $TMP
63rm -rf serf-$VERSION
64tar xvf $CWD/serf-$VERSION.tar.?z* || exit 1
65cd serf-$VERSION || exit 1
66chown -R root:root .
67find . \
68 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
69 -exec chmod 755 {} \; -o \
70 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
71 -exec chmod 644 {} \;
72
73# Disable build and install static library
74# Thanks to LFS
75# http://www.linuxfromscratch.org/blfs/view/svn/basicnet/serf.html
76sed -i "/Default/s:lib_static,::"    SConstruct
77sed -i "/Alias/s:install_static,::"  SConstruct
78
79scons $NUMJOBS \
80  PREFIX=/usr \
81  LIBDIR=/usr/lib${LIBDIRSUFFIX} \
82  CFLAGS="$SLKCFLAGS" || exit 1
83
84scons $NUMJOBS install --install-sandbox=$PKG || exit 1
85
86find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
87  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
88
89mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
90cp -a CHANGES design-guide.txt LICENSE NOTICE README $PKG/usr/doc/$PKGNAM-$VERSION
91
92mkdir -p $PKG/install
93cat $CWD/slack-desc > $PKG/install/slack-desc
94
95cd $PKG
96/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.