git: af35500586a4 - main - lang/librep: Optionize INFO

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 22 Oct 2023 14:45:20 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=af35500586a4a5de4141ef3f28e8bbd9a99eb85b

commit af35500586a4a5de4141ef3f28e8bbd9a99eb85b
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-10-22 14:44:13 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-10-22 14:45:03 +0000

    lang/librep: Optionize INFO
    
    - Pet portclippy
---
 lang/librep/Makefile | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/lang/librep/Makefile b/lang/librep/Makefile
index a260e91276e4..61d2be830e7f 100644
--- a/lang/librep/Makefile
+++ b/lang/librep/Makefile
@@ -16,27 +16,42 @@ LIB_DEPENDS=	libgdbm.so:databases/gdbm \
 		libgmp.so:math/gmp
 RUN_DEPENDS=	gtar:archivers/gtar
 
+USES=		autoreconf gettext gmake libtool localbase:ldflags \
+		pathfix pkgconfig readline shebangfix tar:xz
 USE_CSTD=	gnu89
+USE_LDCONFIG=	yes
 
-USES=		autoreconf gettext gmake libtool makeinfo pathfix pkgconfig readline \
-		shebangfix tar:xz
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--with-aclocaldir=${PREFIX}/share/aclocal \
-		--with-stack-direction=-1
 SHEBANG_FILES=	${WRKSRC}/src/rep-xgettext.jl
 SHEBANG_LANG=	rep
 rep_OLD_CMD=	/usr/bin/rep
 rep_CMD?=	${PREFIX}/bin/rep
-USE_LDCONFIG=	yes
 
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib -pthread
+GNU_CONFIGURE=	yes
+CONFIGURE_ARGS=	--with-aclocaldir=${PREFIX}/share/aclocal \
+		--with-stack-direction=-1
+
+LDFLAGS+=	-pthread
+
+OPTION_DEFINE=	INFO
+OPTION_DEFAULT=	INFO
 
-INFO=		librep
+INFO_USES=		makeinfo
+INFO_INFO=		librep
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|share/man|man|' ${WRKSRC}/man/Makefile.in
 	@${REINPLACE_CMD} -E 's|(INSTALL_PROGRAM\))( [^-])|\1 -m 755\2|' \
 		${WRKSRC}/src/Makefile.in
+	@${REINPLACE_CMD} -e '/SUBDIRS/s|man||' ${WRKSRC}/Makefile.in
+
+post-build-INFO-on:
+	cd ${WRKSRC}/man && \
+		makeinfo --no-split  -I . librep.texi -o librep.info
+
+post-install:
+	${INSTALL_MAN} ${WRKSRC}/man/*.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
+
+post-install-INFO-on:
+	${INSTALL_DATA} ${WRKSRC}/docs/librep.info ${STAGEDIR}${PREFIX}/${INFO_PATH}
 
 .include <bsd.port.mk>