source: npl/overig/e2fsprogs/e2fsprogs.SlackBuild.orig @ 26ffad7

Last change on this file since 26ffad7 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: 5.6 KB
Line 
1#!/bin/sh
2
3# Copyright 2008, 2009, 2010, 2015  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# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port.
24
25
26VERSION=${VERSION:-$(echo e2fsprogs*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
27BUILD=${BUILD:-2}
28
29NUMJOBS=${NUMJOBS:-" -j7 "}
30
31# Automatically determine the architecture we're building on:
32MARCH=$( uname -m )
33if [ -z "$ARCH" ]; then
34  case "$MARCH" in
35    i?86)    export ARCH=i486 ;;
36    armv7hl) export ARCH=$MARCH ;;
37    arm*)    export ARCH=arm ;;
38    # Unless $ARCH is already set, use uname -m for all other archs:
39    *)       export ARCH=$MARCH ;;
40  esac
41fi
42
43if [ "$ARCH" = "i486" ]; then
44  SLKCFLAGS="-O2 -march=i486 -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"
52elif [ "$ARCH" = "armv7hl" ]; then
53  SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
54  LIBDIRSUFFIX=""
55else
56  SLKCFLAGS="-O2"
57  LIBDIRSUFFIX=""
58fi
59
60case "$ARCH" in
61    arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
62    *)    TARGET=$ARCH-slackware-linux ;;
63esac
64
65CWD=$(pwd)
66TMP=${TMP:-/tmp}
67PKG=$TMP/package-e2fsprogs
68
69rm -rf $PKG
70mkdir -p $TMP $PKG
71cd $TMP
72rm -rf e2fsprogs-$VERSION
73tar xvf $CWD/e2fsprogs-$VERSION.tar.?z* || exit 1
74cd e2fsprogs-$VERSION || exit 1
75chown -R root:root .
76find . \
77  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
78  -exec chmod 755 {} \; -o \
79  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
80  -exec chmod 644 {} \;
81
82# Disable libblkid and libuuid, as we'll be using the ones in u-l-ng
83CFLAGS="$SLKCFLAGS" \
84./configure \
85  --prefix= \
86  --libdir=/lib${LIBDIRSUFFIX} \
87  --bindir=/usr/bin \
88  --includedir=/usr/include \
89  --datadir=/usr/share \
90  --mandir=/usr/man \
91  --infodir=/usr/info \
92  --docdir=/usr/doc/e2fsprogs-$VERSION \
93  --enable-elf-shlibs \
94  --disable-libblkid \
95  --disable-libuuid \
96  --disable-uuidd \
97  --build=$TARGET
98
99make $NUMJOBS || make || exit 1
100make install DESTDIR=$PKG || exit 1
101make install-libs DESTDIR=$PKG || exit 1
102
103# I guess Ted would rather not have this included, so we won't.
104# ( cd misc
105#   make findsuper
106#   cat findsuper > $PKG/sbin/findsuper
107#   chmod 0755 $PKG/sbin/findsuper )
108
109find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
110  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
111
112# Don't clobber an existing config file
113mv $PKG/etc/mke2fs.conf $PKG/etc/mke2fs.conf.new
114
115# Fix up package:
116mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}
117mv $PKG/lib${LIBDIRSUFFIX}/pkgconfig $PKG/lib${LIBDIRSUFFIX}/*.so \
118  $PKG/usr/lib${LIBDIRSUFFIX}
119( cd $PKG/usr/lib${LIBDIRSUFFIX}
120  for i in *.so ; do
121    ln -sf /lib${LIBDIRSUFFIX}/$(readlink $i) $i ;
122  done
123)
124
125# Since fsck is now part of util-linux, let's prefer that version:
126if [ -r $PKG/sbin/fsck ]; then
127  mv $PKG/sbin/fsck $PKG/sbin/fsck-e2fsprogs
128fi
129if [ -r $PKG/usr/man/man8/fsck.8 ]; then
130  mv $PKG/usr/man/man8/fsck.8 $PKG/usr/man/man8/fsck-e2fsprogs.8
131fi
132
133# findfs is intentionally left out here - we use the one in util-linux-ng
134( cd $PKG/sbin
135  rm -f \
136    mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.ext4dev \
137    fsck.ext2 fsck.ext3 fsck.ext4dev e2label findfs
138  ln -sf mke2fs mkfs.ext2
139  ln -sf mke2fs mkfs.ext3
140  ln -sf mke2fs mkfs.ext4
141  ln -sf mke2fs mkfs.ext4dev
142  ln -sf tune2fs e2label
143  cat << EOF > fsck.ext2
144#!/bin/sh
145exec /sbin/e2fsck -C 0 \$*
146EOF
147  chmod 0755 fsck.ext2
148  # Why won't symlinks work here?  --RW
149  # Because $0 will always be "fsck.ext2" in that case.  --PJV
150  # rworkman is correct, so ignore the previous two comments  :)  --PJV
151  cp -a fsck.ext2 fsck.ext3
152  cp -a fsck.ext2 fsck.ext4
153  cp -a fsck.ext2 fsck.ext4dev
154)
155( cd $PKG/usr/man/man5
156  ln -sf ext4.5 ext2.5
157  ln -sf ext4.5 ext3.5
158)
159( cd $PKG/usr/man/man8
160  rm -f fsck.ext2.8 fsck.ext3.8 mkfs.ext2.8 mkfs.ext3.8 \
161    mkfs.ext4.8 mkfs.ext4dev.8
162  ln -sf e2fsck.8 fsck.ext2.8
163  ln -sf e2fsck.8 fsck.ext3.8
164  ln -sf e2fsck.8 fsck.ext4.8
165  ln -sf e2fsck.8 fsck.ext4dev.8
166  ln -sf mke2fs.8 mkfs.ext2.8
167  ln -sf mke2fs.8 mkfs.ext3.8
168  ln -sf mke2fs.8 mkfs.ext4.8
169  ln -sf mke2fs.8 mkfs.ext4dev.8
170)
171
172# Compress manual pages:
173find $PKG/usr/man -type f -exec gzip -9 {} \;
174for i in $( find $PKG/usr/man -type l ) ; do
175  ln -s $( readlink $i ).gz $i.gz
176  rm $i
177done
178
179mkdir -p $PKG/usr/doc/e2fsprogs-$VERSION
180cp -a \
181  COPYING* INSTALL INSTALL.elfbin README* RELEASE-NOTES SHLIBS \
182  $PKG/usr/doc/e2fsprogs-$VERSION
183chmod 644 $PKG/usr/doc/e2fsprogs-$VERSION/*
184
185mkdir -p $PKG/install
186cat $CWD/slack-desc > $PKG/install/slack-desc
187zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
188
189cd $PKG
190/sbin/makepkg -l y -c n $TMP/e2fsprogs-$VERSION-$ARCH-$BUILD.txz
191
Note: See TracBrowser for help on using the repository browser.