void-packages/srcpkgs/fortune-mod/template

40 lines
1.3 KiB
Bash

# Template file for 'fortune-mod'
pkgname=fortune-mod
version=1.99.1
revision=7
hostmakedepends="recode"
makedepends="recode-devel"
short_desc="Implementation of the BSDGames 'fortune' program"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-4-Clause-UC"
homepage="http://www.redellipse.net/code/fortune"
distfiles="${DEBIAN_SITE}/main/f/fortune-mod/${pkgname}_${version}.orig.tar.gz"
checksum=fc51aee1f73c936c885f4e0f8b6b48f4f68103e3896eaddc6a45d2b71e14eace
desc_option_offensive="Enable offensive fortunes"
build_options="offensive"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" fortune-mod"
_strfile="STRFILE=/usr/bin/strfile"
fi
do_build() {
vsed -i "s|^CFLAGS=.*|CFLAGS=${CFLAGS} -fsigned-char \$(DEFINES)|" Makefile
vsed -i "s|^LDFLAGS=.*|LDFLAGS=${LDFLAGS}|" Makefile
vsed -i "s;u_int;uint;" util/strfile.h
case "$XBPS_TARGET_MACHINE" in
*-musl)
vsed -e "s;-DBSD_REGEX;-DPOSIX_REGEX;" -i Makefile
esac
make CC=$CC COOKIEDIR=/usr/share/fortunes $_strfile
sed -n '/[*][[:space:]]*The Regents/,/SUCH DAMAGE/p' fortune/fortune.c |
sed -e 's/^ [*][[:space:]]\?//' >LICENSE
}
do_install() {
make prefix=${DESTDIR} FORTDIR=${DESTDIR}/usr/bin \
COOKIEDIR=$DESTDIR/usr/share/fortunes OFFENSIVE=$(vopt_if offensive 1 0) \
install
vlicense LICENSE
}