git: ab0d5c811bbb - main - archivers/snappy: Improve port

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Sun, 07 Apr 2024 16:51:13 UTC
The branch main has been updated by diizzy:

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

commit ab0d5c811bbb3ea28b023b5d6d37871078cd100f
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2024-04-07 16:04:35 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2024-04-07 16:50:07 +0000

    archivers/snappy: Improve port
    
    * Convert from PORTVERSION to DISTVERSION
    * Define LICENSE_FILE
    * Remove CMAKE_BUILD_TYPE
    * Use = instead of += for PLIST_SUB, SUB_FILES, SUB_LIST
    * Rearrange port for better readability
    
    PR:             278228
    Reviewed by:    vanilla (maintainer)
---
 archivers/snappy/Makefile           | 24 ++++++++++++++----------
 archivers/snappy/files/snappy.pc.in |  2 +-
 archivers/snappy/pkg-plist          |  2 +-
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/archivers/snappy/Makefile b/archivers/snappy/Makefile
index 010babcbf1f4..074e745ee6dd 100644
--- a/archivers/snappy/Makefile
+++ b/archivers/snappy/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	snappy
-PORTVERSION=	1.2.0
-PORTREVISION=	0
+DISTVERSION=	1.2.0
 CATEGORIES=	archivers
 
 MAINTAINER=	vanilla@FreeBSD.org
@@ -8,22 +7,27 @@ COMMENT=	Fast compressor/decompressor library
 WWW=		https://google.github.io/snappy/
 
 LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/COPYING
 
 USES=		cmake compiler:c++11-lang cpe
-USE_LDCONFIG=	yes
-CMAKE_ON=	BUILD_SHARED_LIBS
-CMAKE_OFF=	SNAPPY_BUILD_TESTS SNAPPY_BUILD_BENCHMARKS
-CMAKE_BUILD_TYPE=	Release
 CPE_VENDOR=	google
+USE_LDCONFIG=	yes
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
-PLIST_SUB+=	PORTVERSION=${PORTVERSION}
-SUB_FILES+=	snappy.pc
-SUB_LIST+=	PORTVERSION=${PORTVERSION}
+
 PIE_UNSAFE=	yes
 
+PLIST_SUB=	DISTVERSION=${DISTVERSION}
+SUB_FILES=	snappy.pc
+SUB_LIST=	DISTVERSION=${DISTVERSION}
+
+CMAKE_OFF=	SNAPPY_BUILD_BENCHMARKS \
+		SNAPPY_BUILD_TESTS
+CMAKE_ON=	BUILD_SHARED_LIBS
+
 post-install:
-	@${STRIP_CMD} ${STAGEDIR}${LOCALBASE}/lib/libsnappy.so.${PORTVERSION}
+	@${STRIP_CMD} ${STAGEDIR}${LOCALBASE}/lib/libsnappy.so.${DISTVERSION}
 	${INSTALL_DATA} ${WRKDIR}/snappy.pc ${STAGEDIR}${LOCALBASE}/libdata/pkgconfig
 
 .include <bsd.port.mk>
diff --git a/archivers/snappy/files/snappy.pc.in b/archivers/snappy/files/snappy.pc.in
index 8957d6fc2869..1839981c155d 100644
--- a/archivers/snappy/files/snappy.pc.in
+++ b/archivers/snappy/files/snappy.pc.in
@@ -5,6 +5,6 @@ includedir=${prefix}/include
 
 Name: snappy
 Description: A fast compression/decompression library
-Version: %%PORTVERSION%%
+Version: %%DISTVERSION%%
 Libs: -L${libdir} -lsnappy
 Cflags: -I${includedir}
diff --git a/archivers/snappy/pkg-plist b/archivers/snappy/pkg-plist
index 8eca7d24cf00..2d1cdf9f8f90 100644
--- a/archivers/snappy/pkg-plist
+++ b/archivers/snappy/pkg-plist
@@ -9,5 +9,5 @@ lib/cmake/Snappy/SnappyTargets.cmake
 lib/libsnappy.a
 lib/libsnappy.so
 lib/libsnappy.so.1
-lib/libsnappy.so.%%PORTVERSION%%
+lib/libsnappy.so.%%DISTVERSION%%
 libdata/pkgconfig/snappy.pc