a6fc3080e990bc58aff7c6831e6168c4808809d2
[pkgsrc.git] / databases / postgresql83-server / Makefile
1 # $NetBSD: Makefile,v 1.7 2010/01/16 09:30:32 adam Exp $
2
3 PKGNAME=        postgresql83-server-${BASE_VERS}
4 COMMENT=        PostgreSQL database server programs
5
6 PKG_DESTDIR_SUPPORT=    user-destdir
7
8 # mips has no TAS implementation
9 NOT_FOR_PLATFORM=       *-*-mips
10
11 .include "../../databases/postgresql83/Makefile.common"
12
13 # Use shlibtool (invoked as "$(LIBTOOL)") to build modules.
14 USE_LIBTOOL=            yes
15 PKG_LIBTOOL=            ${PKG_SHLIBTOOL}
16
17 MESSAGE_SRC=            ${.CURDIR}/MESSAGE
18
19 CONFIGURE_ARGS+=        --with-openssl
20
21 BUILD_DIRS=             src/backend
22 BUILD_DIRS+=            src/backend/utils/mb/conversion_procs
23 BUILD_DIRS+=            src/backend/snowball
24 BUILD_DIRS+=            src/timezone
25 BUILD_DIRS+=            src/pl
26
27 # PostgreSQL has loadable server-side language modules.
28 #
29 # Explicitly set DLOPEN_REQUIRE_PTHREADS to "no" on NetBSD as NetBSD-2.x
30 # had problems with mixing dlopen() and pthreads, which blows up in
31 # PostgreSQL's backend (pkg/28729).  This works on older and newer
32 # versions of NetBSD as well since they don't have the bad interaction
33 # between dlopen() and pthreads.
34 #
35 .if ${OPSYS} == "NetBSD"
36 DLOPEN_REQUIRE_PTHREADS=        no
37 .endif
38 .include "../../mk/dlopen.buildlink3.mk"
39
40 # If we're using libltdl to provide "dlopen" functionality, then add the
41 # dependency and make sure that we link against -lltdl.
42 #
43 .if !empty(USE_LIBLTDL:M[yY][eE][sS])
44 DL_LIBS+=       -lltdl
45 .  include "../../devel/libltdl/buildlink3.mk"
46 .endif
47
48 PKG_OPTIONS_VAR=        PKG_OPTIONS.postgresql83-server
49 PKG_SUPPORTED_OPTIONS=  ldap pam
50 .include "../../databases/postgresql83/options.mk"
51
52 # PGUSER        username of the database administrator
53 # PGGROUP       group of the database administrator
54 # PGHOME        home directory of the database administrator and location of
55 #               the databases
56 #
57 PGUSER?=                pgsql
58 PGGROUP?=               pgsql
59 PGHOME?=                ${PREFIX}/${PGUSER}
60 FILES_SUBST+=           PGUSER=${PGUSER}
61 FILES_SUBST+=           PGGROUP=${PGGROUP}
62 FILES_SUBST+=           PGHOME=${PGHOME}
63 BUILD_DEFS+=            PGHOME
64
65 PKG_GROUPS_VARS+=       PGGROUP
66 PKG_USERS_VARS+=        PGUSER
67
68 PKG_GROUPS=             ${PGGROUP}
69 PKG_USERS=              ${PGUSER}:${PGGROUP}
70 PKG_GECOS.${PGUSER}=    PostgreSQL database administrator
71 PKG_HOME.${PGUSER}=     ${PGHOME}
72 PKG_SHELL.${PGUSER}=    ${SH}
73
74 RCD_SCRIPTS=            pgsql
75
76 .include "../../databases/postgresql83-client/buildlink3.mk"
77 .include "../../security/openssl/buildlink3.mk"
78
79 # Avoid conflict between "${SSLBASE}/include/openssl/des.h" and
80 # "/usr/include/crypt.h" -- we want the definitions in the former.
81 #
82 post-wrapper:
83 .if ${OPSYS} == "SunOS"
84         touch ${BUILDLINK_DIR}/include/crypt.h
85 .endif
86
87 pre-build:
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
93         ${RUN}${_ULIMIT_CMD}                                            \
94         cd ${WRKSRC}/src/port &&                                        \
95         env ${MAKE_ENV} ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS}
96
97 .include "../../mk/bsd.pkg.mk"