source: npl/system/xfsprogs/xfsprogs.SlackBuild.orig @ a87727a

Last change on this file since a87727a 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.4 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2012  Patrick J. Volkerding, Sebeka, MN, 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
23
24VERSION=${VERSION:-$(echo xfsprogs-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
25BUILD=${BUILD:-1}
26
27NUMJOBS=${NUMJOBS:-" -j7 "}
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
39CWD=$(pwd)
40TMP=${TMP:-/tmp}
41PKG=$TMP/package-xfsprogs
42
43if [ "$ARCH" = "i586" ]; then
44  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
45  LIBDIRSUFFIX=""
46elif [ "$ARCH" = "s390" ]; then
47  SLKCFLAGS="-O2"
48  LIBDIRSUFFIX=""
49elif [ "$ARCH" = "x86_64" ]; then
50  SLKCFLAGS="-O2 -fPIC"
51  LIBDIRSUFFIX="64"
52else
53  SLKCFLAGS="-O2"
54  LIBDIRSUFFIX=""
55fi
56
57rm -rf $PKG
58mkdir -p $TMP $PKG
59
60cd $TMP
61rm -rf xfsprogs-$VERSION
62tar xvf $CWD/xfsprogs-$VERSION.tar.?z* || exit 1
63cd xfsprogs-$VERSION
64
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
72# Make sure you have the same version of autoconf as the
73# developers did...  ;-)
74autoconf
75
76CFLAGS="$SLKCFLAGS" \
77./configure \
78  --prefix=/usr \
79  --libdir=/lib${LIBDIRSUFFIX} \
80  --libexecdir=/usr/lib${LIBDIRSUFFIX} \
81  --sbindir=/sbin \
82  --bindir=/usr/sbin \
83  --datadir=/usr/share \
84  --mandir=/usr/man \
85  --docdir=/usr/doc/xfsprogs-$VERSION \
86  --enable-shared=yes \
87  --enable-gettext=yes \
88  --build=$ARCH-slackware-linux
89
90make $NUMJOBS || make || exit 1
91make install DIST_ROOT=$PKG
92make install-dev DIST_ROOT=$PKG
93#make install-qa DIST_ROOT=$PKG
94
95mv $PKG/usr/share/doc $PKG/usr
96mv $PKG/usr/doc/xfsprogs $PKG/usr/doc/xfsprogs-$VERSION
97#It would be nice to keep the same timestamps that the files have in the source:
98cp -a README doc/COPYING doc/CREDITS  \
99  $PKG/usr/doc/xfsprogs-$VERSION
100
101rm -f $PKG/usr/doc/xfsprogs-$VERSION/CHANGES.gz
102
103# If there's a ChangeLog, installing at least part of the recent history
104# is useful, but don't let it get totally out of control:
105if [ -r doc/CHANGES ]; then
106  DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
107  cat doc/CHANGES | head -n 1000 > $DOCSDIR/CHANGES
108  touch -r doc/CHANGES $DOCSDIR/CHANGES
109fi
110
111# The install location for many binaries changed with the update to 3.1.1,
112# but it seems like the wrong place to put most of this stuff:
113mkdir -p $PKG/usr/sbin
114mv $PKG/sbin/xfs_* $PKG/usr/sbin
115mv $PKG/usr/sbin/xfs_repair $PKG/sbin
116
117# Remove bogus files:
118rm -f $PKG/lib${LIBDIRSUFFIX}/*.a $PKG/lib${LIBDIRSUFFIX}/*.so \
119  $PKG/lib${LIBDIRSUFFIX}/*.la $PKG/usr/lib${LIBDIRSUFFIX}/*.la
120# Make /usr/lib/libhandle.so a symlink to /lib/libhandle.so.1:
121if [ -f $PKG/lib${LIBDIRSUFFIX}/libhandle.so.1 ]; then
122  mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
123  ( cd $PKG/usr/lib${LIBDIRSUFFIX}
124    rm -f libhandle.so
125    ln -sf /lib${LIBDIRSUFFIX}/libhandle.so.1 libhandle.so
126  )
127else
128  exit 1
129  # and fix your script!  ;-)
130fi
131# Fix shared library perms:
132chmod 755 $PKG/lib${LIBDIRSUFFIX}/*
133
134# Strip libraries:
135find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
136  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
137#strip -g $PKG/usr/lib${LIBDIRSUFFIX}/*.a
138
139mkdir -p $PKG/install
140cat $CWD/slack-desc > $PKG/install/slack-desc
141
142cd $PKG
143/sbin/makepkg -l y -c n $TMP/xfsprogs-$VERSION-$ARCH-$BUILD.txz
144
Note: See TracBrowser for help on using the repository browser.