summaryrefslogtreecommitdiff
path: root/extra/source/bash-completion/bash-completion.SlackBuild
blob: 153853dc20713549eb76776be426cbbadefeb329 (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
#!/bin/sh
# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
PKG=$TMP/package-bash-completion

VERSION=20060301
ARCH=noarch
BUILD=2

if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi
rm -rf $PKG
mkdir -p $PKG

cd $TMP
rm -rf bash_completion
tar xjvf $CWD/bash-completion-$VERSION.tar.bz2
cd bash_completion

# Add support for xz file formats:
zcat $CWD/bash-completion-xz.diff.gz | patch -p1 || exit 1

mkdir -p $PKG/etc/bash_completion.d $PKG/etc/profile.d
cp -a $CWD/bash_completion.sh.gz $PKG/etc/profile.d
gzip -d $PKG/etc/profile.d/bash_completion.sh.gz
chmod 755 $PKG/etc/profile.d/bash_completion.sh
cp -a bash_completion $PKG/etc
chmod 644 $PKG/etc/bash_completion
cp -a contrib/* $PKG/etc/bash_completion.d
chmod 755 $PKG/etc/bash_completion.d/*
mkdir -p $PKG/usr/doc/bash-completion-$VERSION
cp -a BUGS COPYING README $PKG/usr/doc/bash-completion-$VERSION
chmod 644 $PKG/usr/doc/bash-completion-$VERSION/*
( cd $PKG ; chown -R root.root . )
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Build the package:
cd $PKG
makepkg -l y -c n $TMP/bash-completion-$VERSION-$ARCH-$BUILD.txz

# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
  rm -rf $TMP/bash_completion
  rm -rf $PKG
fi