File: mldonkey.SlackBuild

package info (click to toggle)
mldonkey 2.8.1-2etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,940 kB
  • ctags: 26,220
  • sloc: ml: 138,666; sh: 15,368; cpp: 12,076; ansic: 8,243; asm: 3,858; xml: 3,367; perl: 1,831; makefile: 259; python: 258
file content (90 lines) | stat: -rw-r--r-- 1,655 bytes parent folder | download | duplicates (7)
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