source: npl/overig/libgpg_error/libgpg-error.SlackBuild.orig @ e013060

perl-5.22
Last change on this file since e013060 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: 4.2 KB
Line 
1#!/bin/sh
2
3# Copyright 2006, 2009  Robby Workman, Northport, AL, USA
4# Copyright 2007, 2008, 2009, 2010, 2015  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 SCRIPT 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 SCRIPT, EVEN IF
22# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24
25PKGNAM=libgpg-error
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 || exit 1
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/$PKGNAM-$VERSION \
80  --enable-shared=yes \
81  --enable-static=no \
82  --build=$ARCH-slackware-linux \
83  --host=$ARCH-slackware-linux
84
85make $NUMJOBS || make || exit 1
86make install DESTDIR=$PKG
87
88# Move the shared library to $PKG/lib${LIBDIRSUFFIX}:
89mkdir -p $PKG/lib${LIBDIRSUFFIX}
90( cd $PKG/usr/lib${LIBDIRSUFFIX}
91  for file in lib*.so.?.* ; do
92    mv $file ../../lib${LIBDIRSUFFIX}
93    ln -sf ../../lib${LIBDIRSUFFIX}/$file .
94  done
95  cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
96)
97
98# Strip binaries:
99( cd $PKG
100  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
101  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
102)
103
104# Compress and if needed symlink the man pages:
105if [ -d $PKG/usr/man ]; then
106  ( cd $PKG/usr/man
107    for manpagedir in $(find . -type d -name "man*") ; do
108      ( cd $manpagedir
109        for eachpage in $( find . -type l -maxdepth 1) ; do
110          ln -s $( readlink $eachpage ).gz $eachpage.gz
111          rm $eachpage
112        done
113        gzip -9 *.?
114      )
115    done
116  )
117fi
118
119# Compress info files, if any:
120if [ -d $PKG/usr/info ]; then
121  ( cd $PKG/usr/info
122    rm -f dir
123    gzip -9 *
124  )
125fi
126
127mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
128cp -a \
129  AUTHORS COPYING* INSTALL NEWS README* THANKS VERSION \
130  $PKG/usr/doc/$PKGNAM-$VERSION
131
132# If there's a ChangeLog, installing at least part of the recent history
133# is useful, but don't let it get totally out of control:
134if [ -r ChangeLog ]; then
135  DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
136  cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
137  touch -r ChangeLog $DOCSDIR/ChangeLog
138fi
139
140mkdir -p $PKG/install
141cat $CWD/slack-desc > $PKG/install/slack-desc
142
143cd $PKG
144/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
145
Note: See TracBrowser for help on using the repository browser.