2021-07-04 01:48:15 +08:00
|
|
|
#!/bin/bash
|
2017-09-08 07:23:04 +08:00
|
|
|
|
|
|
|
# Slackware build script for dis
|
|
|
|
|
2022-06-09 00:26:51 +08:00
|
|
|
# Written by B. Watson (urchlay@slackware.uk)
|
2017-09-08 07:23:04 +08:00
|
|
|
|
|
|
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
|
|
|
|
2021-07-04 17:41:06 +08:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2017-09-08 07:23:04 +08:00
|
|
|
PRGNAM=dis
|
2018-09-12 04:45:38 +08:00
|
|
|
VERSION=${VERSION:-0.6}
|
2021-08-30 16:45:13 +08:00
|
|
|
BUILD=${BUILD:-2}
|
2017-09-08 07:23:04 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 18:23:38 +08:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2017-09-08 07:23:04 +08:00
|
|
|
|
|
|
|
# no compiled code here
|
|
|
|
ARCH=noarch
|
|
|
|
|
2021-07-04 18:23:38 +08:00
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2017-09-08 07:23:04 +08:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# my ($release, $commit) = split /_/, $version;
|
|
|
|
# Who says perl is less readable than bash?
|
|
|
|
RELEASE="$( echo $VERSION | cut -d_ -f1 )"
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$RELEASE
|
|
|
|
tar xvf $CWD/$PRGNAM-$RELEASE.tar.gz
|
|
|
|
cd $PRGNAM-$RELEASE
|
|
|
|
chown -R root:root .
|
|
|
|
chmod 644 *
|
|
|
|
|
2021-08-30 16:45:13 +08:00
|
|
|
sed -i 's,Dissasseble,Disassemble,g' $PRGNAM README*
|
|
|
|
|
2017-09-08 07:23:04 +08:00
|
|
|
patch -p1 < $CWD/usr_share.diff # look for .dop files also in /usr/share/dis
|
|
|
|
|
|
|
|
# manual install
|
|
|
|
mkdir -p $PKG/usr/bin $PKG/usr/share/$PRGNAM $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
install -m0755 $PRGNAM $PKG/usr/bin
|
|
|
|
install -m0644 *.dop $PKG/usr/share/$PRGNAM
|
|
|
|
install -m0644 *.md $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
|
2021-08-30 16:45:13 +08:00
|
|
|
# uh, and now manual (page) install. The man page was made from README.md
|
|
|
|
# by the SlackBuild author.
|
|
|
|
mkdir -p $PKG/usr/man/man1
|
|
|
|
gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
|
|
|
|
|
2017-09-08 07:23:04 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 18:23:38 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|