Rogue Class Linux Download Login

Artifact Content

Artifact 98e34254e8e000ff7594d2b2ab31b05ad4e06f52:


#!/bin/sh -e

PRGNAM=pdcurses
VERSION=${VERSION:-3.4}
BUILD=${BUILD:-1}

if [ -z "$ARCH" ]; then
    case "$(uname -m)" in
    i?86)
        ARCH=i486
        ;;
    arm*)
        ARCH=arm
        ;;
    *)
        ARCH=$(uname -m)
        ;;
    esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

case "$ARCH" in
i486)
    SLKCFLAGS="-O2 -march=i486 -mtune=i686"
    LIBDIRSUFFIX=""
    ;;
i686)
    SLKCFLAGS="-O2 -march=i686 -mtune=i686"
    LIBDIRSUFFIX=""
    ;;
x86_64)
    SLKCFLAGS="-O2 -fPIC"
    LIBDIRSUFFIX="64"
    ;;
*)
    SLKCFLAGS="-O2"
    LIBDIRSUFFIX=""
    ;;
esac

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf PDCurses-$VERSION
tar xvf $CWD/PDCurses-3.4.tar.gz
patch -b -p0 <$CWD/pdcdisp.c.diff
patch -b -p0 <$CWD/pdckbd.c.diff
patch -b -p0 <$CWD/pdcscrn.c.diff
patch -b -p0 <$CWD/pdcsdl.h.diff
patch -b -p0 <$CWD/sdl1-Makefile.diff

cd PDCurses-3.4
chown -R root:root .
find .                    \
    \(                    \
        -perm 777 -o      \
        -perm 775 -o      \
        -perm 711 -o      \
        -perm 555 -o      \
        -perm 511         \
    \)                    \
    -exec chmod 755 {} \; \
    -o                    \
    \(                    \
        -perm 666 -o      \
        -perm 664 -o      \
        -perm 600 -o      \
        -perm 444 -o      \
        -perm 440 -o      \
        -perm 400         \
    \)                    \
    -exec chmod 644 {} \;

# No ./configure provided
cd sdl1
CFLAGS="$SLKCFLAGS -DPDC_RGB" make
cd ..
cd doc
make
cd ..

# install sdl pdcurses
mkdir -p $PKG/usr/include/pdcurses
cp curses.h curspriv.h panel.h term.h $PKG/usr/include/pdcurses/
cp sdl1/pdcsdl.h $PKG/usr/include/pdcurses/

mkdir -p $PKG/usr/lib
cp sdl1/libpdcurses.a $PKG/usr/lib/

mkdir -p $PKG/usr/share/pdcurses-demos
cd sdl1
cp -a firework newdemo ptest rain sdltest testcurs tuidemo worm xmas \
    $PKG/usr/share/pdcurses-demos/
cd ..

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp doc/PDCurses.txt $PKG/usr/doc/$PRGNAM-$VERSION
cp sdl1/README $PKG/usr/doc/$PRGNAM-$VERSION/readme-sdl.txt
cp $CWD/readme-rcl.txt $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.${PKGTYPE:-tgz}