git: d64a3318ae18 - main - databases/freetds-devel: Refactor

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Fri, 12 Jan 2024 22:46:59 UTC
The branch main has been updated by bofh:

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

commit d64a3318ae18425f85039cac140b800888d9f423
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2024-01-12 12:05:11 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2024-01-12 22:37:13 +0000

    databases/freetds-devel: Refactor
    
    - Skip USES=autoreconf as we have configure scripts
    - Sanitize MAN path
---
 databases/freetds-devel/Makefile                   | 22 ++++++++++++----------
 .../freetds-devel/files/patch-src_tds_Makefile.in  | 11 -----------
 databases/freetds-devel/pkg-plist                  | 18 +++++++++---------
 3 files changed, 21 insertions(+), 30 deletions(-)

diff --git a/databases/freetds-devel/Makefile b/databases/freetds-devel/Makefile
index e1de65e8baad..3435db30efea 100644
--- a/databases/freetds-devel/Makefile
+++ b/databases/freetds-devel/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	freetds
 PORTVERSION=	1.4.144
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	databases
 MASTER_SITES=	https://www.freetds.org/files/current/ \
@@ -13,16 +14,18 @@ WWW=		http://www.freetds.org/
 
 LICENSE=	LGPL20
 
-USES=		autoreconf compiler:c11 cpe gettext-tools gmake iconv \
+USES=		compiler:c11 cpe gettext-tools gmake iconv \
 	libtool:keepla localbase:ldflags pkgconfig tar:bzip2
 USE_LDCONFIG=	yes
 
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--docdir=${DOCSDIR} \
+HAS_CONFIGURE=	yes
+CONFIGURE_ARGS+=	--prefix=${PREFIX} \
+		--docdir=${DOCSDIR} \
 		--enable-msdblib \
 		--enable-sybase-compat \
 		--sysconfdir=${ETCDIR} \
-		--with-tdsver=${TDS_VER}
+		--with-tdsver=${TDS_VER} \
+		--mandir=${PREFIX}/share/man
 
 INSTALL_TARGET=	install-strip
 
@@ -69,15 +72,14 @@ post-extract:
 post-patch:
 	@${REINPLACE_CMD} -e 's|libgnutls-config|pkg-config gnutls|g' \
 		${WRKSRC}/configure
-	@${FIND} ${WRKSRC} -name "Makefile.am" | ${XARGS} ${REINPLACE_CMD} -e \
-		's|/pool.conf|/pool.conf.sample|g ; \
-		 s| common.h||g ; \
-		 s|%%DOCSDIR%%|${STAGEDIR}${DOCSDIR}|g ; \
-		 s|%%ICONV_LIB%%|${ICONV_LIB}|'
+	@${REINPLACE_CMD} -e 's|/pool.conf|/pool.conf.sample|g' \
+		${WRKSRC}/src/pool/Makefile.in
 	@${REINPLACE_CMD} -e 's|/freetds.conf|/freetds.conf.sample|g ; \
-		 s|/locales.conf|/locales.conf.sample|g' ${WRKSRC}/Makefile.am
+		s|/locales.conf|/locales.conf.sample|g' ${WRKSRC}/Makefile.in
 	@${REINPLACE_CMD} -e 's|$$ODBC_INC/isql.h|$$ODBC_INC/libiodbc/isql.h|g ; \
 		s|$$ODBC_INC/isqlext.h|$$ODBC_INC/libiodbc/isqlext.h|g' ${WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|@LIBS@|@LIBS@ ${ICONV_LIB}|g' \
+		${WRKSRC}/src/tds/Makefile.in
 
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/interfaces ${STAGEDIR}${ETCDIR}/interfaces.sample
diff --git a/databases/freetds-devel/files/patch-src_tds_Makefile.in b/databases/freetds-devel/files/patch-src_tds_Makefile.in
deleted file mode 100644
index ee7e9d3d1888..000000000000
--- a/databases/freetds-devel/files/patch-src_tds_Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/tds/Makefile.in.orig	2015-05-24 09:01:31 UTC
-+++ src/tds/Makefile.in
-@@ -297,7 +297,7 @@ LIBADD_DLOPEN = @LIBADD_DLOPEN@
- LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
- LIBICONV = @LIBICONV@
- LIBOBJS = @LIBOBJS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ %%ICONV_LIB%%
- LIBTOOL = @LIBTOOL@
- LIPO = @LIPO@
- LN_S = @LN_S@
diff --git a/databases/freetds-devel/pkg-plist b/databases/freetds-devel/pkg-plist
index a0980bcb75a6..b0eb285899d0 100644
--- a/databases/freetds-devel/pkg-plist
+++ b/databases/freetds-devel/pkg-plist
@@ -21,15 +21,15 @@ include/syberror.h
 include/sybfront.h
 include/tds_sysdep_public.h
 include/odbcss.h
-man/man1/datacopy.1.gz
-man/man1/freebcp.1.gz
-man/man1/tsql.1.gz
-man/man1/bsqldb.1.gz
-man/man1/bsqlodbc.1.gz
-man/man1/defncopy.1.gz
-man/man1/fisql.1.gz
-man/man1/osql.1.gz
-man/man5/freetds.conf.5.gz
+share/man/man1/datacopy.1.gz
+share/man/man1/freebcp.1.gz
+share/man/man1/tsql.1.gz
+share/man/man1/bsqldb.1.gz
+share/man/man1/bsqlodbc.1.gz
+share/man/man1/defncopy.1.gz
+share/man/man1/fisql.1.gz
+share/man/man1/osql.1.gz
+share/man/man5/freetds.conf.5.gz
 lib/libct.a
 lib/libct.la
 lib/libct.so