summaryrefslogtreecommitdiffstats
path: root/source/a/cryptsetup
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/cryptsetup')
-rwxr-xr-xsource/a/cryptsetup/cryptsetup.SlackBuild106
1 files changed, 48 insertions, 58 deletions
diff --git a/source/a/cryptsetup/cryptsetup.SlackBuild b/source/a/cryptsetup/cryptsetup.SlackBuild
index 7a7f3a8ba..35b674aee 100755
--- a/source/a/cryptsetup/cryptsetup.SlackBuild
+++ b/source/a/cryptsetup/cryptsetup.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
-# Copyright (c) 2007, 2009 Eric Hameleers <alien@slackware.com>
-# Copyright (c) 2007, 2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright (c) 2007, 2009, 2010 Eric Hameleers <alien@slackware.com>
+# Copyright (c) 2007, 2009, 2010 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -28,15 +28,23 @@
# By: Eric Hameleers <alien@slackware.com>
# For: cryptsetup
# Descr: Utility for setting up encrypted filesystems
-# URL: http://luks.endorphin.org/dm-crypt
+# URL: http://code.google.com/p/cryptsetup/
#
# -----------------------------------------------------------------------------
-PRGNAM=cryptsetup
-VERSION=${VERSION:-1.0.7}
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-1}
-
+PKGNAM=cryptsetup
+VERSION=${VERSION:-1.1.0}
+BUILD=${BUILD:-2}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
@@ -47,6 +55,9 @@ elif [ "$ARCH" = "s390" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
CWD=$(pwd)
@@ -67,7 +78,6 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-echo Building ...
LDFLAGS="$SLKLDFLAGS" \
CFLAGS="$SLKCFLAGS" \
./configure \
@@ -76,60 +86,40 @@ CFLAGS="$SLKCFLAGS" \
--localstatedir=/var \
--sysconfdir=/etc \
--mandir=/usr/man \
- --enable-libgcrypt \
- --enable-libdevmapper \
- --program-prefix= \
- --program-suffix= \
+ --docdir=/usr/doc/cryptsetup-$VERSION \
--build=$ARCH-slackware-linux
make
make DESTDIR=$PKG install
-#
-# Next, make the static version that we will use for mkinitrd:
-#
-
-make clean
-echo Building ...
-LDFLAGS="$SLKLDFLAGS" \
-CFLAGS="$SLKCFLAGS" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --localstatedir=/var \
- --sysconfdir=/etc \
- --mandir=/usr/man \
- --enable-libgcrypt \
- --enable-libdevmapper \
- --enable-static \
- --disable-shared \
- --disable-shared-library \
- --program-prefix= \
- --program-suffix= \
- --build=$ARCH-slackware-linux
-make
-
-# I have to do one old-school thing to leave a mark here:
+# Move the shared library to $PKG/lib${LIBDIRSUFFIX}:
+mkdir -p $PKG/lib${LIBDIRSUFFIX}
+( cd $PKG/usr/lib${LIBDIRSUFFIX}
+ for file in lib*.so.?.* ; do
+ mv $file ../../lib${LIBDIRSUFFIX}
+ ln -sf ../../lib${LIBDIRSUFFIX}/$file .
+ done
+ cp -a lib*.so.? ../../lib${LIBDIRSUFFIX}
+)
+
+# Move the cryptsetup binary to $PKG/sbin:
mkdir -p $PKG/sbin
-cat src/cryptsetup > $PKG/sbin/cryptsetup.static
-chmod 755 $PKG/sbin/cryptsetup.static
-
-mv $PKG/usr/sbin/cryptsetup $PKG/usr/sbin/cryptsetup.dynamic
-# Replace with a link:
-( cd $PKG/usr/sbin ; ln -sf cryptsetup.dynamic cryptsetup )
-# In /sbin, use the static version as /usr *might* not be mounted yet.
-# However, note that some cryptsetup operations cause the static
-# version to segfault, so for things like formatting you'll want
-# to use the dynamic one. That's what should be in the $PATH first.
-( cd $PKG/sbin ; ln -sf cryptsetup.static cryptsetup )
-
-# Remove unneeded empty directory:
-#rmdir $PKG/usr/lib/cryptsetup
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+( cd $PKG/usr/sbin
+ mv cryptsetup ../../sbin
+ ln -sf ../../sbin/cryptsetup .
+)
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
- AUTHORS COPYING* ChangeLog INSTALL NEWS README TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
-chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/*
+ AUTHORS COPYING* INSTALL NEWS README TODO \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; || true
@@ -140,5 +130,5 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $TMP/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txz
+/sbin/makepkg -l y -c n $TMP/${PKGNAM}-${VERSION}-${ARCH}-${BUILD}.txz