1 # $NetBSD: Makefile,v 1.5 2010/02/05 14:50:38 gdt 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"
11 # Couldn't find -lpgport, then rebuilt ok.
16 CONFIGURE_ARGS+= --with-openssl
17 CONFIGURE_ARGS+= --with-readline
18 CONFIGURE_ARGS+= --with-zlib
20 # 1. The thread-safety test in ${WRSRC}/src/tools/thread does not pass on
21 # NetBSD earler than 4.0 or DragonFly.
22 # 2. configure with --enable-thread-safety fails on OpenBSD.
24 .if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
25 ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD"
26 PGSQL_THREAD_SAFETY?= no
28 PGSQL_THREAD_SAFETY?= yes
29 BUILD_DEFS+= PGSQL_THREAD_SAFETY
31 .if !empty(PGSQL_THREAD_SAFETY:M[yY][eE][sS])
32 . include "../../mk/pthread.buildlink3.mk"
33 . if (${PTHREAD_TYPE} == "native")
34 CONFIGURE_ARGS+= --enable-thread-safety
40 INSTALL_DIRS= src/include
41 INSTALL_DIRS+= src/interfaces
42 INSTALL_DIRS+= src/bin
43 INSTALL_DIRS+= src/port
46 BUILD_DIRS= ${INSTALL_DIRS}
48 # Without this, the Darwin build fails (related to -bundle_loader).
49 BUILD_DIRS+= src/backend
51 PKG_OPTIONS_VAR= PKG_OPTIONS.postgresql84-client
52 .include "../../databases/postgresql84/options.mk"
54 .for _file_ in pg_service.conf psqlrc
55 CONF_FILES+= ${PG_DATA_DIR}/${_file_}.sample ${PG_ETC_DIR}/${_file_}
58 # XXX work around core dumps with the native libedit
61 .include "../../devel/readline/buildlink3.mk"
62 .include "../../devel/zlib/buildlink3.mk"
63 .include "../../security/openssl/buildlink3.mk"
66 SUBST_STAGE.pgxs= post-build
67 SUBST_MESSAGE.pgxs= Fixing workdir tools references in pgxs Makefile
68 SUBST_FILES.pgxs= src/Makefile.global
69 SUBST_SED.pgxs= -e 's,${WRKDIR}/.tools,${PREFIX},'
70 SUBST_SED.pgxs+= -e 's,${WRKDIR}/.wrapper,${PREFIX},'
71 SUBST_SED.pgxs+= -e 's,${WRKSRC},/dev/null,'
73 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs
74 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/config
75 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src
76 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src/makefiles
78 DEST_PG_PGXS= ${DESTDIR}${PG_PREFIX}/lib/postgresql/pgxs
79 PG_PGXS_FILES= config/install-sh config/mkinstalldirs
80 PG_PGXS_FILES+= src/makefiles/pgxs.mk src/Makefile.global
81 PG_PGXS_FILES+= src/Makefile.port src/Makefile.shlib
82 PG_PGXS_FILES+= src/nls-global.mk
84 # On Solaris, avoid conflicts between "${SSLBASE}/include/openssl/des.h"
85 # and "/usr/include/crypt.h" -- we want the definitions in the former.
86 .if ${OPSYS} == "SunOS"
88 touch ${BUILDLINK_DIR}/include/crypt.h
92 cd ${WRKSRC}/doc; for file in \
93 FAQ* KNOWN_BUGS MISSING_FEATURES README.* TODO \
96 ${INSTALL_DATA} $$file ${DESTDIR}${PG_DOC_DIR}/$$file; \
98 for file in ${PG_PGXS_FILES}; do \
99 ${INSTALL_DATA} ${WRKSRC}/$$file ${DEST_PG_PGXS}/$$file;\
102 .include "../../mk/bsd.pkg.mk"