source: npl/overig/libarchive/libarchive.SlackBuild.orig @ cbeb6d3

perl-5.22
Last change on this file since cbeb6d3 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# Copyright 2008 Heinz Wiesinger <hmwiesinger@gmx.at>
4# Copyright 2008, 2009, 2010  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 SOFTWARE 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 SOFTWARE, EVEN IF
22# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24# Modified by Robby Workman <rworkman@slackware.com>
25
26PKGNAM=libarchive
27VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
28BUILD=${BUILD:-2}
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-$PKGNAM
45
46if [ "$ARCH" = "i586" ]; then
47  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "i686" ]; then
50  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
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 $PKGNAM-$VERSION
64tar xvf $CWD/$PKGNAM-$VERSION.tar.?z* || exit 1
65cd $PKGNAM-$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
73CFLAGS="$SLKCFLAGS" \
74CXXFLAGS="$SLKCFLAGS" \
75./configure \
76  --prefix=/usr \
77  --libdir=/usr/lib${LIBDIRSUFFIX} \
78  --sysconfdir=/etc \
79  --localstatedir=/var \
80  --mandir=/usr/man \
81  --disable-static \
82  --build=$ARCH-slackware-linux
83
84make $NUMJOBS || make || exit 1
85make install DESTDIR=$PKG || exit 1
86
87# Strip binaries:
88find $PKG | xargs file | grep -e "executable" -e "shared object" \
89  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
90
91( cd $PKG/usr/man
92  find . -type f -exec gzip -9 {} \;
93  for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
94)
95
96mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
97cp -a COPYING* INSTALL NEWS README* $PKG/usr/doc/$PKGNAM-$VERSION
98
99mkdir -p $PKG/install
100cat $CWD/slack-desc > $PKG/install/slack-desc
101
102cd $PKG
103/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
104
Note: See TracBrowser for help on using the repository browser.