diff options
-rw-r--r-- | meta-oe/recipes-support/postgresql/files/postgresql.pam | 4 | ||||
-rw-r--r-- | meta-oe/recipes-support/postgresql/postgresql.inc | 128 |
2 files changed, 131 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/postgresql/files/postgresql.pam b/meta-oe/recipes-support/postgresql/files/postgresql.pam new file mode 100644 index 0000000000..0b6fdc5f26 --- /dev/null +++ b/meta-oe/recipes-support/postgresql/files/postgresql.pam | |||
@@ -0,0 +1,4 @@ | |||
1 | #%PAM-1.0 | ||
2 | auth include common-auth | ||
3 | account include common-account | ||
4 | password include common-password | ||
diff --git a/meta-oe/recipes-support/postgresql/postgresql.inc b/meta-oe/recipes-support/postgresql/postgresql.inc index 6f51c9110c..e1374fb75f 100644 --- a/meta-oe/recipes-support/postgresql/postgresql.inc +++ b/meta-oe/recipes-support/postgresql/postgresql.inc | |||
@@ -27,6 +27,7 @@ ARM_INSTRUCTION_SET = "arm" | |||
27 | SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \ | 27 | SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${P}.tar.bz2 \ |
28 | file://postgresql.init \ | 28 | file://postgresql.init \ |
29 | file://postgresql-bashprofile \ | 29 | file://postgresql-bashprofile \ |
30 | file://postgresql.pam \ | ||
30 | " | 31 | " |
31 | 32 | ||
32 | LEAD_SONAME = "libpq.so" | 33 | LEAD_SONAME = "libpq.so" |
@@ -34,7 +35,20 @@ LEAD_SONAME = "libpq.so" | |||
34 | # LDFLAGS for shared libraries | 35 | # LDFLAGS for shared libraries |
35 | export LDFLAGS_SL = "${LDFLAGS}" | 36 | export LDFLAGS_SL = "${LDFLAGS}" |
36 | 37 | ||
37 | inherit autotools pkgconfig useradd | 38 | inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d |
39 | |||
40 | enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
41 | PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" | ||
42 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
43 | PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," | ||
44 | PACKAGECONFIG[python] = "--with-python,--wsithout-python,python,python" | ||
45 | PACKAGECONFIG[uuid] = "--with-ossp-uuid,--without-ossp-uuid,ossp-uuid," | ||
46 | # when tcl native package is fixed change WORKDIR to STAGING_BINDIR_CROSS | ||
47 | PACKAGECONFIG[tcl] = \ | ||
48 | "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl," | ||
49 | PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,," | ||
50 | PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2" | ||
51 | PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl" | ||
38 | 52 | ||
39 | EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ | 53 | EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ |
40 | --datadir=${datadir}/${BPN} \ | 54 | --datadir=${datadir}/${BPN} \ |
@@ -44,6 +58,85 @@ EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ | |||
44 | EXTRA_OECONF_sh4 += "--disable-spinlocks" | 58 | EXTRA_OECONF_sh4 += "--disable-spinlocks" |
45 | EXTRA_OECONF_aarch64 += "--disable-spinlocks" | 59 | EXTRA_OECONF_aarch64 += "--disable-spinlocks" |
46 | 60 | ||
61 | PACKAGES_DYNAMIC += "^${PN}-plperl ^${PN}-plperl-dbg \ | ||
62 | ^${PN}-pltcl ^${PN}-pltcl-dbg \ | ||
63 | ^${PN}-plpython ^${PN}-plpython-dbg \ | ||
64 | " | ||
65 | |||
66 | python 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 | |||
97 | do_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 | |||
47 | do_compile_append() { | 140 | do_compile_append() { |
48 | oe_runmake -C contrib all | 141 | oe_runmake -C contrib all |
49 | } | 142 | } |
@@ -83,6 +176,11 @@ do_install_append() { | |||
83 | chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN} | 176 | chown -R postgres:postgres ${D}${localstatedir}/lib/${BPN} |
84 | # multiple server config directory | 177 | # multiple server config directory |
85 | install -d -m 700 ${D}${sysconfdir}/default/${BPN} | 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 | ||
86 | } | 184 | } |
87 | 185 | ||
88 | SSTATE_SCAN_FILES += "Makefile.global" | 186 | SSTATE_SCAN_FILES += "Makefile.global" |
@@ -102,6 +200,9 @@ FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \ | |||
102 | ${libdir}/${BPN}/euc2004_sjis2004.so \ | 200 | ${libdir}/${BPN}/euc2004_sjis2004.so \ |
103 | ${libdir}/${BPN}/libpqwalreceiver.so \ | 201 | ${libdir}/${BPN}/libpqwalreceiver.so \ |
104 | ${libdir}/${BPN}/*_and_*.so \ | 202 | ${libdir}/${BPN}/*_and_*.so \ |
203 | ${@'${sysconfdir}/pam.d/postgresql' \ | ||
204 | if 'pam' == d.getVar('enable_pam', True) \ | ||
205 | else ''} \ | ||
105 | " | 206 | " |
106 | 207 | ||
107 | FILES_${PN}-dbg += " ${libdir}/${BPN}/.debug/dict_snowball.so \ | 208 | FILES_${PN}-dbg += " ${libdir}/${BPN}/.debug/dict_snowball.so \ |
@@ -237,3 +338,28 @@ FILES_${PN}-contrib-dbg = " \ | |||
237 | " | 338 | " |
238 | DESCRIPTION_${PN}-contrib = "The postgresql-contrib package contains \ | 339 | DESCRIPTION_${PN}-contrib = "The postgresql-contrib package contains \ |
239 | contributed packages that are included in the PostgreSQL distribution." | 340 | contributed packages that are included in the PostgreSQL distribution." |
341 | |||
342 | FILES_${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \ | ||
343 | ${binddir}/pltcl_listmod ${bindir}/pltcl_loadmod \ | ||
344 | ${datadir}/${BPN}/unknown.pltcl" | ||
345 | FILES_${PN}-pltcl-dbg = "${libdir}/${BPN}/.debug/pltcl.so" | ||
346 | SUMMARY_${PN}-pltcl = "The Tcl procedural language for PostgreSQL" | ||
347 | DESCRIPTION_${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 | |||
351 | FILES_${PN}-plperl = "${libdir}/${BPN}/plperl.so" | ||
352 | FILES_${PN}-plperl-dbg = "${libdir}/${BPN}/.debug/plperl.so" | ||
353 | SUMMARY_${PN}-plperl = "The Perl procedural language for PostgreSQL" | ||
354 | DESCRIPTION_${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 | ||
360 | FILES_${PN}-plpython = "${libdir}/${BPN}/plpython*.so" | ||
361 | FILES_${PN}-plpython-dbg = "${libdir}/${BPN}/.debug/plpython*.so" | ||
362 | SUMMARY_${PN}-plpython = "The Python procedural language for PostgreSQL" | ||
363 | DESCRIPTION_${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." | ||