slackbuilds_ponce/development/pli/pli.SlackBuild
B. Watson 24a1ffe3db
development/pli: Added (Iron Spring PL/I Compiler).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2022-01-22 08:23:02 +07:00

87 lines
2.4 KiB
Bash

#!/bin/bash
# Slackware build script for pli
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pli
VERSION=${VERSION:-0.9.10d}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
# static binary and library are for this arch.
ARCH=i586
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}
# wrapper/frontend script version.
PLICLVER=${PLICLVER:-0.0.1}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tgz
cd $PRGNAM-$VERSION
chown -R root:root .
# permissions are bad, please don't revert this to template.
find . -type f -a -exec chmod 644 {} \+ -o -exec chmod 755 {} \+
# binary-only software, no compilation, just install it where it goes.
# AUR has a pli build:
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pli-bin
# but they don't include the includes, or the ISAM stuff (libpbl),
# or the alt/ dir.
# thought about stripping the plic binary, but I'm not sure it's wise.
# plus, it's 2.6MB, and stripping it only removes 18KB (or, it only
# gets 0.07% smaller), so no point anyway.
PKGLIB=$PKG/usr/lib
PRIVLIB=$PKGLIB/$PRGNAM-$VERSION
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
PKGMAN=$PKG/usr/man/man1
mkdir -p $PKG/usr/bin $PRIVLIB $PKGDOC $PKGMAN
install -oroot -groot -m0755 plic $PRIVLIB/plic
install -oroot -groot -m0644 lib/libprf.a $PRIVLIB/libprf.a
install -oroot -groot -m0644 lib/libpbl.a $PRIVLIB/libpbl.a
cp -a lib/{alt,include,source} $PRIVLIB
ln -s $PRGNAM-$VERSION $PKG/usr/lib/$PRGNAM
ln -s ../lib/$PRGNAM/plic $PKG/usr/bin/plic
ln -s $PRGNAM/libprf.a $PKGLIB/libprf.a
ln -s $PRGNAM/libpbl.a $PKGLIB/libpbl.a
gzip -9c < $CWD/plic.1 > $PKGMAN/plic.1.gz
# wrapper script. written by the SlackBuild author, but not
# Slackware-specific, so it's not kept in SBo's git repo.
install -oroot -groot -m0755 $CWD/plicl-$PLICLVER $PKG/usr/bin/plicl
sh $CWD/plicl-$PLICLVER --man | gzip -9c > $PKGMAN/plicl.1.gz
# don't need 2 copies of the lgpl
rm -f lib/lgpl.html
cp -a *.gif *.pdf *.html lib/*.html samples $PKGDOC
cat $CWD/README_SBo.txt > $PKGDOC/README_SBo.txt
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}