3 PKGNAME= postgresql83-client-${BASE_VERS}
5 COMMENT= PostgreSQL database client programs
7 PKG_DESTDIR_SUPPORT= user-destdir
9 .include "../../databases/postgresql83/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.
20 .if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
21 ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD"
22 PGSQL_THREAD_SAFETY?= no
24 PGSQL_THREAD_SAFETY?= yes
25 BUILD_DEFS+= PGSQL_THREAD_SAFETY
27 .if !empty(PGSQL_THREAD_SAFETY:M[yY][eE][sS])
28 . include "../../mk/pthread.buildlink3.mk"
29 . if (${PTHREAD_TYPE} == "native")
30 CONFIGURE_ARGS+= --enable-thread-safety
36 INSTALL_DIRS= src/include
37 INSTALL_DIRS+= src/interfaces
38 INSTALL_DIRS+= src/bin
39 INSTALL_DIRS+= src/port
42 BUILD_DIRS= ${INSTALL_DIRS}
44 # Without this, the Darwin build fails (related to -bundle_loader).
45 BUILD_DIRS+= src/backend
47 PKG_OPTIONS_VAR= PKG_OPTIONS.postgresql83-client
48 .include "../../databases/postgresql83/options.mk"
50 .for _file_ in pg_service.conf psqlrc
51 CONF_FILES+= ${PG_DATA_DIR}/${_file_}.sample ${PG_ETC_DIR}/${_file_}
54 # XXX work around core dumps with the native libedit
57 .include "../../devel/readline/buildlink3.mk"
58 .include "../../devel/zlib/buildlink3.mk"
59 .include "../../security/openssl/buildlink3.mk"
62 SUBST_STAGE.pgxs= post-build
63 SUBST_MESSAGE.pgxs= Fixing workdir tools references in pgxs Makefile
64 SUBST_FILES.pgxs= src/Makefile.global
65 SUBST_SED.pgxs= -e 's,${WRKDIR}/.tools,${PREFIX},'
66 SUBST_SED.pgxs+= -e 's,${WRKDIR}/.wrapper,${PREFIX},'
67 SUBST_SED.pgxs+= -e 's,${WRKSRC},/dev/null,'
69 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs
70 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/config
71 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src
72 INSTALLATION_DIRS+= ${PG_SUBPREFIX}lib/postgresql/pgxs/src/makefiles
74 DEST_PG_PGXS= ${DESTDIR}${PG_PREFIX}/lib/postgresql/pgxs
75 PG_PGXS_FILES= config/install-sh config/mkinstalldirs
76 PG_PGXS_FILES+= src/makefiles/pgxs.mk src/Makefile.global
77 PG_PGXS_FILES+= src/Makefile.port src/Makefile.shlib
78 PG_PGXS_FILES+= src/nls-global.mk
80 # On Solaris, avoid conflicts between "${SSLBASE}/include/openssl/des.h"
81 # and "/usr/include/crypt.h" -- we want the definitions in the former.
82 .if ${OPSYS} == "SunOS"
84 touch ${BUILDLINK_DIR}/include/crypt.h
88 ${RUN} ${_ULIMIT_CMD} \
89 cd ${WRKSRC}/src/backend && \
90 env ${MAKE_ENV} ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \
91 ../../src/include/parser/parse.h \
92 ../../src/include/utils/fmgroids.h
95 cd ${WRKSRC}/doc; for file in \
96 FAQ* KNOWN_BUGS MISSING_FEATURES README.* TODO \
99 ${INSTALL_DATA} $$file ${DESTDIR}${PG_DOC_DIR}/$$file; \
101 for file in ${PG_PGXS_FILES}; do \
102 ${INSTALL_DATA} ${WRKSRC}/$$file ${DEST_PG_PGXS}/$$file;\
104 cp -R ${WRKSRC}/doc/TODO.detail ${DESTDIR}${PG_DOC_DIR}
105 chown -R ${DOCOWN}:${DOCGRP} ${DESTDIR}${PG_DOC_DIR}/TODO.detail
107 .include "../../mk/bsd.pkg.mk"