freebsd-ports/print/pdftk/Makefile
Tijl Coosemans 02f27a83b4 The output of tools like awk, date, sort, tr,... depends on the current
locale set by the user.  Add LANG=C and LC_ALL=C at the beginning of
bsd.port.mk and export them so all commands are executed with the C locale.
LC_ALL=C overrides all other LC_* variables.  LANG is used by setlocale(3)
as default value for LC_* variables, so normally it isn't used when LC_ALL
is set, but there's code out there that looks at LANG directly so it's safer
to set it as well.  The only commands not captured by this are !=
assignments before any inclusion of bsd.port.*mk.

Introduce USE_LOCALE=<locale> that adds LANG=<locale> and LC_ALL=<locale> to
CONFIGURE_ENV and MAKE_ENV so upstream build systems can be executed with a
different locale (e.g. USE_LOCALE=en_US.UTF-8).

PR:		215882
Exp-run by:	antoine
Approved by:	portmgr (antoine)
2017-01-18 13:20:31 +00:00

54 lines
1.5 KiB
Makefile

# Created by: Patrick Dung (patrick_dkt@yahoo.com.hk)
# $FreeBSD$
PORTNAME= pdftk
PORTVERSION= 2.02
PORTREVISION= 4
CATEGORIES= print
MASTER_SITES= http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ LOCAL/mat/pdftk
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
MAINTAINER= mat@FreeBSD.org
COMMENT= Simple tool for doing everyday things with PDF documents
LICENSE= GPLv2
# Get GCC version suffix without the dot in USE_GCC
CSUFF= ${_USE_GCC:S/.//}
USE_GCC= yes
USES= iconv gmake zip
# gcj/libgcj don't exist on some platforms
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= GNU gcj does not exist on this platform
PATCH_WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-dist
WRKSRC= ${PATCH_WRKSRC}/${PORTNAME}
MAKEFILE= Makefile.FreeBSD
MAKE_ENV= GCJ=gcj${CSUFF} GCJH=gcjh${CSUFF} GCPP=cpp${CSUFF} \
OBJCOPY=${OBJCOPY}
PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
pre-configure:
@if [ ! -e ${LOCALBASE}/bin/gcj${CSUFF} ]; then \
${ECHO_MSG} ""; \
${ECHO_MSG} "Can not find gcj${CSUFF}"; \
${ECHO_MSG} "Please rebuild ${_GCC_PORT} with java support"; \
${ECHO_MSG} ""; \
exit 1; \
fi
post-patch:
@${REINPLACE_CMD} -e "s|TOOLPATH=|TOOLPATH=${LOCALBASE}/bin/|g; \
s|VERSUFF=|VERSUFF=${CSUFF}|g; s|GCJFLAGS=|GCJFLAGS= -L${LOCALBASE}/lib ${LDFLAGS} -w|g; \
s|LDLIBS= -lgcj|LDLIBS= -lgcj -pthread ${ICONV_LIB} -lz -L${LOCALBASE}/lib ${LDFLAGS} -w|g" \
${WRKSRC}/${MAKEFILE}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/../${PORTNAME}.1 ${STAGEDIR}${PREFIX}/man/man1
.include <bsd.port.mk>