[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / databases / postgresql90-client

File: [cvs.NetBSD.org] / pkgsrc / databases / postgresql90-client / Attic / Makefile (download)

Revision 1.12, Thu Jun 14 07:45:34 2012 UTC (10 years, 7 months ago) by sbd
Branch: MAIN
CVS Tags: pkgsrc-2012Q2-base
Branch point for: pkgsrc-2012Q2
Changes since 1.11: +2 -2 lines

Recursive PKGREVISION bump for libxml2 buildlink addition.

# $NetBSD: Makefile,v 1.12 2012/06/14 07:45:34 sbd Exp $

PKGNAME=	${DISTNAME:C/-/90-client-/}
PKGREVISION=	2
COMMENT=	PostgreSQL database client programs

PKG_DESTDIR_SUPPORT=	user-destdir

.include "../../databases/postgresql90/Makefile.common"

USE_TOOLS+=		gzip tar
CONFIGURE_ARGS+=	--with-openssl
CONFIGURE_ARGS+=	--with-readline
CONFIGURE_ARGS+=	--with-zlib

# 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
# NetBSD earler than 4.0 or DragonFly.
# 2. configure with --enable-thread-safety fails on OpenBSD.
.if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
    ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD"
PGSQL_THREAD_SAFETY?=	no
.endif
PGSQL_THREAD_SAFETY?=	yes
BUILD_DEFS+=		PGSQL_THREAD_SAFETY

.if !empty(PGSQL_THREAD_SAFETY:M[yY][eE][sS])
.  include "../../mk/pthread.buildlink3.mk"
.  if (${PTHREAD_TYPE} == "native")
CONFIGURE_ARGS+=	--enable-thread-safety
.  endif
.endif

INSTALL_DIRS=	src/include
INSTALL_DIRS+=	src/interfaces
INSTALL_DIRS+=	src/bin
INSTALL_DIRS+=	src/port
BUILD_DIRS=	${INSTALL_DIRS}
# Without this, the Darwin build fails (related to -bundle_loader).
BUILD_DIRS+=	src/backend

.for f in pg_service.conf psqlrc
. if !empty(PG_SUBPREFIX)
CONF_FILES+=	${PG_SUBPREFIX:/=}/share/postgresql/${f}.sample ${PKG_SYSCONFDIR}/${f}
. else
CONF_FILES+=	${PG_SUBPREFIX}share/postgresql/${f}.sample ${PKG_SYSCONFDIR}/${f}
. endif
.endfor

# XXX work around core dumps with the native libedit
USE_GNU_READLINE=	yes

.include "../../devel/readline/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../security/openssl/buildlink3.mk"

SUBST_CLASSES+=		pgxs
SUBST_STAGE.pgxs=	post-build
SUBST_MESSAGE.pgxs=	Fixing workdir tools references in pgxs Makefile
SUBST_FILES.pgxs=	src/Makefile.global
SUBST_SED.pgxs=		-e 's,${TOOLS_CMD.bison},${TOOLS_PATH.bison},'
SUBST_SED.pgxs+=	-e 's,${TOOLS_CMD.lex},${TOOLS_PATH.lex},'
SUBST_SED.pgxs+=	-e 's,${TOOLS_CMD.mkdir},${TOOLS_PATH.mkdir},'
SUBST_SED.pgxs+=	-e 's,${WRKDIR}/.wrapper/bin/ld,${LD},'
SUBST_SED.pgxs+=	-e 's,${WRKDIR}/.wrapper,${PREFIX},'
SUBST_SED.pgxs+=	-e 's,${WRKSRC},/dev/null,'

.if !empty(PG_SUBPREFIX)
INSTALLATION_DIRS+=	$(PG_SUBPREFIX:/=)/lib/postgresql/pgxs
INSTALLATION_DIRS+=	$(PG_SUBPREFIX:/=)/lib/postgresql/pgxs/config
INSTALLATION_DIRS+=	$(PG_SUBPREFIX:/=)/lib/postgresql/pgxs/src
INSTALLATION_DIRS+=	$(PG_SUBPREFIX:/=)/lib/postgresql/pgxs/src/makefiles
.else
INSTALLATION_DIRS+=	$(PG_SUBPREFIX)lib/postgresql/pgxs
INSTALLATION_DIRS+=	$(PG_SUBPREFIX)lib/postgresql/pgxs/config
INSTALLATION_DIRS+=	$(PG_SUBPREFIX)lib/postgresql/pgxs/src
INSTALLATION_DIRS+=	$(PG_SUBPREFIX)lib/postgresql/pgxs/src/makefiles
.endif

DEST_PGXS=	${DESTDIR}${PREFIX}/$(PG_SUBPREFIX)/lib/postgresql/pgxs
PGXS_FILES=	config/install-sh
PGXS_FILES+=	src/makefiles/pgxs.mk src/Makefile.global
PGXS_FILES+=	src/Makefile.port src/Makefile.shlib
PGXS_FILES+=	src/nls-global.mk

# On Solaris, avoid conflicts between "${SSLBASE}/include/openssl/des.h"
# and "/usr/include/crypt.h" -- we want the definitions in the former.
.if ${OPSYS} == "SunOS"
post-wrapper:
	touch ${BUILDLINK_DIR}/include/crypt.h
.endif

post-install:
.for file in ${PGXS_FILES}
	${INSTALL_DATA} ${WRKSRC}/${file} ${DEST_PGXS}/${file}
.endfor

.include "../../mk/bsd.pkg.mk"