blob: f9ace469923f19669e7105dd2c2899897d7f4765 (
plain)
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
|
#!/bin/bash
## Written by Martin Ivanov (tramni@abv.bg)
## Package Homepage: http://www-user.tu-chemnitz.de/~fri/ding/
## Feel free to use, modify, redistribute this script.
## If you make changes please add a "Modified by" line so that I don't
## receive kudos or flames for things I didn't write... Thanks.
# Heavily Modified by Michiel van Wessem <michiel@slackbuilds.org> 20081020
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=ding
VERSION=${VERSION:-1.7}
ARCH=noarch
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
fi
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
mkdir -p $PKG $OUTPUT $TMP
cd $TMP || exit 1
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
cd $PRGNAM-$VERSION || exit 1
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
mkdir -p $PKG/usr/{bin,man/man1}
cp ding $PKG/usr/bin || exit 1
cp ding.1 $PKG/usr/man/man1 || exit 1
mkdir -p $PKG/usr/share/{dict,applications,pixmaps}
cp de-en.txt $PKG/usr/share/dict|| exit 1
cp ding.desktop $PKG/usr/share/applications || exit 1
cp ding.png $PKG/usr/share/pixmaps
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -R $CWD/{$PRGNAM.SlackBuild,slack-desc,doinst.sh} CHANGES COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chown root:root {} \; -exec chmod 644 {} \;
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|