#!/bin/bash # Slackware build script for reptyr # Written by B. Watson (yalhcru@gmail.com) # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. # 20201103 bkw: updated for v0.8.0 # 20191128 bkw: updated for v0.7.0 # 20170621 bkw: get rid of -Werror (-current needs this) # 20170302 bkw: use long-format github URL # 20150505 bkw: updated for v0.6.2 PRGNAM=reptyr VERSION=${VERSION:-0.8.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} 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} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" else SLKCFLAGS="-O2" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$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 {} \+ sed -i \ -e 's,share/man,man,g' \ -e 's,-Werror,,' \ Makefile make PREFIX=/usr CFLAGS="$SLKCFLAGS" strip $PRGNAM make install PREFIX=/usr DESTDIR=$PKG find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a COPYING ChangeLog NOTES README.md $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}