office/khal: Fix completions.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2023-06-30 18:47:10 -04:00 committed by Willy Sudiarto Raharjo
parent 4f5a053208
commit 6b4229fa0d
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
1 changed files with 19 additions and 22 deletions

View File

@ -22,11 +22,17 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# 20230630 bkw: Modified by SlackBuilds.org, BUILD=3:
# - install the completions in the correct dirs (not /usr/doc).
# also install them with correct ownership ($CWD could be owned
# by anybody so you can't "cp -a $CWD/...").
# - remove SLKCFLAGS and strip stuff (no compiled code here).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=khal
VERSION=${VERSION:-0.11.1}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -47,20 +53,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
@ -72,26 +64,31 @@ cd $PRGNAM-$VERSION
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 \
-o -perm 511 \) -exec chmod 755 {} + -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} +
python3 setup.py install --root=$PKG
# Strip binaries and libraries.
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
*.rst doc/* \
$CWD/khal-complete.* \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Remove directory containing only .gitignore
rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/source/ystatic
# 20230630 bkw: install the completion stuff in the right places.
mkdir -p $PKG/usr/share/bash-completion/completions \
$PKG/usr/share/zsh/site-functions \
$PKG/usr/share/fish/completions
# 20230630 bkw: N.B. do not use "cp -a" to copy files from $CWD.
cat $CWD/khal-complete.bash > $PKG/usr/share/bash-completion/completions/khal
cat $CWD/khal-complete.zsh > $PKG/usr/share/zsh/site-functions/_khal
cat $CWD/khal-complete.fish > $PKG/usr/share/fish/completions/khal.fish
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc