slackbuilds_ponce/system/plan9port/plan9port.SlackBuild
Ruben Schuller b5e459ed42
system/plan9port: Updated for version 20171222.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2019-05-04 02:29:38 +07:00

89 lines
3 KiB
Bash

#!/bin/sh
# Slackware build script for plan9port
# Copyright (c) 2012-2019 Ruben Schuller
#
# Copyright (c) 2008-2010, Antonio Hernández Blas <hba.nihilismus@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1.- Redistributions of source code 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.
# 2012-10-23: added some changes to reflect the usage of nightly tarballs
PRGNAM=plan9port
VERSION=${VERSION:-20190501}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
COMMIT="3197719090b3fd0a038767f7e8e15e771b1515be"
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG/opt $OUTPUT
cd $TMP
rm -rf $PRGNAM-${COMMIT}
unzip $CWD/${COMMIT} || unzip $CWD/plan9port-${COMMIT}.zip
cd $PRGNAM-${COMMIT}
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 \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# All plan9 programs are going to be installed in "/opt/plan9"
PLAN9_TARGET=/opt/plan9 ./INSTALL
cd $TMP
mv $PRGNAM-${COMMIT} $PKG/opt/plan9
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
# man(1) from plan9port dislikes man pages compressed :)
# To setup some environment variables:
install -D -m 0755 $CWD/profile.d/$PRGNAM.sh $PKG/etc/profile.d/$PRGNAM.sh
install -m 0755 $CWD/profile.d/$PRGNAM.csh $PKG/etc/profile.d/$PRGNAM.csh
# Add the window manager 'rio' to xwmconfig's list.
install -D -m 0755 $CWD/xinitrc.rio $PKG/etc/X11/xinit/xinitrc.rio
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $PKG/opt/plan9
mv CHANGES CONTRIBUTORS INSTALL LICENSE README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION
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
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}