1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-01-16 15:41:42 +01:00
slackware-current/extra/source/bash-completion/bash-completion.SlackBuild

51 lines
1.2 KiB
Text
Raw Normal View History

#!/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