git: 0d2be8be7756 - main - net/vnstat: Clean up Makefile

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Mon, 04 Sep 2023 09:10:15 UTC
The branch main has been updated by sunpoet:

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

commit 0d2be8be7756ac12b3994caad320f1e11e7a231b
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-04 09:06:21 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-04 09:06:21 +0000

    net/vnstat: Clean up Makefile
    
    - Use INSTALL_TARGET=install-exec to install the binary executables
    - Use GNU_CONFIGURE_MANPREFIX and INSTALL_TARGET=install-man to install the manpages
    - Use USES=localbase and CONFIGURE_ARGS=--disable-extra-paths to support non-default LOCALBASE
    - Add CONFIGURE_ARGS=--disable-image-output when GUI option is disabled
    - Bump PORTREVISION for package change
    
    PR:             273231
---
 net/vnstat/Makefile | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile
index 40efe7d77022..eaac4e5db61c 100644
--- a/net/vnstat/Makefile
+++ b/net/vnstat/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	vnstat
 PORTVERSION=	2.11
+PORTREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	https://github.com/vergoh/vnstat/releases/download/v${PORTVERSION}/ \
 		https://humdi.net/vnstat/
@@ -11,9 +12,12 @@ WWW=		https://humdi.net/vnstat/ \
 
 LICENSE=	GPLv2
 
-USES=		sqlite
+USES=		localbase sqlite
 
+CONFIGURE_ARGS=	--disable-extra-paths
 GNU_CONFIGURE=	yes
+GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
+INSTALL_TARGET=	install-exec install-man
 USE_RC_SUBR=	vnstat
 
 USERS=		vnstat
@@ -29,19 +33,11 @@ OPTIONS_DEFAULT=GUI
 OPTIONS_SUB=	yes
 GUI_DESC=	Build with graphics/gd dependency
 
+GUI_CONFIGURE_OFF=	--disable-image-output
 GUI_LIB_DEPENDS=	libgd.so:graphics/gd
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/vnstat ${STAGEDIR}${PREFIX}/bin/vnstat
+post-install:
 	${INSTALL_DATA} ${WRKSRC}/cfg/vnstat.conf ${STAGEDIR}${PREFIX}/etc/vnstat.conf.sample
-	${INSTALL_PROGRAM} ${WRKSRC}/vnstatd ${STAGEDIR}${PREFIX}/sbin/vnstatd
-	${INSTALL_MAN} ${WRKSRC}/man/vnstat.1 ${STAGEDIR}${PREFIX}/share/man/man1/vnstat.1
-	${INSTALL_MAN} ${WRKSRC}/man/vnstat.conf.5 ${STAGEDIR}${PREFIX}/share/man/man5/vnstat.conf.5
-	${INSTALL_MAN} ${WRKSRC}/man/vnstatd.8 ${STAGEDIR}${PREFIX}/share/man/man8/vnstatd.8
-
-do-install-GUI-on:
-	${INSTALL_PROGRAM} ${WRKSRC}/vnstati ${STAGEDIR}${PREFIX}/bin/vnstati
-	${INSTALL_MAN} ${WRKSRC}/man/vnstati.1 ${STAGEDIR}${PREFIX}/share/man/man1/vnstati.1
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}