From girgen@rambutan.pingpong.net  Thu Jan  9 07:17:40 2003
Return-Path: <girgen@rambutan.pingpong.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 491DE37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Jan 2003 07:17:40 -0800 (PST)
Received: from rambutan.pingpong.net (81.milagro.bahnhof.net [195.178.168.81])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F023A43F5B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  9 Jan 2003 07:17:37 -0800 (PST)
	(envelope-from girgen@rambutan.pingpong.net)
Received: from rambutan.pingpong.net (localhost [127.0.0.1])
	by rambutan.pingpong.net (8.12.6/8.12.6) with ESMTP id h09FHVO8082226
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 9 Jan 2003 16:17:31 +0100 (CET)
	(envelope-from girgen@rambutan.pingpong.net)
Received: (from girgen@localhost)
	by rambutan.pingpong.net (8.12.6/8.12.6/Submit) id h09FHV1H082225;
	Thu, 9 Jan 2003 16:17:31 +0100 (CET)
Message-Id: <200301091517.h09FHV1H082225@rambutan.pingpong.net>
Date: Thu, 9 Jan 2003 16:17:31 +0100 (CET)
From: Palle Girgensohn <girgen@pingpong.net>
Reply-To: Palle Girgensohn <girgen@pingpong.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: postgresql fixes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46894
>Category:       ports
>Synopsis:       postgresql fixes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    seanc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 09 07:20:06 PST 2003
>Closed-Date:    Thu Feb 06 11:52:16 PST 2003
>Last-Modified:  Thu Feb 06 11:52:16 PST 2003
>Originator:     Palle Girgensohn
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
PING PONG
>Environment:
System: FreeBSD rambutan.pingpong.net 4.7-RELEASE FreeBSD 4.7-RELEASE #11: Wed Oct 9 18:35:14 CEST 2002 girgen@tomat.pingpong.net:/usr/obj/usr/src/sys/WORKSTATION i386


	
>Description:
Fix some problems/quirks with the PostgreSQL port after the 7.3.1 commit

- Don't download unused distfiles.
  This was mistakenly added by the comitter.

- shell commands must be in a target, so move the echoes for kerberos
  into pre-everything. This error propagated from the postgresql-devel
  port.
  Submitted by: Craig Boston <craig@olyun.gank.org>

- the comitter added extra knobs for debug & strip, but they didn't
  quite work as expected. I hereby remove the stripping altogether, it
  simplifies the logic, and doesn't do much good anyway. This also fix
  so WITH_DEBUG actually works. Before, binaries where stripped
  anyway...

If still possible, this should go into the 5.0 release. (is it still a
moving target, by moving the cvs tags, or are the CDs burned already?)

	
>How-To-Repeat:
	
>Fix:

	

*Don't* bump PORTREVISION, please, the installed stuff is practically
identical.

Index: Makefile
===================================================================
RCS file: /misc/ncvs/ports/databases/postgresql7/Makefile,v
retrieving revision 1.104
diff -u -r1.104 Makefile
--- Makefile	4 Jan 2003 12:18:54 -0000	1.104
+++ Makefile	9 Jan 2003 15:01:38 -0000
@@ -24,9 +24,7 @@
 		ftp://ftp.postgresql.org/pub/%SUBDIR%/
 MASTER_SITE_SUBDIR=	source/v${PORTVERSION}
 DISTFILES=	postgresql-base-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-opt-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-test-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-docs-${PORTVERSION}${EXTRACT_SUFX}
+		postgresql-opt-${PORTVERSION}${EXTRACT_SUFX}
 
 MAINTAINER?=	girgen@pingpong.net
 
@@ -65,20 +63,10 @@
 CFLAGS+= -O3 -funroll-loops
 .endif
 
-.if defined(WITH_DEBUG) && defined(WITH_STRIPBIN)
-	@${ECHO} "WITH_DEBUG and WITH_STRIPBIN are mutually exclusive tunables."
-	@${ECHO} "Please choose one or the other."
-	@exit ${FALSE}
-.endif
-
 .if defined(WITH_DEBUG)
 CONFIGURE_ARGS+=	--enable-debug
 .endif
 
-.if defined(WITH_STRIPBIN)
-INSTALL_TARGET=	install-strip
-.endif
-
 .if !defined(WITHOUT_SSL)
 USE_OPENSSL=	yes
 CONFIGURE_ARGS+= "--with-openssl=${OPENSSLBASE}"
@@ -89,35 +77,17 @@
 PLIST_SUB+=	SERVER="@comment "
 PKGNAMESUFFIX=	-client
 .else
-SERVERBINARIES+=	postgres
 PLIST_SUB+=	SERVER=""
 INSTALL_TARGET=	install install-all-headers
 .endif
 
-.if defined(WITH_MIT_KRB5) && defined(WITH_HEIMDAL_KRB5)
-	@${ECHO} "WITH_MIT_KRB5 and WITH_HEIMDAL_KRB5 are mutually exclusive."
-	@${ECHO} "Please choose one or the other."
-	@exit 1
-.endif
-
 .if defined(WITH_MIT_KRB5)
 KRB5CONF=	${LOCALBASE}/bin/krb5-config
-.if !exists(${KRB5CONFIG})
-	@${ECHO} "Unable to find krb5-config in your local base, please verify that"
-	@${ECHO} "security/krb5 is installed or undefine the WITH_MIT_KRB5 tunable."
-	@exit 1
-.endif
 WITH_KRB5=	yes
 .endif
 
 .if defined(WITH_HEIMDAL_KRB5)
 KRB5CONF=	/usr/bin/krb5-config
-.if !exists(${KRB5CONFIG})
-	@${ECHO} "Unable to find krb5-config in the base system.  Undefine"
-	@${ECHO} "WITH_HEIMDAL_KRB5 or add MAKE_KERBEROS5=yes to /etc/make.conf"
-	@${ECHO} "and remake world (or undefine the WITH_HEIMDAL_KRB5 tunable)."
-	@exit 1
-.endif
 LIB_DEPENDS+=	krb5.3:${PORTSDIR}/security/krb5
 WITH_KRB5=	yes
 .endif
@@ -171,8 +141,23 @@
 	@${ECHO} "	WITH_HEIMDAL_KRB5	Builds with Heimdal's kerberos support"
 	@${ECHO} "	WITH_OPTIMIZED_CFLAGS	Builds with compiler optimizations (-O3)"
 	@${ECHO} "	WITH_DEBUG		Builds with debugging symbols"
-	@${ECHO} "	WITH_STRIPBIN		Installs stripped binaries"
 	@${ECHO} ""
+.if defined(WITH_MIT_KRB5) && defined(WITH_HEIMDAL_KRB5)
+	@${ECHO} "WITH_MIT_KRB5 and WITH_HEIMDAL_KRB5 are mutually exclusive."
+	@${ECHO} "Please choose one or the other."
+	@exit 1
+.endif
+.if defined(WITH_MIT_KRB5) && !exists(${KRB5CONFIG})
+	@${ECHO} "Unable to find krb5-config in your local base, please verify that"
+	@${ECHO} "security/krb5 is installed or undefine the WITH_MIT_KRB5 tunable."
+	@exit 1
+.endif
+.if defined(WITH_HEIMDAL_KRB5) && !exists(${KRB5CONFIG})
+	@${ECHO} "Unable to find krb5-config in the base system.  Undefine"
+	@${ECHO} "WITH_HEIMDAL_KRB5 or add MAKE_KERBEROS5=yes to /etc/make.conf"
+	@${ECHO} "and remake world (or undefine the WITH_HEIMDAL_KRB5 tunable)."
+	@exit 1
+.endif
 
 .if defined(WITHOUT_SERVER)
 do-install:
@@ -192,14 +177,7 @@
 	${CAT} ${FILESDIR}/post-install-notes ${PKGMESSAGE} |\
 		${SED} "s|/usr/local|${PREFIX}|g" |\
 		tee ${PREFIX}/share/postgresql/post-install-notes
-.if !defined(DEBUG_FLAGS)
-.for file in ecpg pg_dump pg_id pg_restore psql ${SERVERBINARIES}
-	@ strip ${PREFIX}/bin/${file}
-.endfor
-.endif
 .if !defined(WITHOUT_SERVER)
-# install shell defaults for pgsql user
-	@ strip ${PREFIX}/bin/postgres
 .for i in profile cshrc
 	@ ${SED} "s|%%PREFIX%%|${PREFIX}|g" \
 		< ${FILESDIR}/dot.$i.in \
>Release-Note:
>Audit-Trail:
Use ${STRIP_CMD}.

The -doc distfile is needed for databases/postgresql-doc.  Ideally the
-doc port should download the doc tarball and the check target should
download the -test tarball when needed.  -opt is needed for a pgcrypto
port that I'm working on... all should be conditionally downloaded but
aren't at the moment.

Is the install-strip not behaving correctly or is install the same as
install-strip?
Responsible-Changed-From-To: freebsd-ports->seanc 
Responsible-Changed-By: seanc 
Responsible-Changed-When: Fri Jan 10 13:13:29 PST 2003 
Responsible-Changed-Why:  
I'll grab this one since I did the last update. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46894 

From: Palle Girgensohn <girgen@pingpong.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc: seanc@FreeBSD.org
Subject: Re: ports/46894: postgresql fixes
Date: Tue, 14 Jan 2003 17:24:53 +0100

 Hi Sean,
 
 > Use ${STRIP_CMD}.
 ..
 > Is the install-strip not behaving correctly or is install the same as
 > install-strip?
 
 The install-strip works OK, but all it really does is save ~100 KB of disk 
 space. AFAIK it doesn't make postgresql any faster, and maintaining the 
 WITH_STRIP *and* WITH_DEBUG unnecessarily adds too much complexity to the 
 port, IMHO. Since there seems to be a need for WITH_DEBUG, and since it is 
 mutually exclusive to stripping binaries, I'd rather remove the stripping 
 logic. It really hardly serves any purpose.
 
 The way it is in the cvs repository right now, the stripping is always done 
 (not using ${STRIP_CMD}, but rather `strip', which of course is wrong), and 
 the INSTALL_TARGET=install-strip is overridden further down the file. So, 
 right now it is somewhat defunctional...
 
 > The -doc distfile is needed for databases/postgresql-doc.  Ideally the
 > -doc port should download the doc tarball and the check target should
 > download the -test tarball when needed.  -opt is needed for a pgcrypto
 > port that I'm working on... all should be conditionally downloaded but
 > aren't at the moment.
 
 Well the docs are downloaded from the docs port:
 postgresql-docs/Makefile:
 ...
 DISTFILES=      postgresql-docs-${PORTVERSION}${EXTRACT_SUFX}
 ...
 
 Works fine for me:
 postgresql-docs$ make
 >> postgresql-docs-7.3.1.tar.gz doesn't seem to exist in 
 /usr/ports/distfiles/postgresql.
 >> Attempting to fetch from 
 ftp://ftp.sunet.se/pub/unix/databases/relational/postgresql/source/v7.3.1/.
 Receiving postgresql-docs-7.3.1.tar.gz (2638418 bytes): 14%^C
 382704 bytes transferred in 2.5 seconds (148.97 kBps)
 ...
 
 In fact, adding the distfile to the main port actually makes the port 
 install all the postgresql docs right into $PREFIX/share! I already had 
 complaints about the plist lacking the docs, which confused me at first... 
 :(  So, the -docs distfile has to be removed from the Makefile. The port 
 has no check target, and I don't think it should. The -opt tarball is 
 needed for the default interfaces and languages, so it should be in the 
 main port's Makefile.
 
 /Palle
 

From: Palle Girgensohn <girgen@pingpong.net>
To: freebsd-gnats-submit@FreeBSD.org, girgen@pingpong.net,
	ports@FreeBSD.org, seanc@FreeBSD.org
Cc:  
Subject: Re: ports/46894: postgresql fixes
Date: Tue, 21 Jan 2003 15:52:37 +0100

 Hi!
 
 Could someone please commit this PR?
 
 Thanks
 Palle
 

From: Sean Chittenden <sean@chittenden.org>
To: freebsd-gnats-submit@FreeBSD.org, girgen@pingpong.net
Subject: Re: ports/46894: postgresql fixes
Date: Fri, 24 Jan 2003 15:21:00 +0800

 Howdy.  Can you look at this patch and see if it looks okay?  I think this
 reduces the complexity of the port some and retains the previous
 ability to strip the libs/binaries.  Please let me know if this patch is
 okay to commit.  Thanks and sorry I haven't gotten to this sooner.

 Have you considered splitting the WITHOUT_SERVER component into an actual
 postgresql7-(client|server) port?  This would reduce the greatest amount of
 complexity from this Makefile.

 -sc

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/databases/postgresql7/Makefile,v
retrieving revision 1.105
diff -u -r1.105 Makefile
--- Makefile	14 Jan 2003 17:00:24 -0000	1.105
+++ Makefile	24 Jan 2003 23:57:00 -0000
@@ -24,9 +24,7 @@
 		ftp://ftp.postgresql.org/pub/%SUBDIR%/
 MASTER_SITE_SUBDIR=	source/v${PORTVERSION}
 DISTFILES=	postgresql-base-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-opt-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-test-${PORTVERSION}${EXTRACT_SUFX} \
-		postgresql-docs-${PORTVERSION}${EXTRACT_SUFX}
+		postgresql-opt-${PORTVERSION}${EXTRACT_SUFX}
 
 MAINTAINER?=	girgen@pingpong.net
 
@@ -75,10 +73,6 @@
 CONFIGURE_ARGS+=	--enable-debug
 .endif
 
-.if defined(WITH_STRIPBIN)
-INSTALL_TARGET=	install-strip
-.endif
-
 .if !defined(WITHOUT_SSL)
 USE_OPENSSL=	yes
 CONFIGURE_ARGS+= "--with-openssl=${OPENSSLBASE}"
@@ -89,35 +83,22 @@
 PLIST_SUB+=	SERVER="@comment "
 PKGNAMESUFFIX=	-client
 .else
-SERVERBINARIES+=	postgres
 PLIST_SUB+=	SERVER=""
-INSTALL_TARGET=	install install-all-headers
+INSTALL_TARGET=	install-all-headers
+.if defined(WITH_STRIPBIN)
+INSTALL_TARGET+=	install-strip
+.else
+INSTALL_TARGET+=	install
 .endif
-
-.if defined(WITH_MIT_KRB5) && defined(WITH_HEIMDAL_KRB5)
-	@${ECHO} "WITH_MIT_KRB5 and WITH_HEIMDAL_KRB5 are mutually exclusive."
-	@${ECHO} "Please choose one or the other."
-	@exit 1
 .endif
 
 .if defined(WITH_MIT_KRB5)
 KRB5CONF=	${LOCALBASE}/bin/krb5-config
-.if !exists(${KRB5CONFIG})
-	@${ECHO} "Unable to find krb5-config in your local base, please verify that"
-	@${ECHO} "security/krb5 is installed or undefine the WITH_MIT_KRB5 tunable."
-	@exit 1
-.endif
 WITH_KRB5=	yes
 .endif
 
 .if defined(WITH_HEIMDAL_KRB5)
 KRB5CONF=	/usr/bin/krb5-config
-.if !exists(${KRB5CONFIG})
-	@${ECHO} "Unable to find krb5-config in the base system.  Undefine"
-	@${ECHO} "WITH_HEIMDAL_KRB5 or add MAKE_KERBEROS5=yes to /etc/make.conf"
-	@${ECHO} "and remake world (or undefine the WITH_HEIMDAL_KRB5 tunable)."
-	@exit 1
-.endif
 LIB_DEPENDS+=	krb5.3:${PORTSDIR}/security/krb5
 WITH_KRB5=	yes
 .endif
@@ -131,6 +112,10 @@
 CFLAGS+= -O3 -funroll-loops
 .endif
 
+.if defined(WITH_TESTS)
+DISTFILES+=	postgresql-test-${PORTVERSION}${EXTRACT_SUFX}
+.endif
+
 MAN1=		clusterdb.1 createdb.1 createlang.1 createuser.1 dropdb.1 \
 		droplang.1 dropuser.1 ecpg.1 initdb.1 initlocation.1 ipcclean.1 \
 		pg_config.1 pg_controldata.1 pg_ctl.1 pg_dump.1 pg_dumpall.1 \
@@ -176,7 +161,26 @@
 	@${ECHO} "	WITH_OPTIMIZED_CFLAGS	Builds with compiler optimizations (-O3)"
 	@${ECHO} "	WITH_DEBUG		Builds with debugging symbols"
 	@${ECHO} "	WITH_STRIPBIN		Installs stripped binaries"
+	@${ECHO} "	WITH_TESTS		Allows the use of a \"check\" target"
+	@${ECHO} "	AUTO_RUN_PG_TESTS	Runs the regression tests after"
+	@${ECHO} "				building the module"
 	@${ECHO} ""
+.if defined(WITH_MIT_KRB5) && defined(WITH_HEIMDAL_KRB5)
+	@${ECHO} "WITH_MIT_KRB5 and WITH_HEIMDAL_KRB5 are mutually exclusive."
+	@${ECHO} "Please choose one or the other."
+	@exit 1
+.endif
+.if defined(WITH_MIT_KRB5) && !exists(${KRB5CONFIG})
+	@${ECHO} "Unable to find krb5-config in your local base, please verify that"
+	@${ECHO} "security/krb5 is installed or undefine the WITH_MIT_KRB5 tunable."
+	@exit 1
+.endif
+.if defined(WITH_HEIMDAL_KRB5) && !exists(${KRB5CONFIG})
+	@${ECHO} "Unable to find krb5-config in the base system.  Undefine"
+	@${ECHO} "WITH_HEIMDAL_KRB5 or add MAKE_KERBEROS5=yes to /etc/make.conf"
+	@${ECHO} "and remake world (or undefine the WITH_HEIMDAL_KRB5 tunable)."
+	@exit 1
+.endif
 
 .if defined(WITHOUT_SERVER)
 do-install:
@@ -184,8 +188,11 @@
 	${GMAKE} -C src/bin ${INSTALL_TARGET} ;\
 	${GMAKE} -C src/include ${INSTALL_TARGET} ;\
 	${GMAKE} -C src/interfaces ${INSTALL_TARGET} ;\
+.if !defined(NOPORTDOCS)
 	${GMAKE} -C doc ${INSTALL_TARGET}
 .else
+	@${TRUE}
+.else
 pre-install:
 	@ ${SETENV} PKG_PREFIX=${PREFIX} \
 		${SH} ${PKGDIR}/pkg-install ${PORTNAME} PRE-INSTALL
@@ -196,14 +203,9 @@
 	${CAT} ${FILESDIR}/post-install-notes ${PKGMESSAGE} |\
 		${SED} "s|/usr/local|${PREFIX}|g" |\
 		tee ${PREFIX}/share/postgresql/post-install-notes
-.if !defined(DEBUG_FLAGS)
-.for file in ecpg pg_dump pg_id pg_restore psql ${SERVERBINARIES}
-	@ strip ${PREFIX}/bin/${file}
-.endfor
-.endif
 .if !defined(WITHOUT_SERVER)
 # install shell defaults for pgsql user
-	@ strip ${PREFIX}/bin/postgres
+	@ ${STRIP_CMD} ${PREFIX}/bin/postgres
 .for i in profile cshrc
 	@ ${SED} "s|%%PREFIX%%|${PREFIX}|g" \
 		< ${FILESDIR}/dot.$i.in \
@@ -222,6 +224,21 @@
 	${CHOWN} -R pgsql:pgsql ~pgsql/. ;\
 	${INSTALL_DATA} ${FILESDIR}/502.pgsql \
 			${PREFIX}/share/postgresql
+.endif
+
+post-build:
+.if defined(AUTO_RUN_PG_TESTS)
+	@${ECHO} "Running regression tests..."
+	@ cd ${WRKSRC}; \
+	${GMAKE} check
+.else
+	@${ECHO "Skipping regression tests"
+.endif
+
+.if defined(WITH_TESTS)
+check:
+	@ cd ${WRKSRC}; \
+	${GMAKE} check
 .endif
 
 .include <bsd.port.mk>
State-Changed-From-To: open->feedback 
State-Changed-By: seanc 
State-Changed-When: Fri Jan 24 15:20:00 PST 2003 
State-Changed-Why:  
I've updated a patch for review.  Please let me know if this looks okay 
and I will commit it.  Thanks for your patience, been busy this week. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46894 
State-Changed-From-To: feedback->closed 
State-Changed-By: seanc 
State-Changed-When: Thu Feb 6 11:51:23 PST 2003 
State-Changed-Why:  
PR superceeded by ports/47983. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46894 
>Unformatted:
