1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
#!/bin/sh
#
# mldonkey.SlackBuild (Slackware - MLDonkey build script).
# author: Herbert Alexander Faleiros <herbert@faleiros.eti.br>
#
# Current directory.
CWD=`pwd`
# Load options file (mldonkey.options).
. $CWD/mldonkey.options
# Remove old revisions (directories/files).
rm -rf $PKG $NAME-$VERSION
# Create pre-installation directory, docs...
mkdir -p $PKG $INSTALL $DOCS $PKG/usr/bin
# Check source code archive presence.
test -f $SRC || wget $HOST/$SRC
# Unpack source code.
tar -xjvf $SRC
# Source code directory.
cd $NAME-$VERSION
# Configuration directory.
cd config
# Add DESTDIR support.
patch -p0 -i $CWD/Makefile.in.patch
# Pre-configure program.
autoconf
# Return to main directory.
cd ..
# Prepare program for compilation.
echo yes | CFLAGS=$CPUOPT ./configure $CONFIGURE
# Compile source code.
make $NUMJOBS $STATIC
# Pre-installation.
make install DESTDIR=$PKG
# Check for mlnet binary.
test -f $PKG/usr/bin/mlnet || exit 1
# Strip mlnet.
strip --strip-unneeded $PKG/usr/bin/mlnet
# Copy slack-desc.
cp $CWD/slack-desc $INSTALL
# Copy documentation.
(cd distrib && cp [A-Z]* $DOCS)
# Pre-installation directory.
cd $PKG
# Owner directory/files.
chown 0.0 . -R
# FHS/Slackware compatibility - correct owners/group.
chown 0.bin usr/bin -R
# Security check.
for i in a-st go-w; do
chmod $i . -R
done
# Create a Slackware package.
makepkg -l y -c n $TGZ
# Hashes (sha1 and md5).
for HASH in sha1 md5; do
${HASH}sum $TGZ > $TGZ.$HASH
done
# Upgrade or install package.
#upgradepkg $TGZ || installpkg $TGZ
# Move package and hashes to current directory.
mv $TGZ* $CWD
# Cleanness.
rm -rf $PKG $CWD/$NAME-$VERSION
|