fortune-mod: remove error.{h,c} copy.

Revbump to pick up the fix from librecode.

Also use vsed where appropriate.
This commit is contained in:
Érico Rolim 2020-12-16 17:59:10 -03:00 committed by Érico Nogueira Rolim
parent a7fba4f268
commit 61a69d943e
3 changed files with 5 additions and 30 deletions

View File

@ -1,19 +0,0 @@
#include <stdarg.h>
#include <stdio.h>
#define _GNU_SOURCE
#include <errno.h>
void error(int status, int errnum, const char* format, ...)
{
va_list ap;
fflush(stdout);
fprintf(stderr, "%s: ", program_invocation_name);
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
if (errnum)
fprintf(stderr, ":%d", errnum);
if (status)
exit(status);
}

View File

@ -1,4 +0,0 @@
#ifndef _ERROR_H_
#define _ERROR_H_
void error(int status, int errnum, const char* format, ...);
#endif /* _ERROR_H_ */

View File

@ -1,7 +1,7 @@
# Template file for 'fortune-mod'
pkgname=fortune-mod
version=1.99.1
revision=5
revision=6
hostmakedepends="recode"
makedepends="recode-devel"
short_desc="Implementation of the BSDGames 'fortune' program"
@ -18,14 +18,12 @@ if [ "$CROSS_BUILD" ]; then
fi
do_build() {
sed -i "s|^CFLAGS=.*|CFLAGS=${CFLAGS} -fsigned-char \$(DEFINES)|" Makefile
sed -i "s|^LDFLAGS=.*|LDFLAGS=${LDFLAGS}|" Makefile
sed -i "s;u_int;uint;" util/strfile.h
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)
cp ${FILESDIR}/error.{c,h} ${wrksrc}/fortune
sed -e "s;-DBSD_REGEX;-DPOSIX_REGEX;" -i Makefile
sed -e "s;fortune\.o;fortune.o error.o;" -i fortune/Makefile
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 |