From 32d85c6ad2d68d899090c21cd2352b657ea78d33 Mon Sep 17 00:00:00 2001 From: Pawel Pekala Date: Fri, 20 Dec 2013 18:21:04 +0000 Subject: [PATCH] - Support CC/CFLAGS properly - Add LICENSE - Support staging PR: ports/184873 Submitted by: KATO Tsuguru --- textproc/tdhkit/Makefile | 83 ++++++++++------------------ textproc/tdhkit/files/patch-Makefile | 11 ---- textproc/tdhkit/pkg-plist | 15 ++++- 3 files changed, 42 insertions(+), 67 deletions(-) delete mode 100644 textproc/tdhkit/files/patch-Makefile diff --git a/textproc/tdhkit/Makefile b/textproc/tdhkit/Makefile index a8a58692cc28..caed3fe35086 100644 --- a/textproc/tdhkit/Makefile +++ b/textproc/tdhkit/Makefile @@ -10,65 +10,40 @@ DISTNAME= ${PORTNAME}${PORTVERSION:C/\.//1} MAINTAINER= ports@FreeBSD.org COMMENT= Set of programs for working with tabular ASCII data -OPTIONS_DEFINE= LIBCHRON DOCS -LIBCHRON_DESC= Install libchron +LICENSE= GPLv2 # (or later) -NO_STAGE= yes -.include +OPTIONS_DEFINE= CHRON DOCS +OPTIONS_SUB= yes +CHRON_DESC= Install libchron -.if ${PORT_OPTIONS:MLIBCHRON} -PLIST_SUB+= LIBCHRON="" -.else -PLIST_SUB+= LIBCHRON="@comment " -.endif +BUILD_WRKSRC= ${WRKSRC}/src -.if !defined(NO_INSTALL_MANPAGES) -MAN1= dateconvert.1 \ - fldfmt.1 \ - fldmap.1 \ - fldsel.1 \ - pjoin.1 \ - recsel.1 \ - tabo.1 \ - tdhfunction.1 \ - xlcells.1 \ - xlcleaner.1 +post-patch: + @${REINPLACE_CMD} -e \ + 's|^CFLAGS =|CFLAGS +=|' \ + ${WRKSRC}/libsrc/Makefile + @${REINPLACE_CMD} -e \ + 's|^CFLAGS =|CFLAGS +=| ; \ + s|^CC =|CC ?=| ; \ + /^all:/s|recsel fldsel|recsel fldmap fldsel|' \ + ${BUILD_WRKSRC}/Makefile -.if ${PORT_OPTIONS:MLIBCHRON} -MAN3= libchron.3 -.endif -MANCOMPRESSED= no -.endif - -do-build: - cd ${WRKSRC}/libsrc && ${SETENV} ${MAKE_ENV} \ - ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} - cd ${WRKSRC}/src && ${SETENV} ${MAKE_ENV} \ - ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} -.if ${PORT_OPTIONS:MLIBCHRON} - cd ${WRKSRC}/libsrc && ${SETENV} ${MAKE_ENV} \ - ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} libchron -.endif +pre-build: + @(cd ${WRKSRC}/libsrc && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \ + ${MAKE_FLAGS} ${MAKEFILE} -j${MAKE_JOBS_NUMBER} \ + ${MAKE_ARGS} default libchron) do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${PREFIX}/bin - -.if ${PORT_OPTIONS:MLIBCHRON} - ${INSTALL_PROGRAM} ${WRKSRC}/libchron.a ${PREFIX}/lib -.endif - -.if !defined(NO_INSTALL_MANPAGES) -.for manpage in ${MAN1} - ${INSTALL_MAN} ${WRKSRC}/man/mantdh/${manpage} ${MAN1PREFIX}/man/man1 -.endfor -.if ${PORT_OPTIONS:MLIBCHRON} - ${INSTALL_MAN} ${WRKSRC}/man/mantdh/${MAN3} ${MAN3PREFIX}/man/man3 -.endif -.endif - -.if ${PORT_OPTIONS:MDOCS} - ${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/man/html/* ${DOCSDIR} -.endif + (cd ${WRKSRC}/bin && ${INSTALL_PROGRAM} * \ + ${STAGEDIR}${PREFIX}/bin) + (cd ${WRKSRC} && ${INSTALL_DATA} libchron.a \ + ${STAGEDIR}${PREFIX}/lib) + (cd ${WRKSRC}/man/mantdh && ${INSTALL_MAN} *.1 \ + ${STAGEDIR}${MAN1PREFIX}/man/man1) + (cd ${WRKSRC}/man/mantdh && ${INSTALL_MAN} *.3 \ + ${STAGEDIR}${MAN3PREFIX}/man/man3) + @${MKDIR} ${STAGEDIR}${DOCSDIR} + (cd ${WRKSRC}/man/html && ${INSTALL_DATA} * \ + ${STAGEDIR}${DOCSDIR}) .include diff --git a/textproc/tdhkit/files/patch-Makefile b/textproc/tdhkit/files/patch-Makefile deleted file mode 100644 index 08fae082c7e9..000000000000 --- a/textproc/tdhkit/files/patch-Makefile +++ /dev/null @@ -1,11 +0,0 @@ ---- src/Makefile.orig 2010-03-02 15:09:45.000000000 -0800 -+++ src/Makefile 2010-03-02 15:10:08.000000000 -0800 -@@ -6,7 +6,7 @@ - CC = gcc - - --all: recsel fldsel fldfmt pjoin tabo dateconvert tdhfunction xlcleaner xlcells -+all: recsel fldmap fldsel fldfmt pjoin tabo dateconvert tdhfunction xlcleaner xlcells - - - # FLDMAP - diff --git a/textproc/tdhkit/pkg-plist b/textproc/tdhkit/pkg-plist index 75057e1ab505..eecae3961331 100644 --- a/textproc/tdhkit/pkg-plist +++ b/textproc/tdhkit/pkg-plist @@ -8,7 +8,18 @@ bin/tabo bin/tdhfunction bin/xlcells bin/xlcleaner -%%LIBCHRON%%lib/libchron.a +%%CHRON%%lib/libchron.a +man/man1/dateconvert.1.gz +man/man1/fldfmt.1.gz +man/man1/fldmap.1.gz +man/man1/fldsel.1.gz +man/man1/pjoin.1.gz +man/man1/recsel.1.gz +man/man1/tabo.1.gz +man/man1/tdhfunction.1.gz +man/man1/xlcells.1.gz +man/man1/xlcleaner.1.gz +man/man3/libchron.3.gz %%PORTDOCS%%%%DOCSDIR%%/Copyright.html %%PORTDOCS%%%%DOCSDIR%%/commalist.html %%PORTDOCS%%%%DOCSDIR%%/condex.html @@ -32,4 +43,4 @@ bin/xlcleaner %%PORTDOCS%%%%DOCSDIR%%/times.html %%PORTDOCS%%%%DOCSDIR%%/xlcells.1.html %%PORTDOCS%%%%DOCSDIR%%/xlcleaner.1.html -%%PORTDOCS%%@dirrm %%DOCSDIR%% +%%PORTDOCS%%@dirrmtry %%DOCSDIR%%