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