1 # $NetBSD: Makefile,v 1.2 2009/12/15 22:39:40 fhajny Exp $
3 PKGNAME= postgresql84-client-${BASE_VERS}
5 COMMENT= PostgreSQL database client programs
7 PKG_DESTDIR_SUPPORT= user-destdir
9 .include "../../databases/postgresql84/Makefile.common"
13 CONFIGURE_ARGS+= --with-openssl
14 CONFIGURE_ARGS+= --with-readline
15 CONFIGURE_ARGS+= --with-zlib
17 # 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
18 # NetBSD earler than 4.0 or DragonFly.
19 # 2. configure with --enable-thread-safety fails on OpenBSD.
21 .if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
22 ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD"
23 PGSQL_THREAD_SAFETY?= no
25 PGSQL_THREAD_SAFETY?= yes
26 BUILD_DEFS+= PGSQL_THREAD_SAFETY
28 .if !empty(PGSQL_THREAD_SAFETY:M[yY][eE][sS])
29 . include "../../mk/pthread.buildlink3.mk"
30 . if (${PTHREAD_TYPE} == "native")
31 CONFIGURE_ARGS+= --enable-thread-safety
37 INSTALL_DIRS= src/include
38 INSTALL_DIRS+= src/interfaces
39 INSTALL_DIRS+= src/bin
40 INSTALL_DIRS+= src/port
43 BUILD_DIRS= ${INSTALL_DIRS}
45 # Without this, the Darwin build fails (related to -bundle_loader).
46 BUILD_DIRS+= src/backend
48 PKG_OPTIONS_VAR= PKG_OPTIONS.postgresql84-client
49 .include "../../databases/postgresql84/options.mk"
51 .for _file_ in pg_service.conf psqlrc
52 CONF_FILES+= ${PG_DATA_DIR}/${_file_}.sample ${PG_ETC_DIR}/${_file_}
55 # XXX work around core dumps with the native libedit
58 .include "../../devel/readline/buildlink3.mk"
59 .include "../../devel/zlib/buildlink3.mk"
60 .include "../../security/openssl/buildlink3.mk"
63 SUBST_STAGE.pgxs= post-build
64 SUBST_MESSAGE.pgxs= Fixing workdir tools references in pgxs Makefile
65 SUBST_FILES.pgxs= src/Makefile.global
66 SUBST_SED.pgxs= -e 's,${WRKDIR}/.tools,${PREFIX},'
67 SUBST_SED.pgxs+= -e 's,${WRKDIR}/.wrapper,${PREFIX},'
68 SUBST_SED.pgxs+= -e 's,${WRKSRC},/dev/null,'
70 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs
71 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/config
72 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src
73 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src/makefiles
75 DEST_PG_PGXS= ${DESTDIR}${PG_PREFIX}/lib/postgresql/pgxs
76 PG_PGXS_FILES= config/install-sh config/mkinstalldirs
77 PG_PGXS_FILES+= src/makefiles/pgxs.mk src/Makefile.global
78 PG_PGXS_FILES+= src/Makefile.port src/Makefile.shlib
79 PG_PGXS_FILES+= src/nls-global.mk
81 # On Solaris, avoid conflicts between "${SSLBASE}/include/openssl/des.h"
82 # and "/usr/include/crypt.h" -- we want the definitions in the former.
83 .if ${OPSYS} == "SunOS"
85 touch ${BUILDLINK_DIR}/include/crypt.h
89 cd ${WRKSRC}/doc; for file in \
90 FAQ* KNOWN_BUGS MISSING_FEATURES README.* TODO \
93 ${INSTALL_DATA} $$file ${DESTDIR}${PG_DOC_DIR}/$$file; \
95 for file in ${PG_PGXS_FILES}; do \
96 ${INSTALL_DATA} ${WRKSRC}/$$file ${DEST_PG_PGXS}/$$file;\
99 .include "../../mk/bsd.pkg.mk"