summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/postgresql/postgresql.inc
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-oe/recipes-support/postgresql/postgresql.inc
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/postgresql/postgresql.inc')
-rw-r--r--meta-oe/recipes-support/postgresql/postgresql.inc365
1 files changed, 365 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/postgresql/postgresql.inc b/meta-oe/recipes-support/postgresql/postgresql.inc
new file mode 100644
index 0000000000..e1374fb75f
--- /dev/null
+++ b/meta-oe/recipes-support/postgresql/postgresql.inc
@@ -0,0 +1,365 @@
1SUMMARY = "PostgreSQL is a powerful, open source relational database system."
2DESCRIPTION = "\
3 PostgreSQL is an advanced Object-Relational database management system \
4 (DBMS) that supports almost all SQL constructs (including \
5 transactions, subselects and user-defined types and functions). The \
6 postgresql package includes the client programs and libraries that \
7 you'll need to access a PostgreSQL DBMS server. These PostgreSQL \
8 client programs are programs that directly manipulate the internal \
9 structure of PostgreSQL databases on a PostgreSQL server. These client \
10 programs can be located on the same machine with the PostgreSQL \
11 server, or may be on a remote machine which accesses a PostgreSQL \
12 server over a network connection. This package contains the docs \
13 in HTML for the whole package, as well as command-line utilities for \
14 managing PostgreSQL databases on a PostgreSQL server. \
15 \
16 If you want to manipulate a PostgreSQL database on a local or remote \
17 PostgreSQL server, you need this package. You also need to install \
18 this package if you're installing the postgresql-server package. \
19 "
20HOMEPAGE = "http://www.postgresql.com"
21LICENSE = "BSD"
22DEPENDS = "zlib readline tzcode-native"
23INC_PR = "r0"
24
25ARM_INSTRUCTION_SET = "arm"
26
27SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \
28 file://postgresql.init \
29 file://postgresql-bashprofile \
30 file://postgresql.pam \
31"
32
33LEAD_SONAME = "libpq.so"
34
35# LDFLAGS for shared libraries
36export LDFLAGS_SL = "${LDFLAGS}"
37
38inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d
39
40enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
41PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl"
42PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
43PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
44PACKAGECONFIG[python] = "--with-python,--wsithout-python,python,python"
45PACKAGECONFIG[uuid] = "--with-ossp-uuid,--without-ossp-uuid,ossp-uuid,"
46# when tcl native package is fixed change WORKDIR to STAGING_BINDIR_CROSS
47PACKAGECONFIG[tcl] = \
48 "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl,"
49PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,,"
50PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2"
51PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl"
52
53EXTRA_OECONF += "--enable-thread-safety --disable-rpath \
54 --datadir=${datadir}/${BPN} \
55 --sysconfdir=${sysconfdir}/${BPN} \
56 --without-krb5 \
57"
58EXTRA_OECONF_sh4 += "--disable-spinlocks"
59EXTRA_OECONF_aarch64 += "--disable-spinlocks"
60
61PACKAGES_DYNAMIC += "^${PN}-plperl ^${PN}-plperl-dbg \
62 ^${PN}-pltcl ^${PN}-pltcl-dbg \
63 ^${PN}-plpython ^${PN}-plpython-dbg \
64"
65
66python populate_packages_prepend() {
67
68 def fill_more(name, dbg=True):
69 if name is None or name.strip() == "":
70 return
71
72 fpack=d.getVar('PACKAGES') or ""
73 fpack="${PN}-" + name + " " + fpack
74 if dbg:
75 fpack="${PN}-" + name + "-dbg" + " " + fpack
76 d.setVar('PACKAGES', fpack)
77
78 conf=(d.getVar('PACKAGECONFIG', True) or "").split()
79 pack=d.getVar('PACKAGES') or ""
80 bb.debug(1, "PACKAGECONFIG=%s" % conf)
81 bb.debug(1, "PACKAGES1=%s" % pack )
82
83 if "perl" in conf :
84 fill_more("plperl")
85
86 if "tcl" in conf:
87 fill_more("pltcl")
88
89 if "python" in conf:
90 fill_more("plpython")
91
92 pack=d.getVar('PACKAGES', True) or ""
93 bb.debug(1, "PACKAGES2=%s" % pack)
94
95}
96
97do_configure() {
98 # do_configure_prepend
99 # make sure configure finds python includdirs with these envs
100 export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
101 STAGING_INCDIR=${STAGING_INCDIR} \
102 STAGING_LIBDIR=${STAGING_LIBDIR}
103
104 # do_configure
105 autotools_do_configure
106
107 # do_configure_append
108 # workaround perl package related bugs
109 sed -i -e "s:-L/usr/local/lib:-L=/usr/local/lib:g" \
110 ${S}/src/Makefile.global
111 LIBPNA="\${STAGING_LIBDIR_NATIVE}/perl-native"
112 LIBNA="\${STAGING_LIBDIR_NATIVE}"
113 BLIBNA="\${STAGING_BASE_LIBDIR_NATIVE}"
114 sed -i -e "/^perl_archlibexp/s:${LIBPNA}:${STAGING_LIBDIR}:g" \
115 ${S}/src/Makefile.global
116 sed -i -e "/^perl_privlibexp/s:${LIBPNA}:${STAGING_LIBDIR}:g" \
117 ${S}/src/Makefile.global
118 # remove the rpath, replace with correct lib path
119 sed -i \
120 -e "/^perl_embed_ldflags/s:-Wl,-rpath,${LIBNA}::g" \
121 -e "/^perl_embed_ldflags/s:-Wl,-rpath,${BLIBNA}::g" \
122 -e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${LIBNA}::g" \
123 -e "/^perl_embed_ldflags/s:-Wl,-rpath-link,${BLIBNA}::g" \
124 -e "/^perl_embed_ldflags/s:${LIBPNA}:${STAGING_LIBDIR}:g" \
125 -e "/^perl_embed_ldflags/s:${LIBNA}:${STAGING_LIBDIR}:g" \
126 -e "/^perl_embed_ldflags/s:${BLIBNA}:${STAGING_BASELIBDIR}:g" \
127 ${S}/src/Makefile.global
128
129 # workaround perl package's libperl.so problem
130 # we are using perlnative so this perl should have same version
131 perl_version=`perl -v 2>/dev/null | \
132 sed -n 's/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p'`
133 if [ ! -h "${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so" -a \
134 ! -h "${STAGING_LIBDIR}/libperl.so" ]; then
135 ln -sf ../../../libperl.so.5 \
136 ${STAGING_LIBDIR}/perl/$perl_version/CORE/libperl.so
137 fi
138}
139
140do_compile_append() {
141 oe_runmake -C contrib all
142}
143
144# server needs to configure user and group
145usernum = "28"
146groupnum = "28"
147USERADD_PACKAGES = "${PN}"
148USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \
149 -s /bin/bash -c 'PostgreSQL Server' -u ${usernum} postgres"
150GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres"
151
152INITSCRIPT_PACKAGES = "${PN}"
153INITSCRIPT_NAME = "${BPN}-server"
154INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ."
155
156do_install_append() {
157 # install contrib
158 oe_runmake DESTDIR=${D} -C contrib install
159 # install tutorial
160 install -d -m 0755 ${D}${libdir}/${BPN}/tutorial
161 install ${S}/src/tutorial/* ${D}${libdir}/${BPN}/tutorial
162
163 # install COPYRIGHT README HISTORY
164 install -d -m 0755 ${D}${docdir}/${BPN}
165 for i in ${S}/{COPYRIGHT,README,HISTORY} ${S}/doc/{KNOWN_BUGS,MISSING_FEATURES,README*,bug.template}; do
166 [ -f $i ] && install $i ${D}${docdir}/${BPN}
167 done
168
169 # install dirs and server init
170 install -d ${D}${sysconfdir}/init.d
171 install -m 0755 ${WORKDIR}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN}-server
172 sed -i -e "s/^PGVERSION=.*$/PGVERSION=${PV}/g" ${D}${sysconfdir}/init.d/${BPN}-server
173 install -d -m 700 ${D}${localstatedir}/lib/${BPN}/data
174 install -d -m 700 ${D}${localstatedir}/lib/${BPN}/backups
175 install -m 644 ${WORKDIR}/${BPN}-bashprofile ${D}${localstatedir}/lib/${BPN}/.bash_profile
176 chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN}
177 # multiple server config directory
178 install -d -m 700 ${D}${sysconfdir}/default/${BPN}
179
180 if [ "${@d.getVar('enable_pam', True)}" = "pam" ]; then
181 install -d ${D}${sysconfdir}/pam.d
182 install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql
183 fi
184}
185
186SSTATE_SCAN_FILES += "Makefile.global"
187
188PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \
189 libecpg-compat-dbg libecpg-compat libecpg-compat-dev \
190 libecpg-dbg libecpg libecpg-dev libecpg-staticdev libecpg-doc \
191 libpq-dbg libpq libpq-dev libpq-staticdev \
192 libpgtypes-dbg libpgtypes libpgtypes-staticdev libpgtypes-dev \
193 ${PN}-contrib ${PN}-contrib-dbg \
194"
195
196FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \
197 ${localstatedir}/lib/${BPN}/data ${localstatedir}/lib/${BPN}/backups \
198 ${localstatedir}/lib/${BPN}/.bash_profile ${sysconfdir}/default/${BPN} \
199 ${libdir}/${BPN}/dict_snowball.so ${libdir}/${BPN}/plpgsql.so \
200 ${libdir}/${BPN}/euc2004_sjis2004.so \
201 ${libdir}/${BPN}/libpqwalreceiver.so \
202 ${libdir}/${BPN}/*_and_*.so \
203 ${@'${sysconfdir}/pam.d/postgresql' \
204 if 'pam' == d.getVar('enable_pam', True) \
205 else ''} \
206"
207
208FILES_${PN}-dbg += " ${libdir}/${BPN}/.debug/dict_snowball.so \
209 ${libdir}/${BPN}/.debug/plpgsql.so \
210 ${libdir}/${BPN}/.debug/euc2004_sjis2004.so \
211 ${libdir}/${BPN}/.debug/libpqwalreceiver.so \
212 ${libdir}/${BPN}/.debug/*_and_*.so \
213"
214
215FILES_${PN}-client = "${bindir}/clusterdb \
216 ${bindir}/createdb \
217 ${bindir}/createlang \
218 ${bindir}/createuser \
219 ${bindir}/dropdb \
220 ${bindir}/droplang \
221 ${bindir}/dropuser \
222 ${bindir}/pg_dump \
223 ${bindir}/pg_dumpall \
224 ${bindir}/pg_restore \
225 ${bindir}/psql \
226 ${bindir}/reindexdb \
227 ${bindir}/vacuumdb \
228 ${bindir}/vacuumlo \
229 ${datadir}/${BPN}/psqlrc.sample"
230
231FILES_${PN}-client-doc = "${mandir}/man1/clusterdb.* \
232 ${mandir}/man1/createdb.* ${mandir}/man1/createlang.* \
233 ${mandir}/man1/createuser.* ${mandir}/man1/dropdb.* \
234 ${mandir}/man1/droplang.* ${mandir}/man1/dropuser.* \
235 ${mandir}/man1/pg_dump.* ${mandir}/man1/pg_dumpall.* \
236 ${mandir}/man1/pg_restore.* ${mandir}/man1/psql.* \
237 ${mandir}/man1/reindexdb.* ${mandir}/man1/vacuumdb.* \
238 ${mandir}/man7/* \
239"
240
241FILES_${PN}-doc += "${docdir}/${BPN}/html ${libdir}/${BPN}/tutorial/ \
242 ${mandir}/man1/initdb.* ${mandir}/man1/pg_controldata.* \
243 ${mandir}/man1/pg_ctl.* ${mandir}/man1/pg_resetxlog.* \
244 ${mandir}/man1/postgres.* ${mandir}/man1/postmaster.* \
245"
246
247FILES_${PN}-timezone = "${datadir}/${BPN}/timezone \
248 ${datadir}/${BPN}/timezonesets \
249"
250RDEPENDS_${PN} += "${PN}-timezone"
251FILES_${PN}-server-dev = "${includedir}/${BPN}/server"
252
253FILES_libecpg = "${libdir}/libecpg*${SOLIBS}"
254FILES_libecpg-dbg = "${libdir}/.debug/libecpg*"
255FILES_libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \
256 ${libdir}/libpgtypes*${SOLIBSDEV} \
257 ${includedir}/ecpg*.h ${includedir}/${BPN}/ecpg*.h \
258 ${includedir}/pgtypes*.h ${includedir}/${BPN}/informix \
259 ${includedir}/sql3types.h ${includedir}/sqlca.h"
260FILES_libecpg-doc = "${mandir}/man1/ecpg.*"
261FILES_libecpg-staticdev = "${libdir}/libecpg*.a"
262SECTION_libecpg-staticdev = "devel"
263RDEPENDS_libecpg-staticdev = "libecpg-dev (= ${EXTENDPKGV})"
264
265FILES_libpq = "${libdir}/libpq*${SOLIBS}"
266FILES_libpq-dbg = "${libdir}/.debug/libpq* ${libdir}/${BPN}/pgxs/src/test/regress/.debug/*"
267FILES_libpq-dev = "${libdir}/libpq*${SOLIBSDEV} \
268 ${includedir}"
269FILES_libpq-staticdev = "${libdir}/libpq*.a ${libdir}/libpgport.a"
270SECTION_libpq-staticdev = "devel"
271RDEPENDS_libpq-staticdev = "libpq-dev (= ${EXTENDPKGV})"
272
273FILES_libecpg-compat = "${libdir}/libecpg_compat*${SOLIBS}"
274FILES_libecpg-compat-dbg = "${libdir}/.debug/libecpg_compat*"
275FILES_libecpg-compat-dev = "${libdir}/libecpg_compat*${SOLIBS}"
276FILES_libpgtypes = "${libdir}/libpgtypes*${SOLIBS}"
277FILES_libpgtypes-dbg = "${libdir}/.debug/libpgtypes*"
278FILES_libpgtypes-staticdev = "${libdir}/libpgtypes*.a"
279FILES_libpgtypes-dev = "${libdir}/libpgtypes*${SOLIBS} ${includedir}/pgtypes*.h"
280
281FILES_${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \
282 ${bindir}/pgbench ${bindir}/vacuumlo \
283 ${S}/contrib/spi/*.example \
284 ${libdir}/${BPN}/_int.so ${libdir}/${BPN}/adminpack.so \
285 ${libdir}/${BPN}/autoinc.so ${libdir}/${BPN}/auto_explain.so \
286 ${libdir}/${BPN}/auth_delay.so ${libdir}/${BPN}/btree_gin.so \
287 ${libdir}/${BPN}/btree_gist.so ${libdir}/${BPN}/.so \
288 ${libdir}/${BPN}/chkpass.so ${libdir}/${BPN}/citext.so \
289 ${libdir}/${BPN}/cube.so ${libdir}/${BPN}/dblink.so \
290 ${libdir}/${BPN}/dict_int.so ${libdir}/${BPN}/dict_xsyn.so \
291 ${libdir}/${BPN}/dummy_seclabel.so ${libdir}/${BPN}/earthdistance.so \
292 ${libdir}/${BPN}/file_fdw.so ${libdir}/${BPN}/fuzzystrmatch.so \
293 ${libdir}/${BPN}/hstore.so ${libdir}/${BPN}/insert_username.so \
294 ${libdir}/${BPN}/isn.so ${libdir}/${BPN}/lo.so \
295 ${libdir}/${BPN}/ltree.so ${libdir}/${BPN}/moddatetime.so \
296 ${libdir}/${BPN}/pageinspect.so ${libdir}/${BPN}/pg_buffercache.so \
297 ${libdir}/${BPN}/pg_freespacemap.so ${libdir}/${BPN}/pg_trgm.so \
298 ${libdir}/${BPN}/pgcrypto.so ${libdir}/${BPN}/pgrowlocks.so \
299 ${libdir}/${BPN}/pgstattuple.so ${libdir}/${BPN}/pg_stat_statements.so \
300 ${libdir}/${BPN}/refint.so ${libdir}/${BPN}/seg.so \
301 ${libdir}/${BPN}/sslinfo.so \
302 ${libdir}/${BPN}/tablefunc.so \
303 ${libdir}/${BPN}/test_parser.so ${libdir}/${BPN}/timetravel.so \
304 ${libdir}/${BPN}/tsearch2.so ${libdir}/${BPN}/uuid-ossp.so \
305 ${libdir}/${BPN}/pgxml.so ${libdir}/${BPN}/passwordcheck.so \
306 ${libdir}/${BPN}/pg_upgrade_support.so ${libdir}/${BPN}/.so \
307 ${libdir}/${BPN}/unaccent.so \
308"
309FILES_${PN}-contrib-dbg = " \
310 ${libdir}/${BPN}/.debug/_int.so ${libdir}/${BPN}/.debug/adminpack.so \
311 ${libdir}/${BPN}/.debug/autoinc.so ${libdir}/${BPN}/.debug/auto_explain.so \
312 ${libdir}/${BPN}/.debug/auth_delay.so ${libdir}/${BPN}/.debug/btree_gin.so \
313 ${libdir}/${BPN}/.debug/btree_gist.so ${libdir}/${BPN}/.debug/.so \
314 ${libdir}/${BPN}/.debug/chkpass.so ${libdir}/${BPN}/.debug/citext.so \
315 ${libdir}/${BPN}/.debug/cube.so ${libdir}/${BPN}/.debug/dblink.so \
316 ${libdir}/${BPN}/.debug/dict_int.so ${libdir}/${BPN}/.debug/dict_xsyn.so \
317 ${libdir}/${BPN}/.debug/dummy_seclabel.so \
318 ${libdir}/${BPN}/.debug/earthdistance.so \
319 ${libdir}/${BPN}/.debug/file_fdw.so ${libdir}/${BPN}/.debug/fuzzystrmatch.so \
320 ${libdir}/${BPN}/.debug/hstore.so ${libdir}/${BPN}/.debug/insert_username.so \
321 ${libdir}/${BPN}/.debug/isn.so ${libdir}/${BPN}/.debug/lo.so \
322 ${libdir}/${BPN}/.debug/ltree.so ${libdir}/${BPN}/.debug/moddatetime.so \
323 ${libdir}/${BPN}/.debug/pageinspect.so \
324 ${libdir}/${BPN}/.debug/pg_buffercache.so \
325 ${libdir}/${BPN}/.debug/pg_freespacemap.so \
326 ${libdir}/${BPN}/.debug/pg_trgm.so \
327 ${libdir}/${BPN}/.debug/pgcrypto.so ${libdir}/${BPN}/.debug/pgrowlocks.so \
328 ${libdir}/${BPN}/.debug/pgstattuple.so \
329 ${libdir}/${BPN}/.debug/pg_stat_statements.so \
330 ${libdir}/${BPN}/.debug/refint.so ${libdir}/${BPN}/.debug/seg.so \
331 ${libdir}/${BPN}/.debug/sslinfo.so \
332 ${libdir}/${BPN}/.debug/tablefunc.so \
333 ${libdir}/${BPN}/.debug/test_parser.so ${libdir}/${BPN}/.debug/timetravel.so \
334 ${libdir}/${BPN}/.debug/tsearch2.so ${libdir}/${BPN}/.debug/uuid-ossp.so \
335 ${libdir}/${BPN}/.debug/pgxml.so ${libdir}/${BPN}/.debug/passwordcheck.so \
336 ${libdir}/${BPN}/.debug/pg_upgrade_support.so \
337 ${libdir}/${BPN}/.debug/unaccent.so \
338"
339DESCRIPTION_${PN}-contrib = "The postgresql-contrib package contains \
340 contributed packages that are included in the PostgreSQL distribution."
341
342FILES_${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \
343 ${binddir}/pltcl_listmod ${bindir}/pltcl_loadmod \
344 ${datadir}/${BPN}/unknown.pltcl"
345FILES_${PN}-pltcl-dbg = "${libdir}/${BPN}/.debug/pltcl.so"
346SUMMARY_${PN}-pltcl = "The Tcl procedural language for PostgreSQL"
347DESCRIPTION_${PN}-pltcl = "PostgreSQL is an advanced Object-Relational \
348 database management system. The postgresql-pltcl package contains the PL/Tcl \
349 procedural language for the backend."
350
351FILES_${PN}-plperl = "${libdir}/${BPN}/plperl.so"
352FILES_${PN}-plperl-dbg = "${libdir}/${BPN}/.debug/plperl.so"
353SUMMARY_${PN}-plperl = "The Perl procedural language for PostgreSQL"
354DESCRIPTION_${PN}-plperl = "PostgreSQL is an advanced Object-Relational \
355 database management system. The postgresql-plperl package contains the \
356 PL/Perl procedural language for the backend."
357
358# In version 8, it will be plpython.so
359# In version 9, it might be plpython{2,3}.so depending on python2 or 3
360FILES_${PN}-plpython = "${libdir}/${BPN}/plpython*.so"
361FILES_${PN}-plpython-dbg = "${libdir}/${BPN}/.debug/plpython*.so"
362SUMMARY_${PN}-plpython = "The Python procedural language for PostgreSQL"
363DESCRIPTION_${PN}-plpython = "PostgreSQL is an advanced Object-Relational \
364 database management system. The postgresql-plpython package contains \
365 the PL/Python procedural language for the backend."