2009-08-26 17:00:38 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2016-06-30 22:26:57 +02:00
|
|
|
# Copyright 2009, 2010, 2011, 2012, 2014, 2015, 2016 Patrick J. Volkerding, Sebeka, Minnesota, USA
|
2010-05-19 10:58:23 +02:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use of this script, with or without modification, is
|
|
|
|
# permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of this script must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
|
|
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
|
|
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
|
|
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
|
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
# Slackware build script for bash-completion
|
|
|
|
|
2019-12-07 01:22:04 +01:00
|
|
|
VERSION=2.10
|
2009-08-26 17:00:38 +02:00
|
|
|
ARCH=noarch
|
2018-05-28 21:12:29 +02:00
|
|
|
BUILD=${BUILD:-1}
|
2009-08-26 17:00:38 +02:00
|
|
|
|
2010-05-19 10:58:23 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp}
|
|
|
|
PKG=$TMP/package-bash-completion
|
2009-08-26 17:00:38 +02:00
|
|
|
|
2010-05-19 10:58:23 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG
|
2009-08-26 17:00:38 +02:00
|
|
|
cd $TMP
|
2010-05-19 10:58:23 +02:00
|
|
|
rm -rf bash-completion-$VERSION
|
2018-05-28 21:12:29 +02:00
|
|
|
tar xvf $CWD/bash-completion-$VERSION.tar.?z || exit 1
|
|
|
|
cd bash-completion-$VERSION || exit 1
|
2010-05-19 10:58:23 +02:00
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2019-09-30 23:08:32 +02:00
|
|
|
-exec chmod 755 {} \+ -o \
|
2010-05-19 10:58:23 +02:00
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
2019-09-30 23:08:32 +02:00
|
|
|
-exec chmod 644 {} \+
|
2010-05-19 10:58:23 +02:00
|
|
|
|
2018-05-28 21:12:29 +02:00
|
|
|
# Add some patches from git
|
|
|
|
for file in $CWD/patches/*.patch.gz ; do
|
|
|
|
zcat $file | patch -p1 --verbose || exit 1
|
|
|
|
done
|
|
|
|
|
2011-04-25 15:37:00 +02:00
|
|
|
# Fixup sh completion for us
|
|
|
|
zcat $CWD/fixup-sh-script-completions.diff.gz | patch -p1 --verbose || exit 1
|
2010-05-19 10:58:23 +02:00
|
|
|
|
2016-06-30 22:26:57 +02:00
|
|
|
autoreconf -vif
|
|
|
|
|
2010-05-19 10:58:23 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
2016-06-30 22:26:57 +02:00
|
|
|
--docdir=/usr/doc/bash-completion-$VERSION || exit 1
|
2010-05-19 10:58:23 +02:00
|
|
|
|
|
|
|
make || exit 1
|
|
|
|
make install DESTDIR=$PKG || exit 1
|
2011-04-25 15:37:00 +02:00
|
|
|
|
2018-05-28 21:12:29 +02:00
|
|
|
# Don't clobber mount and umount completions from util-linux:
|
|
|
|
mv $PKG/usr/share/bash-completion/completions/mount \
|
|
|
|
$PKG/usr/share/bash-completion/completions/_mount
|
|
|
|
mv $PKG/usr/share/bash-completion/completions/umount \
|
|
|
|
$PKG/usr/share/bash-completion/completions/_umount
|
|
|
|
|
2016-06-30 22:26:57 +02:00
|
|
|
# Create the local directory for admin changes/additions:
|
|
|
|
mkdir -p $PKG/etc/bash_completion.d/
|
|
|
|
|
2010-05-19 10:58:23 +02:00
|
|
|
chmod 0755 $PKG/etc/profile.d/bash_completion.sh
|
|
|
|
|
2009-08-26 17:00:38 +02:00
|
|
|
mkdir -p $PKG/usr/doc/bash-completion-$VERSION
|
2010-05-19 10:58:23 +02:00
|
|
|
cp -a \
|
2011-04-25 15:37:00 +02:00
|
|
|
AUTHORS COPYING* README* TODO \
|
2010-05-19 10:58:23 +02:00
|
|
|
$PKG/usr/doc/bash-completion-$VERSION
|
|
|
|
|
|
|
|
# If there's a ChangeLog, installing at least part of the recent history
|
|
|
|
# is useful, but don't let it get totally out of control:
|
|
|
|
if [ -r CHANGES ]; then
|
|
|
|
DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
|
|
|
|
cat CHANGES | head -n 1000 > $DOCSDIR/CHANGES
|
|
|
|
touch -r CHANGES $DOCSDIR/CHANGES
|
|
|
|
fi
|
|
|
|
|
2011-04-25 15:37:00 +02:00
|
|
|
# Contrib scripts can go in with the documentation:
|
|
|
|
cp -a $CWD/contrib $PKG/usr/doc/bash-completion-$VERSION
|
|
|
|
chown -R root:root $PKG/usr/doc/bash-completion-$VERSION
|
|
|
|
chmod 755 $PKG/usr/doc/bash-completion-$VERSION/contrib
|
|
|
|
chmod 644 $PKG/usr/doc/bash-completion-$VERSION/contrib/*
|
|
|
|
|
2009-08-26 17:00:38 +02:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-19 10:58:23 +02:00
|
|
|
/sbin/makepkg -l y -c n $TMP/bash-completion-$VERSION-$ARCH-$BUILD.txz
|