3 # This Makefile fragment is included by all PostgreSQL packages built from
4 # the main sources of the PostgreSQL distribution except jdbc-postgresql.
6 # The PostgreSQL package naming scheme, aside from the obvious piecewise
7 # packages, is as follows:
9 # <lang>-postgresql client-side interface to PostgreSQL
10 # postgresql-<lang> server-side module for PostgreSQL backend
12 .include "../../databases/postgresql83/Makefile.mirrors"
14 DISTNAME?= postgresql-${DIST_VERS}
15 CATEGORIES+= databases
16 MASTER_SITES?= ${PGSQL_MIRRORS:=source/v${DIST_VERS}/}
17 EXTRACT_SUFX= .tar.bz2
19 MAINTAINER?= adam@NetBSD.org
20 HOMEPAGE?= http://www.postgresql.org/
22 CONFLICTS+= postgresql-[0-9]*
23 CONFLICTS+= postgresql73-*
24 CONFLICTS+= postgresql74-*
25 CONFLICTS+= postgresql80-*
26 CONFLICTS+= postgresql81-*
27 CONFLICTS+= postgresql82-*
28 CONFLICTS+= postgresql84-*
30 DISTINFO_FILE?= ${.CURDIR}/../postgresql83/distinfo
31 COMMON_FILESDIR?= ${.CURDIR}/../postgresql83/files
32 PATCHDIR?= ${.CURDIR}/../postgresql83/patches
34 # Version numbering scheme:
35 # DIST_VERS version number on the postgresql distfile
36 # BASE_VERS pkgsrc-mangled version number (convert pl -> .)
37 # Note: Do not forget jdbc-postgresql83 when updating version
39 BASE_VERS?= ${DIST_VERS}
41 BUILDLINK_API_DEPENDS.postgresql83-client+= postgresql83-client>=${BASE_VERS}
44 USE_TOOLS+= bison gmake lex msgfmt
45 PKG_SYSCONFSUBDIR= postgresql
47 # in 7.4.x/8.0.x, this is done by autoconf stuff which has leading whitespace
49 SUBST_CLASSES+= pglocale
50 SUBST_FILES.pglocale= configure config/programs.m4
51 SUBST_STAGE.pglocale= pre-configure
52 SUBST_SED.pglocale= -e 's|\( localedir[ :]*=\).*|\1${PG_LOCALE_DIR}|'
54 .include "../../mk/bsd.prefs.mk"
56 PG_TEMPLATE.SunOS= solaris
57 PG_TEMPLATE.IRIX= irix5
58 .if !defined(PG_TEMPLATE.${OPSYS})
59 PG_TEMPLATE.${OPSYS}= ${LOWER_OPSYS}
63 .if empty(PG_SUBPREFIX)
65 PLIST_SUBST+= PG_SUBPREFIX=
67 PG_PREFIX= ${PREFIX}/${PG_SUBPREFIX}
68 BUILD_DEFS+= PG_SUBPREFIX
69 PLIST_SUBST+= PG_SUBPREFIX=${PG_SUBPREFIX}/
70 BUILDLINK_PASSTHRU_DIRS+= ${PG_PREFIX}
72 PG_DATA_DIR= ${PG_PREFIX}/share/postgresql
73 PG_DOC_DIR= ${PG_PREFIX}/share/doc/postgresql
74 PG_LOCALE_DIR= ${PG_PREFIX}/${PKGLOCALEDIR}/locale
75 PG_ETC_DIR= ${PKG_SYSCONFDIR:S/^${PREFIX}\//${PG_PREFIX}\//}
77 GNU_CONFIGURE_PREFIX= ${PG_PREFIX}
78 CONFIGURE_ARGS+= --sysconfdir=${PG_ETC_DIR}
79 CONFIGURE_ARGS+= --datadir=${PG_DATA_DIR}
80 CONFIGURE_ARGS+= --with-docdir=${PG_DOC_DIR}
81 CONFIGURE_ARGS+= --with-template=${PG_TEMPLATE.${OPSYS}}
82 CONFIGURE_ARGS+= --without-readline
83 CONFIGURE_ARGS+= --without-zlib
84 CONFIGURE_ARGS+= --enable-nls
86 CONFIGURE_ARGS+= --without-perl
87 CONFIGURE_ARGS+= --without-python
88 CONFIGURE_ARGS+= --without-tcl
90 # Enable Bonjour on Mac OS X
91 .if ${OPSYS} == "Darwin"
92 CONFIGURE_ARGS+= --with-bonjour
95 # PostgreSQL explicitly forbids any use of -ffast-math
96 BUILDLINK_TRANSFORM+= rm:-ffast-math
98 # USE_LIBLTDL is "yes" or "no" depending on whether we're using libltdl
99 # to provide "dlopen" functionality for the PostgreSQL backend.
100 .if ${OPSYS} == "Interix"
105 FILES_SUBST+= PG_PREFIX=${PG_PREFIX:Q}
107 .include "../../devel/gettext-lib/buildlink3.mk"
109 .if !defined(META_PACKAGE)
111 cp -f ${COMMON_FILESDIR}/Makefile.custom ${WRKSRC}/src/Makefile.custom
112 cp -f ${COMMON_FILESDIR}/Makefile.libtool ${WRKSRC}/src/Makefile.shlib
113 .if !empty(USE_LIBLTDL:M[yY][eE][sS])
114 template=${PG_TEMPLATE.${OPSYS}:Q}
115 cp -f ${COMMON_FILESDIR}/dynloader-ltdl.h \
116 ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.h
117 ${ECHO} "static int dummy = 0;" \
118 > ${WRKSRC}/src/backend/port/dynloader/${PG_TEMPLATE.${OPSYS}:Q}.c
121 touch ${WRKSRC}/src/template/dragonfly
122 cp ${WRKSRC}/src/backend/port/dynloader/freebsd.c \
123 ${WRKSRC}/src/backend/port/dynloader/dragonfly.c
124 cp ${WRKSRC}/src/backend/port/dynloader/freebsd.h \
125 ${WRKSRC}/src/backend/port/dynloader/dragonfly.h
126 cp ${WRKSRC}/src/include/port/freebsd.h \
127 ${WRKSRC}/src/include/port/dragonfly.h
128 cp ${WRKSRC}/src/makefiles/Makefile.freebsd \
129 ${WRKSRC}/src/makefiles/Makefile.dragonfly
132 # PGSQL_BLCKSZ is the size in bytes of a PostgreSQL disk page or block.
133 # This also limits the size of a tuple. The valid values are powers
134 # of 2 up to 32768, and the default size is 8196 (hardcoded in the
135 # PostgreSQL sources). Please don't change this value unless you know
136 # what you are doing.
137 BUILD_DEFS+= PGSQL_BLCKSZ
139 .if defined(PGSQL_BLCKSZ)
141 pre-configure: pgsql-blcksz
143 for file in ${WRKSRC}/src/include/pg_config_manual.h; do \
144 ${SED} -e "/^#define[ ]*BLCKSZ[ ]*/s/^\(#define[ ]*BLCKSZ\).*/\1 ${PGSQL_BLCKSZ}/" $$file > $$file.new; \
145 ${MV} -f $$file.new $$file; \