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