Bug 228177 - databases/postgresql*-server: CONFLICT installation with databases/postgresql-jdbc
Summary: databases/postgresql*-server: CONFLICT installation with databases/postgresql...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: pgsql
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-11 22:42 UTC by Vladimir Druzenko
Modified: 2018-08-09 21:33 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (pgsql)
vvd: maintainer-feedback?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Druzenko freebsd_committer freebsd_triage 2018-05-11 22:42:50 UTC
Incorrect wildcard in definition of the CONFLICTS variable in ports Makefile.

diff -u Makefile.orig Makefile
--- Makefile.orig
+++ Makefile
@@ -14,9 +14,9 @@
 LICENSE=       PostgreSQL
 
 .if ${DISTVERSION:C/([0-9]*).*/\1/} == 10
-CONFLICTS+=    ${PORTNAME}*-9.*
+CONFLICTS+=    ${PORTNAME}[^-]*-9.*
 .else
-CONFLICTS+=    ${PORTNAME}*-9.[^${PORTVERSION:R:E}].* ${PORTNAME}10*
+CONFLICTS+=    ${PORTNAME}[^-]*-9.[^${PORTVERSION:R:E}].* ${PORTNAME}10*
 .endif
 
 WRKSRC=             ${WRKDIR}/postgresql-${DISTVERSION}
Comment 1 Palle Girgensohn freebsd_committer freebsd_triage 2018-05-11 23:57:04 UTC
Hmm, true. The reaseon for this match is that once upon a time, the packages had no suffix. It was postgresql-server-8.4.1 for example.

But I guess this is so way back we don't have to bother?

Palle
Comment 2 Palle Girgensohn freebsd_committer freebsd_triage 2018-05-12 00:00:46 UTC
When not taking the ancient packge names in to account, wouldn't this suffice:

Index: Makefile
===================================================================
--- Makefile	(revision 469638)
+++ Makefile	(working copy)
@@ -14,9 +14,9 @@
 LICENSE=	PostgreSQL
 
 .if ${DISTVERSION:C/([0-9]*).*/\1/} == 10
-CONFLICTS+=	${PORTNAME}*-9.*
+CONFLICTS+=	${PORTNAME}9*
 .else
-CONFLICTS+=	${PORTNAME}*-9.[^${PORTVERSION:R:E}].* ${PORTNAME}10*
+CONFLICTS+=	${PORTNAME}9[^${PORTVERSION:R:E}]* ${PORTNAME}10*
 .endif
 
 WRKSRC=		${WRKDIR}/postgresql-${DISTVERSION}
Comment 3 Palle Girgensohn freebsd_committer freebsd_triage 2018-05-12 09:37:18 UTC
Another work-around would be to upgrade the postgresql-jdbc to a fresh version. I realize that this port has not got the live it deserves lately.

I'm on holiday for a week+ so I will not have the opportunity to do that. Any takers at @pgsql?

Palle
Comment 4 Palle Girgensohn freebsd_committer freebsd_triage 2018-05-12 09:39:24 UTC
I got this far, but it requires Maven instead of ant, and of course fetches a bunch of dependencies. Don't really know how to best handle that "in-build fetching" in FreeBSD ports.

Index: Makefile
===================================================================
--- Makefile	(revision 468925)
+++ Makefile	(working copy)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	postgresql
-PORTVERSION=	9.2.1004
+PORTVERSION=	42.2.2
 DISTVERSIONSUFFIX=.src
 CATEGORIES=	databases java
 MASTER_SITES=	http://jdbc.postgresql.org/download/
@@ -15,7 +15,7 @@
 LICENSE=	BSD3CLAUSE
 
 DIST_SUBDIR=	postgresql
-
+WRKSRC=		${WRKDIR}/${PKGNAME:C/\.([0-9]*)$/-\1/}${DISTVERSIONSUFFIX}
 USE_ANT=	yes
 USE_JAVA=	yes
 NO_ARCH=	yes
@@ -28,14 +28,11 @@
 OPTIONS_DEFINE=	DOCS
 OPTIONS_SUB=	yes
 
-post-patch:
-	${REINPLACE_CMD} 's,/usr/local/pgsql/share/java,${JAVAJARDIR},' ${WRKSRC}/README
-
 do-install:
 	${INSTALL_DATA} ${WRKSRC}/jars/postgresql.jar ${STAGEDIR}${JAVAJARDIR}/postgresql.jar
 
 do-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}
-	${INSTALL_DATA} ${WRKSRC}/README ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
--- distinfo	(revision 468925)
+++ distinfo	(working copy)
@@ -1,2 +1,3 @@
-SHA256 (postgresql/postgresql-jdbc-9.2-1004.src.tar.gz) = eeadff0d830cd19a4f52a9489748a7126b0c1d4863bf9a5d65618158dfc6ae68
-SIZE (postgresql/postgresql-jdbc-9.2-1004.src.tar.gz) = 1842921
+TIMESTAMP = 1526114440
+SHA256 (postgresql/postgresql-jdbc-42.2.2.src.tar.gz) = 978595175cb2b563de35a39d5c88686ecebadaa685a016a9f85085b606f82740
+SIZE (postgresql/postgresql-jdbc-42.2.2.src.tar.gz) = 1400870
Comment 5 Vladimir Druzenko freebsd_committer freebsd_triage 2018-05-12 16:32:11 UTC
(In reply to Palle Girgensohn from comment #4)
> it requires Maven instead of ant, and of course fetches a bunch of dependencies. Don't really know how to best handle that "in-build fetching" in FreeBSD ports.
Try to set path for ~/.m2 to ${WRKSRC}/.m2.
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2018-05-12 16:39:24 UTC
Not maven home, but maven local repository:
mvn GOAL -Dmaven.repo.local=${WRKDIR}
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2018-05-16 23:41:39 UTC
(In reply to Palle Girgensohn from comment #2)
Commit, plz, this patch as workaround before testing of the port with 42.2 version.
Comment 8 Palle Girgensohn freebsd_committer freebsd_triage 2018-08-09 21:33:24 UTC
I'm closing this PR since the conflict variables where corrected a while back.

Upgrading postgresql-jdbc is a separate issue,