source: npl/system/attr/attr.SlackBuild.orig @ 2154c77

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