update Tue Feb 23 06:37:01 PST 2010
[pkgsrc.git] / databases / postgresql84-client / Makefile
1 # $NetBSD: Makefile,v 1.5 2010/02/05 14:50:38 gdt Exp $
2
3 PKGNAME=        postgresql84-client-${BASE_VERS}
4 PKGREVISION=    1
5 COMMENT=        PostgreSQL database client programs
6
7 PKG_DESTDIR_SUPPORT=    user-destdir
8
9 .include "../../databases/postgresql84/Makefile.common"
10
11 # Couldn't find -lpgport, then rebuilt ok.
12 MAKE_JOBS_SAFE=         no
13
14 USE_TOOLS+=             gzip tar
15 USE_LIBTOOL=            yes
16 CONFIGURE_ARGS+=        --with-openssl
17 CONFIGURE_ARGS+=        --with-readline
18 CONFIGURE_ARGS+=        --with-zlib
19
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.
23 #
24 .if (${OPSYS} == "NetBSD" && !empty(OS_VERSION:M[0-3].*)) || \
25     ${OPSYS} == "DragonFly" || ${OPSYS} == "OpenBSD"
26 PGSQL_THREAD_SAFETY?=   no
27 .endif
28 PGSQL_THREAD_SAFETY?=   yes
29 BUILD_DEFS+=            PGSQL_THREAD_SAFETY
30
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
35 .  endif
36 .endif
37
38 LIBS.SunOS+=    -lintl
39
40 INSTALL_DIRS=   src/include
41 INSTALL_DIRS+=  src/interfaces
42 INSTALL_DIRS+=  src/bin
43 INSTALL_DIRS+=  src/port
44 INSTALL_DIRS+=  doc
45
46 BUILD_DIRS=     ${INSTALL_DIRS}
47
48 # Without this, the Darwin build fails (related to -bundle_loader).
49 BUILD_DIRS+=    src/backend
50
51 PKG_OPTIONS_VAR=        PKG_OPTIONS.postgresql84-client
52 .include "../../databases/postgresql84/options.mk"
53
54 .for _file_ in pg_service.conf psqlrc
55 CONF_FILES+=    ${PG_DATA_DIR}/${_file_}.sample ${PG_ETC_DIR}/${_file_}
56 .endfor
57
58 # XXX work around core dumps with the native libedit
59 USE_GNU_READLINE=       yes
60
61 .include "../../devel/readline/buildlink3.mk"
62 .include "../../devel/zlib/buildlink3.mk"
63 .include "../../security/openssl/buildlink3.mk"
64
65 SUBST_CLASSES+=         pgxs
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,'
72
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
77
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
83
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"
87 post-wrapper:
88         touch ${BUILDLINK_DIR}/include/crypt.h
89 .endif
90
91 post-install:
92         cd ${WRKSRC}/doc; for file in                                   \
93                 FAQ* KNOWN_BUGS MISSING_FEATURES README.* TODO          \
94                 bug.template;                                           \
95         do                                                              \
96                 ${INSTALL_DATA} $$file ${DESTDIR}${PG_DOC_DIR}/$$file;  \
97         done;                                                           \
98         for file in ${PG_PGXS_FILES}; do                                \
99                 ${INSTALL_DATA} ${WRKSRC}/$$file ${DEST_PG_PGXS}/$$file;\
100         done
101
102 .include "../../mk/bsd.pkg.mk"