Lines 6-12
Link Here
|
6 |
# |
6 |
# |
7 |
|
7 |
|
8 |
PORTNAME= postgresql |
8 |
PORTNAME= postgresql |
9 |
PORTVERSION= 7.0.2 |
9 |
PORTVERSION= 7.0.3 |
10 |
CATEGORIES= databases |
10 |
CATEGORIES= databases |
11 |
MASTER_SITES= ftp://ftp.postgresql.org/pub/%SUBDIR%/ \ |
11 |
MASTER_SITES= ftp://ftp.postgresql.org/pub/%SUBDIR%/ \ |
12 |
ftp://ftp.de.postgresql.org/%SUBDIR%/ \ |
12 |
ftp://ftp.de.postgresql.org/%SUBDIR%/ \ |
Lines 22-81
Link Here
|
22 |
|
22 |
|
23 |
MAINTAINER= ports@FreeBSD.org |
23 |
MAINTAINER= ports@FreeBSD.org |
24 |
|
24 |
|
|
|
25 |
BUILD_DEPENDS= autoconf:${PORTSDIR}/devel/autoconf |
26 |
|
25 |
Y2K= http://www.postgresql.org/y2k.html |
27 |
Y2K= http://www.postgresql.org/y2k.html |
26 |
|
28 |
|
27 |
INSTALLS_SHLIB= YES |
29 |
INSTALLS_SHLIB= YES |
28 |
LDCONFIG_DIRS= %%PREFIX%%/pgsql/lib |
30 |
LDCONFIG_DIRS= %%PREFIX%%/pgsql/lib |
29 |
BUILD_DEPENDS= autoconf:${PORTSDIR}/devel/autoconf |
|
|
30 |
|
31 |
|
31 |
.if defined(KRB5_HOME) && exists(${KRB5_HOME}) |
|
|
32 |
CONFIGURE_KRB= --with-krb5=${KRB5_HOME} \ |
33 |
--with-krb-keytab=FILE:${PREFIX}/pgsql/etc/keytab |
34 |
.endif |
35 |
|
36 |
# if you want to use the tcl/tk frontend pgaccess, then you need to build |
37 |
# postgresql with tcl support by typing: make -DWITH_TCL |
38 |
.if defined(WITH_TCL) |
39 |
TCL_INCDIR= ${LOCALBASE}/include/tcl8.3 |
40 |
TK_INCDIR= ${LOCALBASE}/include/tk8.3 |
41 |
MAKE_ENV= TCL_INCDIR=${TCL_INCDIR} |
42 |
CONFIGURE_ENV= WISH=${LOCALBASE}/bin/wish8.3 |
43 |
LIB_DEPENDS= tcl83.1:${PORTSDIR}/lang/tcl83 \ |
44 |
tk83.1:${PORTSDIR}/x11-toolkits/tk83 |
45 |
CONFIGURE_TCL= --with-tcl --with-tclconfig="${LOCALBASE}/lib/tcl8.3 ${LOCALBASE}/lib/tk8.3" |
46 |
.endif |
47 |
|
48 |
# if you want to disable the multibyte support, type: |
49 |
# make -DWITHOUT_MULTIBYTE |
50 |
# |
51 |
# if you want to set the default encoding for the multibyte support, type: |
52 |
# make DEFAULT_ENCODING=<encoding> |
53 |
# where <encoding> is one of these: |
54 |
# SQL_ASCII LATIN1 LATIN2 LATIN3 LATIN4 LATIN5 |
55 |
# EUC_JP EUC_CN EUC_KR EUC_TW KOI8 |
56 |
# UNICODE MULE_INTERNAL WIN ALT |
57 |
.if defined(WITHOUT_MULTIBYTE) |
58 |
CONFIGURE_MULTIBYTE= # none |
59 |
.elif defined(DEFAULT_ENCODING) |
60 |
CONFIGURE_MULTIBYTE= --enable-multibyte="${DEFAULT_ENCODING}" |
61 |
.else |
62 |
CONFIGURE_MULTIBYTE= --enable-multibyte |
63 |
.endif |
64 |
.if defined(WITH_PERL) |
65 |
CONFIGURE_PERL= --with-perl |
66 |
.endif |
67 |
.if defined(WITH_ODBC) |
68 |
CONFIGURE_ODBC= --with-odbc |
69 |
.endif |
70 |
|
71 |
# if you want jdbc, type make -DWITH_JDBC |
72 |
# Honors JAVA_HOME if you have it set, and don't want the dependency. |
73 |
.if defined(WITH_JDBC) |
74 |
JAVA_HOME?= ${LOCALBASE}/jdk1.1.8 |
75 |
BUILD_DEPENDS= ${JAVA_HOME}/bin/javac:${PORTSDIR}/java/jdk |
76 |
SCRIPTS_ENV+= JAVA_HOME=${JAVA_HOME} |
77 |
.endif |
78 |
|
79 |
WRKSRC= ${WRKDIR}/${DISTNAME}/src |
32 |
WRKSRC= ${WRKDIR}/${DISTNAME}/src |
80 |
DOCDIR= ${WRKDIR}/${DISTNAME}/doc |
33 |
DOCDIR= ${WRKDIR}/${DISTNAME}/doc |
81 |
|
34 |
|
Lines 86-96
Link Here
|
86 |
--enable-locale \ |
39 |
--enable-locale \ |
87 |
--with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'` \ |
40 |
--with-template=`uname -s | ${TR} '[A-Z]' '[a-z]'` \ |
88 |
--with-includes="${PREFIX}/include ${TCL_INCDIR} ${TK_INCDIR}" \ |
41 |
--with-includes="${PREFIX}/include ${TCL_INCDIR} ${TK_INCDIR}" \ |
89 |
${CONFIGURE_KRB} \ |
|
|
90 |
${CONFIGURE_TCL} \ |
91 |
${CONFIGURE_MULTIBYTE} \ |
92 |
${CONFIGURE_PERL} \ |
93 |
${CONFIGURE_ODBC} \ |
94 |
--with-libraries=${PREFIX}/lib |
42 |
--with-libraries=${PREFIX}/lib |
95 |
|
43 |
|
96 |
MAN1= createdb.1 createlang.1 createuser.1 dropdb.1 droplang.1 \ |
44 |
MAN1= createdb.1 createlang.1 createuser.1 dropdb.1 droplang.1 \ |
Lines 117-166
Link Here
|
117 |
|
65 |
|
118 |
MANPREFIX= ${PREFIX}/pgsql |
66 |
MANPREFIX= ${PREFIX}/pgsql |
119 |
|
67 |
|
120 |
pre-fetch: |
68 |
SCRIPTS_ENV= WRKDIRPREFIX="${WRKDIRPREFIX}" \ |
121 |
@${ECHO_MSG} "To install and run postgresql you need to compile kernel with:" |
69 |
WRKDIR="${WRKDIR}" \ |
122 |
@${ECHO_MSG} " options \"SYSVSHM, SYSVSEM, SYSVMSG\"" |
70 |
FILESDIR="${FILESDIR}" \ |
123 |
.if !defined(WITH_TCL) |
71 |
TOUCH="${TOUCH}" \ |
124 |
@${ECHO_MSG} "To build the \"PostgreSQL to Tcl interface library\", libpgtcl, type:" |
72 |
MKDIR="${MKDIR}" \ |
125 |
@${ECHO_MSG} " make -DWITH_TCL" |
73 |
NO_OPENSSL="${NO_OPENSSL}" \ |
126 |
.else |
74 |
DISTNAME="${DISTNAME}" |
127 |
@${ECHO_MSG} "Building PostgreSQL with \"libpgtcl\"." |
75 |
|
128 |
.endif |
76 |
.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc) |
129 |
.if !defined(WITHOUT_MULTIBYTE) |
77 |
.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc" |
130 |
@${ECHO_MSG} "To disable multibyte support, type:" |
|
|
131 |
@${ECHO_MSG} " make -DWITHOUT_MULTIBYTE" |
132 |
.if !defined(DEFAULT_ENCODING) |
133 |
@${ECHO_MSG} "To set the default encoding for the multibyte support, type:" |
134 |
@${ECHO_MSG} " make DEFAULT_ENCODING=<encoding>" |
135 |
@${ECHO_MSG} "where <encoding> is one of these:" |
136 |
@${ECHO_MSG} " SQL_ASCII LATIN1 LATIN2 LATIN3 LATIN4 LATIN5" |
137 |
@${ECHO_MSG} " EUC_JP EUC_CN EUC_KR EUC_TW KOI8" |
138 |
@${ECHO_MSG} " UNICODE MULE_INTERNAL WIN ALT" |
139 |
.else |
140 |
@${ECHO_MSG} "The default encoding is '${DEFAULT_ENCODING}'." |
141 |
.endif |
142 |
.else |
143 |
@${ECHO_MSG} "Building PostgreSQL without multibyte support." |
144 |
.endif |
145 |
.if !defined(WITH_JDBC) |
146 |
@${ECHO_MSG} "To build Java (JDBC) support, type:" |
147 |
@${ECHO_MSG} " make -DWITH_JDBC" |
148 |
.else |
149 |
@${ECHO_MSG} "Building PostgreSQL with \"postgresql.jar\"." |
150 |
.endif |
151 |
.if !defined(WITH_PERL) |
152 |
@${ECHO_MSG} "To build Perl interface and pl/Perl interpreter:" |
153 |
@${ECHO_MSG} " make -DWITH_PERL" |
154 |
.else |
155 |
@${ECHO_MSG} "Building PostgreSQL with \"pl/Perl\"." |
156 |
.endif |
157 |
.if !defined(WITH_ODBC) |
158 |
@${ECHO_MSG} "To build the ODBC driver package:" |
159 |
@${ECHO_MSG} " make -DWITH_ODBC" |
160 |
.else |
161 |
@${ECHO_MSG} "Building PostgreSQL with ODBC Drivers." |
162 |
.endif |
78 |
.endif |
163 |
|
79 |
|
|
|
80 |
pre-extract: |
81 |
@ ${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.postgresql |
82 |
|
164 |
post-patch: |
83 |
post-patch: |
165 |
@ ${MV} ${WRKSRC}/template/freebsd ${WRKSRC}/template/freebsd.orig |
84 |
@ ${MV} ${WRKSRC}/template/freebsd ${WRKSRC}/template/freebsd.orig |
166 |
@ ${SED} -e 's#CFLAGS:-O2 -m486 -pipe#CFLAGS:${CFLAGS}#' \ |
85 |
@ ${SED} -e 's#CFLAGS:-O2 -m486 -pipe#CFLAGS:${CFLAGS}#' \ |
Lines 180-195
Link Here
|
180 |
|
99 |
|
181 |
post-build: |
100 |
post-build: |
182 |
.if defined(WITH_JDBC) |
101 |
.if defined(WITH_JDBC) |
183 |
@ cd ${WRKSRC}/interfaces/jdbc && ${GMAKE} |
102 |
@ ${GMAKE} -C ${WRKSRC}/interfaces/jdbc jdbc${JAVAVERSION} |
184 |
.if !defined(NOPORTDOCS) |
|
|
185 |
@ cd ${WRKSRC}/interfaces/jdbc && ${GMAKE} examples |
186 |
.endif |
187 |
.endif |
103 |
.endif |
188 |
@ ${ECHO} "------------------------------------------------------------" |
|
|
189 |
@ ${ECHO} "Dump existing databases, before installing new db version !!" |
190 |
@ ${ECHO} "Detailed instructions, see" |
191 |
@ ${ECHO} "${WRKDIR}/${DISTNAME}/INSTALL" |
192 |
@ ${ECHO} "------------------------------------------------------------" |
193 |
|
104 |
|
194 |
pre-install: |
105 |
pre-install: |
195 |
.if defined(PACKAGE_BUILDING) |
106 |
.if defined(PACKAGE_BUILDING) |
Lines 197-249
Link Here
|
197 |
.endif |
108 |
.endif |
198 |
@ ${MKDIR} ${PREFIX}/pgsql |
109 |
@ ${MKDIR} ${PREFIX}/pgsql |
199 |
@ ${SETENV} ${MAKE_ENV} perl ${SCRIPTDIR}/createuser |
110 |
@ ${SETENV} ${MAKE_ENV} perl ${SCRIPTDIR}/createuser |
|
|
111 |
.if !defined(BATCH) |
112 |
@ ${SED} -e "s#%%WRKDIR%%#${WRKDIR}#; s#%%DISTNAME%%#${DISTNAME}#" \ |
113 |
< ${FILESDIR}/pre-install-notes | more -e |
114 |
.endif |
200 |
|
115 |
|
201 |
post-install: |
116 |
post-install: |
202 |
.if defined(NOPORTDOCS) |
117 |
.if defined(NOPORTDOCS) |
203 |
@ ( cd ${DOCDIR}; ${GMAKE} man ) |
118 |
@ ${GMAKE} -C ${DOCDIR} man |
204 |
.else |
119 |
.else |
205 |
@ ( cd ${DOCDIR}; ${GMAKE} install ) |
120 |
@ ${GMAKE} -C ${DOCDIR} install |
|
|
121 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/FAQ* ${PREFIX}/share/doc/pgsql |
122 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/README* ${PREFIX}/share/doc/pgsql |
123 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/TODO ${PREFIX}/share/doc/pgsql |
124 |
# ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/*ps.gz ${PREFIX}/share/doc/pgsql |
125 |
@ ${CAT} ${PKGDIR}/pkg-plist.doc >> ${TMPPLIST} |
206 |
.endif |
126 |
.endif |
207 |
@ if [ ! -f ${PREFIX}/pgsql/.profile ]; then \ |
127 |
@ if [ ! -f ${PREFIX}/pgsql/.profile ]; then \ |
208 |
${ECHO} "PATH=${PATH}:${PREFIX}/pgsql/bin" \ |
128 |
${SED} 's|%%PREFIX%%|${PREFIX}|g' \ |
|
|
129 |
< ${FILESDIR}/dot.profile.in \ |
209 |
> ${PREFIX}/pgsql/.profile; \ |
130 |
> ${PREFIX}/pgsql/.profile; \ |
210 |
${ECHO} "MANPATH=${MANPATH}:${PREFIX}/pgsql/man" \ |
|
|
211 |
>> ${PREFIX}/pgsql/.profile; \ |
212 |
${ECHO} "PGLIB=${PREFIX}/pgsql/lib" \ |
213 |
>> ${PREFIX}/pgsql/.profile; \ |
214 |
${ECHO} "# note: PGDATA overwrites the -D startup option" \ |
215 |
>> ${PREFIX}/pgsql/.profile; \ |
216 |
${ECHO} "PGDATA=${PREFIX}/pgsql/data" \ |
217 |
>> ${PREFIX}/pgsql/.profile; \ |
218 |
${ECHO} "DISPLAY=:0" \ |
219 |
>> ${PREFIX}/pgsql/.profile; \ |
220 |
${ECHO} "export PATH MANPATH PGLIB PGDATA DISPLAY" \ |
221 |
>> ${PREFIX}/pgsql/.profile; \ |
222 |
${ECHO} "# if you want to make regression tests use this TZ" \ |
223 |
>> ${PREFIX}/pgsql/.profile; \ |
224 |
${ECHO} "#TZ=PST8PDT" \ |
225 |
>> ${PREFIX}/pgsql/.profile; \ |
226 |
${ECHO} "#export TZ" \ |
227 |
>> ${PREFIX}/pgsql/.profile; \ |
228 |
fi |
131 |
fi |
229 |
@ ${CHOWN} -R pgsql:pgsql ${PREFIX}/pgsql |
132 |
@ ${CHOWN} -R pgsql:pgsql ${PREFIX}/pgsql |
230 |
@ ${CHOWN} root:pgsql ${PREFIX}/pgsql/lib |
133 |
@ ${CHOWN} root:pgsql ${PREFIX}/pgsql/lib |
231 |
@ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...' |
134 |
@ ${ECHO} 'Initializing PostgreSQL Databases - this may take a few minutes...' |
232 |
@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/pgsql/lib |
135 |
@ ${SETENV} OBJFORMAT=${PORTOBJFORMAT} ${LDCONFIG} -m ${PREFIX}/pgsql/lib |
233 |
@ su -l pgsql -c 'PATH=${PREFIX}/pgsql/bin:${PATH} LD_LIBRARY_PATH=${PREFIX}/pgsql/lib ${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${PREFIX}/pgsql/data' |
136 |
# '-' so we don't fail to create packagelist at this stage, |
|
|
137 |
# when we already have everything installed on top of previous version |
138 |
-@ su -l pgsql -c 'PATH=${PREFIX}/pgsql/bin:${PATH} ${PREFIX}/pgsql/bin/initdb --pglib=${PREFIX}/pgsql/lib --pgdata=${PREFIX}/pgsql/data' |
234 |
@ ${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl \ |
139 |
@ ${SED} -e "s=!!PREFIX!!=${PREFIX}=g" < ${FILESDIR}/pgsql.sh.tmpl \ |
235 |
> ${PREFIX}/etc/rc.d/pgsql.sh |
140 |
> ${PREFIX}/etc/rc.d/pgsql.sh |
236 |
@ ${CHMOD} 554 ${PREFIX}/etc/rc.d/pgsql.sh |
141 |
@ ${CHMOD} 554 ${PREFIX}/etc/rc.d/pgsql.sh |
237 |
@ ${CHOWN} root.pgsql ${PREFIX}/etc/rc.d/pgsql.sh |
142 |
@ ${CHOWN} root.pgsql ${PREFIX}/etc/rc.d/pgsql.sh |
238 |
@ ${INSTALL_DATA} ${FILESDIR}/post-install-notes ${PREFIX}/pgsql |
143 |
@ ${SED} -e 's#%%PREFIX%%#${PREFIX}#' < ${FILESDIR}/post-install-notes \ |
|
|
144 |
> ${PREFIX}/pgsql/post-install-notes |
239 |
.if defined(WITHOUT_MULTIBYTE) |
145 |
.if defined(WITHOUT_MULTIBYTE) |
240 |
@${CP} ${TMPPLIST} ${TMPPLIST}.nomulti |
146 |
@${CP} ${TMPPLIST} ${TMPPLIST}.nomulti |
241 |
@${GREP} -v pgsql/bin/pg_encoding ${TMPPLIST}.nomulti > ${TMPPLIST} |
147 |
@${GREP} -v pgsql/bin/pg_encoding ${TMPPLIST}.nomulti > ${TMPPLIST} |
242 |
.endif |
148 |
.endif |
243 |
.if defined(WITH_TCL) |
149 |
.if defined(WITH_TCL) |
244 |
@${CP} ${TMPPLIST} ${TMPPLIST}.notcl |
150 |
@${CP} ${TMPPLIST} ${TMPPLIST}.notcl |
245 |
@${CAT} ${PKGDIR}/pkg-plist.tcl ${TMPPLIST}.notcl > ${TMPPLIST} |
151 |
@${CAT} ${PKGDIR}/${TCL_PLIST} ${TMPPLIST}.notcl > ${TMPPLIST} |
246 |
@${RM} ${TMPPLIST}.notcl |
152 |
@${RM} ${TMPPLIST}.notcl |
|
|
153 |
# Preparing a loadable TCL-package (pkgIndex.tcl) |
154 |
# XXX This directory and the single file are not registered in |
155 |
# XXX the PLIST, because of different PREFIX. |
156 |
@${MKDIR} ${LOCALBASE}/lib/tcl${WITH_TCL}/Pgtcl1.3 |
157 |
@${SED} 's|%%PREFIX%%|${PREFIX}|' < ${FILESDIR}/pkgIndex.tcl.in \ |
158 |
> ${LOCALBASE}/lib/tcl${WITH_TCL}/Pgtcl1.3/pkgIndex.tcl |
247 |
.endif |
159 |
.endif |
248 |
.if defined(WITH_ODBC) |
160 |
.if defined(WITH_ODBC) |
249 |
@${CP} ${TMPPLIST} ${TMPPLIST}.noodbc |
161 |
@${CP} ${TMPPLIST} ${TMPPLIST}.noodbc |
Lines 272-295
Link Here
|
272 |
@ ${ECHO_MSG} "---------------------------------------------------------" |
184 |
@ ${ECHO_MSG} "---------------------------------------------------------" |
273 |
@ ${ECHO_MSG} "Putting jdbc examples into ${PREFIX}/share/examples/pgsql" |
185 |
@ ${ECHO_MSG} "Putting jdbc examples into ${PREFIX}/share/examples/pgsql" |
274 |
@ ${ECHO_MSG} "---------------------------------------------------------" |
186 |
@ ${ECHO_MSG} "---------------------------------------------------------" |
275 |
@ ${CAT} ${PKGDIR}/pkg-plist.doc >> ${TMPPLIST} |
|
|
276 |
.endif |
277 |
.endif |
187 |
.endif |
278 |
.if !defined(NOPORTDOCS) |
|
|
279 |
${MKDIR} ${PREFIX}/share/doc/pgsql |
280 |
@ ${GMAKE} -C ${WRKDIR}/${DISTNAME}/doc install |
281 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/FAQ* ${PREFIX}/share/doc/pgsql |
282 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/README* ${PREFIX}/share/doc/pgsql |
283 |
${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/TODO ${PREFIX}/share/doc/pgsql |
284 |
# ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/*ps.gz ${PREFIX}/share/doc/pgsql |
285 |
.endif |
188 |
.endif |
286 |
.if !defined(BATCH) |
189 |
.if !defined(BATCH) |
287 |
@ more -e ${FILESDIR}/post-install-notes |
190 |
@ more -e ${PREFIX}/pgsql/post-install-notes |
288 |
.endif |
191 |
.endif |
289 |
.if !defined(DEBUG_FLAGS) |
192 |
.if !defined(DEBUG_FLAGS) |
290 |
.for file in ecpg pg_dump pg_id pg_passwd pg_version postgres psql |
193 |
.for file in ecpg pg_dump pg_id pg_passwd pg_version postgres psql |
291 |
@ strip ${PREFIX}/pgsql/bin/${file} |
194 |
@ strip ${PREFIX}/pgsql/bin/${file} |
292 |
.endfor |
195 |
.endfor |
293 |
.endif |
196 |
.endif |
|
|
197 |
|
198 |
post-clean: |
199 |
@ ${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc |
294 |
|
200 |
|
295 |
.include <bsd.port.mk> |
201 |
.include <bsd.port.mk> |