fortune-mod: fix cross compile

Also bump revision to ship LICENSE file according to BSD requirements.
This commit is contained in:
Đoàn Trần Công Danh 2020-02-13 16:38:24 +07:00 committed by Jürgen Buchmüller
parent fbfc0c84df
commit e1f38607ff
2 changed files with 47 additions and 4 deletions

View file

@ -0,0 +1,33 @@
--- a/datfiles/off/Makefile
+++ b/datfiles/off/Makefile
@@ -9,7 +9,7 @@ OCOOKIES_ROTATED=
OCOOKIES=$(OCOOKIES_UNROTATED) $(OCOOKIES_ROTATED)
STRFILE=../../util/strfile
-ROT=../../util/rot
+ROT=../../util/rot_for_build
all: ocookies-stamp
diff --git a/util/Makefile b/util/Makefile
index 6356e4f..0f1b35a 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -5,7 +5,7 @@
# and make install-uman. make clean will work properly if called in
# this directory.
-all: strfile unstr rot
+all: strfile unstr rot rot_for_build
strfile: strfile.o
$(CC) $(LDFLAGS) -o strfile strfile.o
@@ -19,5 +19,8 @@ randstr: randstr.o
rot: rot.o
$(CC) -fsigned-char $(LDFLAGS) -o rot rot.o
+rot_for_build:
+ $(CC_FOR_BUILD) -fsigned-char $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o rot_for_build rot.c
+
clean:
rm -f *.o unstr strfile randstr rot ansify

View file

@ -1,7 +1,7 @@
# Template file for 'fortune-mod'
pkgname=fortune-mod
version=1.99.1
revision=4
revision=5
hostmakedepends="recode"
makedepends="recode-devel"
short_desc="Implementation of the BSDGames 'fortune' program"
@ -10,7 +10,12 @@ 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
nocross=yes
patch_args=-Np1
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" fortune-mod"
_strfile="STRFILE=/usr/bin/strfile"
fi
do_build() {
sed -i "s|^CFLAGS=.*|CFLAGS=${CFLAGS} -fsigned-char \$(DEFINES)|" Makefile
@ -22,8 +27,13 @@ do_build() {
sed -e "s;-DBSD_REGEX;-DPOSIX_REGEX;" -i Makefile
sed -e "s;fortune\.o;fortune.o error.o;" -i fortune/Makefile
esac
make CC=$CC COOKIEDIR=/usr/share/fortunes
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 install
make prefix=${DESTDIR} FORTDIR=${DESTDIR}/usr/bin \
COOKIEDIR=$DESTDIR/usr/share/fortunes \
install
vlicense LICENSE
}