#!/bin/bash # Slackware build script for lotus123 # Written by B. Watson (urchlay@slackware.uk) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # This is a very cool hack, though I'm not sure about my own sanity in # wanting to package it... # Purists take note: this really is i386, but since Slackware no # longer supports i386 or i486, ARCH is set to i586. That's the # minimum Slackware-supported ARCH this will run on. # I thought about creating and hosting a static binary for x86_64, but # statify doesn't support newer kernels (like, the one in Slack 15.0), # and Slackware doesn't ship static libraries except libc, so there's # no way to statically link ncurses (unless I build static ncurses # myself, which I don't much want to do). cd $(dirname $0) ; CWD=$(pwd) PRGNAM=lotus123 SRCNAM=123elf DISKNAM=123UNIX VERSION=${VERSION:-1.0.0rc4} BINUTVER=${BINUTVER:-2.38} 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 # Don't exit on bad arch/etc here, we want PRINT_PACKAGE_NAME to work. # Note that if ARCH=x86_64 or i686, we change it to i586 before # printing the package name. case "$ARCH" in i?86) ARCH=i586 ;; x86_64) if [ "$( /bin/ls /lib/ld-*.so 2>/dev/null )" = "" ]; then MULTI=fail else MULTI=ok ARCH=i586 fi ;; *) BADARCH=yes ;; esac if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 fi if [ "$BADARCH" = "yes" ]; then cat < $dir/$PRGNAM.png done mkdir -p $PKG/usr/share/pixmaps ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png # .desktop file by SlackBuild author. mkdir -p $PKG/usr/share/applications cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION mkdir -p $PKGDOC cp -a *.md $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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