slackbuilds_ponce/system/kmscon/kmscon.SlackBuild
B. Watson f308b784ea
system/kmscon: Updated for version 8+20140708_0b34527.
Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2021-10-13 00:51:41 +07:00

103 lines
2.4 KiB
Bash

#!/bin/bash
# Slackware build script for kmscon
# Written by B. Watson (yalhcru@gmail.com)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20210825 bkw: update to the last git commit, post v8 release. It's from
# 2014, so I doubt there will be more version updates.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=kmscon
VERSION=${VERSION:-8+20140708_0b34527}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
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}
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
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# Fix build on -current: add #include <sys/sysmacros.h> to files that
# use major() and minor()
patch -p1 < $CWD/sysmacros.diff
[ -x configure ] || autoreconf -if
SLKCFLAGS="$SLKCFLAGS -DSIGUNUSED=SIGSYS"
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--disable-static \
--enable-shared \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make
make install-strip DESTDIR=$PKG
gzip $PKG/usr/man/man1/$PRGNAM.1
# we don't seem to need the .la files
rm -f $PKG/usr/lib$LIBDIRSUFFIX/$PRGNAM/*.la
mkdir -p $PKG/etc/$PRGNAM
cat $CWD/$PRGNAM.conf > $PKG/etc/$PRGNAM/$PRGNAM.conf.new
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING NEWS README $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
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE