source: npl/system/acl/acl.SlackBuild.orig @ 892871d

Last change on this file since 892871d 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.7 KB
Line 
1#!/bin/sh
2
3# Copyright 2005-2015  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=acl
24VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 4- -d . | rev | cut -f 2 -d -)}
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) export ARCH=i486 ;;
31    arm*) export ARCH=arm ;;
32    # Unless $ARCH is already set, use uname -m for all other archs:
33       *) export ARCH=$( uname -m ) ;;
34  esac
35fi
36
37CWD=$(pwd)
38TMP=${TMP:-/tmp}
39PKG=$TMP/package-acl
40
41if [ "$ARCH" = "x86_64" ]; then
42  LIBDIRSUFFIX="64"
43else
44  LIBDIRSUFFIX=""
45fi
46
47rm -rf $PKG
48mkdir -p $TMP $PKG
49
50cd $TMP
51
52rm -rf acl-$(echo $VERSION | cut -f 1 -d '-')
53tar xvf $CWD/acl-$VERSION.src.tar.?z || exit 1
54cd acl-$(echo $VERSION | cut -f 1 -d '-') || exit 1
55
56chown -R root:root .
57find . \
58  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
59  -exec chmod 755 {} \; -o \
60  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
61  -exec chmod 644 {} \;
62
63./configure \
64  --prefix=/ \
65  --exec-prefix=/ \
66  --sbindir=/bin \
67  --bindir=/usr/bin \
68  --libdir=/lib${LIBDIRSUFFIX} \
69  --libexecdir=/usr/lib${LIBDIRSUFFIX} \
70  --includedir=/usr/include \
71  --mandir=/usr/man \
72  --datadir=/usr/share \
73  --docdir=/usr/doc/acl-$VERSION \
74  --build=$ARCH-slackware-linux
75
76make PKG_DOC_DIR=/usr/doc/acl-$VERSION || exit 1
77make install PKG_DOC_DIR=/usr/doc/acl-$VERSION DESTDIR=$PKG
78make install-dev PKG_DOC_DIR=/usr/doc/acl-$VERSION DESTDIR=$PKG
79make install-lib PKG_DOC_DIR=/usr/doc/acl-$VERSION DESTDIR=$PKG
80
81#It would be nice to keep the same timestamps that the files have in the source:
82cp -a \
83  README doc/COPYING* doc/PORTING \
84  $PKG/usr/doc/acl-$VERSION
85
86( cd $PKG
87  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
88  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
89)
90strip -g $PKG/usr/lib${LIBDIRSUFFIX}/*.a
91
92# Remove bogus files:
93rm -f $PKG/lib${LIBDIRSUFFIX}/*.a $PKG/lib${LIBDIRSUFFIX}/libacl.so $PKG/lib${LIBDIRSUFFIX}/*.la $PKG/usr/lib${LIBDIRSUFFIX}/*.la
94# Make /usr/lib${LIBDIRSUFFIX}/libacl.so a symlink to /lib${LIBDIRSUFFIX}:
95( cd $PKG/usr/lib${LIBDIRSUFFIX}
96  rm -f libacl.so
97  ln -sf /lib${LIBDIRSUFFIX}/libacl.so.1 libacl.so
98)
99# Fix shared library perms:
100chmod 755 $PKG/lib${LIBDIRSUFFIX}/*
101
102# Gzip the man pages:
103( cd $PKG/usr/man
104  for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
105  gzip -9 */*.?
106)
107
108mkdir -p $PKG/install
109cat $CWD/slack-desc > $PKG/install/slack-desc
110
111cd $PKG
112makepkg -l y -c n $TMP/acl-$(echo $VERSION | tr - _ )-$ARCH-$BUILD.txz
113
Note: See TracBrowser for help on using the repository browser.