source: npl/overig/icu4c/icu4c.SlackBuild.orig @ 5160d62

perl-5.22
Last change on this file since 5160d62 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 icu4c
4
5# Copyright 2007-2013 Heinz Wiesinger, Amsterdam, The Netherlands
6# Copyright 2012, 2013, 2015, 2016  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=icu4c
27SRCVER=${SRCVER:-$(echo $PKGNAM-*.tar.xz | rev | cut -f 2- -d . | cut -f 2 -d - | rev)}
28VERSION=$(echo $SRCVER | tr _ .)
29BUILD=${BUILD:-2}
30
31# Automatically determine the architecture we're building on:
32if [ -z "$ARCH" ]; then
33  case "$( uname -m )" in
34    i?86) ARCH=i586 ;;
35    arm*) ARCH=arm ;;
36    # Unless $ARCH is already set, use uname -m for all other archs:
37       *) ARCH=$( uname -m ) ;;
38  esac
39fi
40
41NUMJOBS=${NUMJOBS:--j6}
42
43CWD=$(pwd)
44TMP=${TMP:-/tmp}
45PKG=$TMP/package-icu4c
46
47if [ "$ARCH" = "i586" ]; then
48  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
49  LIBDIRSUFFIX=""
50elif [ "$ARCH" = "s390" ]; then
51  SLKCFLAGS="-O2"
52  LIBDIRSUFFIX=""
53elif [ "$ARCH" = "x86_64" ]; then
54  SLKCFLAGS="-O2 -fPIC"
55  LIBDIRSUFFIX="64"
56else
57  SLKCFLAGS="-O2"
58  LIBDIRSUFFIX=""
59fi
60
61rm -rf $PKG
62mkdir -p $TMP $PKG $OUTPUT
63cd $TMP
64rm -rf icu
65tar xvf $CWD/icu4c-$SRCVER-src.tar.xz || exit 1
66cd icu || exit 1
67chown -R root:root .
68find . \
69  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
70  -exec chmod 755 {} \; -o \
71  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
72  -o -perm 400 \) -exec chmod 644 {} \;
73
74zcat $CWD/icu4c.closenull.patch.gz | patch -p1 --verbose || exit 1
75
76cd source/
77  CFLAGS="$SLKCFLAGS" \
78  CXXFLAGS="$SLKCFLAGS" \
79  ./configure \
80    --prefix=/usr \
81    --libdir=/usr/lib${LIBDIRSUFFIX} \
82    --mandir=/usr/man \
83    --enable-shared \
84    --disable-static \
85    --sysconfdir=/etc \
86    --localstatedir=/var \
87    --disable-samples \
88    --build=$ARCH-slackware-linux || exit 1
89
90  make $NUMJOBS || make || exit 1
91  make install DESTDIR=$PKG || exit 1
92cd -
93
94find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
95  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
96
97find $PKG/usr/man -type f -exec gzip -9 {} \;
98
99mkdir -p $PKG/usr/doc/icu4c-$VERSION
100cp -a \
101  license.html readme.html $PKG/usr/doc/icu4c-$VERSION
102
103mkdir -p $PKG/install
104cat $CWD/slack-desc > $PKG/install/slack-desc
105
106cd $PKG
107/sbin/makepkg -l y -c n $TMP/icu4c-$VERSION-$ARCH-$BUILD.txz
Note: See TracBrowser for help on using the repository browser.