freebsd-ports/textproc/gsed/Makefile
Baptiste Daroussin e7b0f97788 Fix a long standing bug of lib/charset.alias being overwritten, modified, and badly tracked by ports.
Make lib/charset.alias a file only provided by converters/libiconv
Create a new USES: charsetfix, that will modify in post patch the Makefile.in to prevent a port from modifying/overwritting the charset.alias file during make install.
Prevent devel/gettext from installing that files.
Fix a couple of ports that actually touch charset.alias during the build phase.

Based on a patch by ale (http://lists.freebsd.org/pipermail/freebsd-gnome/2012-October/027747.html)

Approved by:	kwm (gnome)
Exp-run by:	miwi
2013-03-18 11:40:04 +00:00

68 lines
1.5 KiB
Makefile

# Created by: Cyrille Lefevre <clefevre@citeweb.net>
# $FreeBSD$
PORTNAME= sed
PORTVERSION= 4.2.1
PORTREVISION= 2
CATEGORIES= textproc
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= ${PORTNAME}
PKGNAMEPREFIX= g
MAINTAINER= gabor@FreeBSD.org
COMMENT= The GNU stream editor
GNU_CONFIGURE= yes
CONFIGURE_ENV+= MAKEINFO="makeinfo --no-split"
USES= charsetfix
PATCH_SUBDIRS= . doc lib sed
DATADIR= ${PREFIX}/share/${PKGBASE}
SAMP_FILES= binary*.sed dc.sed
EXAMPLESDIR= ${PREFIX}/share/examples/${PKGBASE}
PORTDOCS= AUTHORS BUGS COPYING COPYING.DOC NEWS README THANKS
DOCSDIR= ${PREFIX}/share/doc/${PKGBASE}
USE_GMAKE= yes
INFO= sed
MAN1= gsed.1
.include <bsd.port.pre.mk>
.if ${PORT_OPTIONS:MNLS}
USE_ICONV= yes
USE_GETTEXT= yes
PLIST_SUB= NLS=""
.else
CONFIGURE_ARGS+=--disable-nls
PLIST_SUB= NLS="@comment "
.endif
post-patch:
@${REINPLACE_CMD} 's,^\* sed:,* GNU sed:,' \
${WRKSRC}/doc/config.texi
@${REINPLACE_CMD} "s|#include <alloca.h>||" ${WRKSRC}/lib/regex_internal.h
post-configure:
.for subdir in ${PATCH_SUBDIRS}
@${REINPLACE_CMD} -e 's|s,x,x,|s,^,g,|' \
-e 's|^doc_DATA|#doc_DATA|' \
${WRKSRC}/${subdir}/Makefile
.endfor
post-install:
@${MKDIR} ${EXAMPLESDIR}
.for f in ${SAMP_FILES}
@${INSTALL_DATA} ${WRKSRC}/testsuite/${f} ${EXAMPLESDIR}
.endfor
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for f in ${PORTDOCS}
@${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
.endif
# Maintainer only
test:
@cd ${WRKSRC}/testsuite; ${MAKE} check
.include <bsd.port.post.mk>