diff options
Diffstat (limited to 'meta-oe/recipes-dbs/postgresql/postgresql.inc')
-rw-r--r-- | meta-oe/recipes-dbs/postgresql/postgresql.inc | 164 |
1 files changed, 95 insertions, 69 deletions
diff --git a/meta-oe/recipes-dbs/postgresql/postgresql.inc b/meta-oe/recipes-dbs/postgresql/postgresql.inc index 090e16f58e..e29a5bef77 100644 --- a/meta-oe/recipes-dbs/postgresql/postgresql.inc +++ b/meta-oe/recipes-dbs/postgresql/postgresql.inc @@ -18,12 +18,12 @@ DESCRIPTION = "\ this package if you're installing the postgresql-server package. \ " HOMEPAGE = "http://www.postgresql.com" -LICENSE = "BSD-0-Clause" -DEPENDS = "libnsl2 zlib readline tzcode-native" +LICENSE = "0BSD" +DEPENDS = "libnsl2 readline tzcode-native" ARM_INSTRUCTION_SET = "arm" -SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \ +SRC_URI = "https://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \ file://postgresql.init \ file://postgresql-profile \ file://postgresql.pam \ @@ -35,16 +35,16 @@ LEAD_SONAME = "libpq.so" # LDFLAGS for shared libraries export LDFLAGS_SL = "${LDFLAGS}" +export LDFLAGS_EX_BE = "-Wl,--export-dynamic" -inherit autotools pkgconfig perlnative python3native useradd update-rc.d systemd gettext cpan-base +inherit autotools pkgconfig perlnative python3native python3targetconfig useradd update-rc.d systemd gettext cpan-base multilib_header CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR} -I${STAGING_INCDIR}/tcl8.6" -SYSTEMD_SERVICE_${PN} = "postgresql.service" -SYSTEMD_AUTO_ENABLE_${PN} = "disable" +SYSTEMD_SERVICE:${PN} = "postgresql.service" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" -DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" -pkg_postinst_${PN} () { +pkg_postinst:${PN} () { if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then if [ -n "$D" ]; then OPTS="--root=$D" @@ -53,40 +53,47 @@ pkg_postinst_${PN} () { fi } -enable_pam = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" -PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" -PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," -PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl," -PACKAGECONFIG[python] = "--with-python,--without-python,python3,python3" -PACKAGECONFIG[uuid] = "--with-uuid=e2fs,--without-uuid,util-linux," +PACKAGECONFIG ??= " \ + ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd', d)} \ + openssl python uuid libxml tcl perl zlib icu \ +" PACKAGECONFIG[tcl] = "--with-tcl --with-tclconfig=${STAGING_BINDIR_CROSS},--without-tcl,tcl tcl-native," -PACKAGECONFIG[nls] = "--enable-nls,--disable-nls,," -PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2" PACKAGECONFIG[perl] = "--with-perl,--without-perl,perl,perl" +PACKAGECONFIG[python] = "--with-python,--without-python,python3,python3" +PACKAGECONFIG[gssapi] = "--with-gssapi,--without-gssapi,krb5" +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" +PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap" +PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd systemd-systemctl-native" +PACKAGECONFIG[uuid] = "--with-uuid=e2fs,--without-uuid,util-linux" +PACKAGECONFIG[libxml] = "--with-libxml,--without-libxml,libxml2,libxml2" +PACKAGECONFIG[libxslt] = "--with-libxslt,--without-libxslt,libxslt" +PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" +PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4" +PACKAGECONFIG[openssl] = "--with-ssl=openssl,ac_cv_file__dev_urandom=yes,openssl" +PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu,icu" EXTRA_OECONF += "--enable-thread-safety --disable-rpath \ --datadir=${datadir}/${BPN} \ --sysconfdir=${sysconfdir}/${BPN} \ " -EXTRA_OECONF_sh4 += "--disable-spinlocks" -EXTRA_OECONF_aarch64 += "--disable-spinlocks" +EXTRA_OECONF:sh4 += "--disable-spinlocks" -DEBUG_OPTIMIZATION_remove_mips = " -Og" -DEBUG_OPTIMIZATION_append_mips = " -O" -BUILD_OPTIMIZATION_remove_mips = " -Og" -BUILD_OPTIMIZATION_append_mips = " -O" +DEBUG_OPTIMIZATION:remove:mips = " -Og" +DEBUG_OPTIMIZATION:append:mips = " -O" +BUILD_OPTIMIZATION:remove:mips = " -Og" +BUILD_OPTIMIZATION:append:mips = " -O" -DEBUG_OPTIMIZATION_remove_mipsel = " -Og" -DEBUG_OPTIMIZATION_append_mipsel = " -O" -BUILD_OPTIMIZATION_remove_mipsel = " -Og" -BUILD_OPTIMIZATION_append_mipsel = " -O" +DEBUG_OPTIMIZATION:remove:mipsel = " -Og" +DEBUG_OPTIMIZATION:append:mipsel = " -O" +BUILD_OPTIMIZATION:remove:mipsel = " -Og" +BUILD_OPTIMIZATION:append:mipsel = " -O" PACKAGES_DYNAMIC += "^${PN}-plperl \ ^${PN}-pltcl \ ^${PN}-plpython \ " -python populate_packages_prepend() { +python populate_packages:prepend() { def fill_more(name): if name is None or name.strip() == "": @@ -123,7 +130,7 @@ do_configure() { # do_configure autotools_do_configure - # do_configure_append + # do_configure:append # workaround perl package related bugs sed -i -e "s:-L/usr/local/lib:-L=/usr/local/lib:g" \ ${B}/src/Makefile.global @@ -159,7 +166,7 @@ do_configure() { fi } -do_compile_append() { +do_compile:append() { oe_runmake -C contrib all } @@ -167,17 +174,18 @@ do_compile_append() { usernum = "28" groupnum = "28" USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \ +USERADD_PARAM:${PN} = "-M -g postgres -o -r -d ${localstatedir}/lib/${BPN} \ -s /bin/sh -c 'PostgreSQL Server' -u ${usernum} postgres" -GROUPADD_PARAM_${PN} = "-g ${groupnum} -o -r postgres" +GROUPADD_PARAM:${PN} = "-g ${groupnum} -o -r postgres" INITSCRIPT_PACKAGES = "${PN}" INITSCRIPT_NAME = "${BPN}-server" INITSCRIPT_PARAMS = "start 64 . stop 36 0 1 2 3 4 5 6 ." -do_install_append() { +do_install:append() { # install contrib oe_runmake DESTDIR=${D} -C contrib install + oe_multilib_header pg_config.h pg_config_ext.h ecpg_config.h postgresql/server/pg_config.h postgresql/server/pg_config_ext.h # install tutorial install -d -m 0755 ${D}${libdir}/${BPN}/tutorial install ${B}/src/tutorial/* ${D}${libdir}/${BPN}/tutorial @@ -200,7 +208,7 @@ do_install_append() { # multiple server config directory install -d -m 700 ${D}${sysconfdir}/default/${BPN} - if [ "${@d.getVar('enable_pam')}" = "pam" ]; then + if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then install -d ${D}${sysconfdir}/pam.d install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql fi @@ -210,10 +218,28 @@ do_install_append() { install -m 0644 ${WORKDIR}/postgresql.service ${D}${systemd_unitdir}/system sed -i -e 's,@BINDIR@,${bindir},g' \ ${D}${systemd_unitdir}/system/postgresql.service + # Remove the build path + if [ -f ${D}${libdir}/${BPN}/pgxs/src/Makefile.global ]; then + sed -i -e 's#${RECIPE_SYSROOT}##g' \ + -e 's#${RECIPE_SYSROOT_NATIVE}##g' \ + -e 's#${WORKDIR}##g' \ + -e 's#${TMPDIR}##g' \ + ${D}${libdir}/${BPN}/pgxs/src/Makefile.global + fi } SSTATE_SCAN_FILES += "Makefile.global" -SSTATE_SCAN_FILES_remove = "*_config" +SSTATE_SCAN_FILES:remove = "*_config" + +postgresql_fix_sources () { + for f in ${PKGD}${TARGET_DBGSRC_DIR}/src/pl/plperl/Util.c \ + ${PKGD}${TARGET_DBGSRC_DIR}/src/pl/plperl/SPI.c; do + if [ -e $f ]; then + sed -i -e 's#${B}/../${P}#${TARGET_DBGSRC_DIR}#g' $f + fi + done +} +PACKAGESPLITFUNCS =+ "postgresql_fix_sources" PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ libecpg-compat libecpg-compat-dev \ @@ -223,7 +249,7 @@ PACKAGES =+ "${PN}-client ${PN}-server-dev ${PN}-timezone \ ${PN}-contrib \ " -RPROVIDES_${PN}-dbg += "libecpg-compat-dbg \ +RPROVIDES:${PN}-dbg += "libecpg-compat-dbg \ libecpg-dbg \ libpq-dbg \ libpgtypes-dbg \ @@ -233,7 +259,7 @@ RPROVIDES_${PN}-dbg += "libecpg-compat-dbg \ ${PN}-plperl-dbg \ " -FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \ +FILES:${PN} += "${sysconfdir}/init.d/${BPN}-server \ ${localstatedir}/lib/${BPN}/data ${localstatedir}/lib/${BPN}/backups \ ${localstatedir}/lib/${BPN}/.profile ${sysconfdir}/default/${BPN} \ ${libdir}/${BPN}/dict_snowball.so ${libdir}/${BPN}/plpgsql.so \ @@ -245,7 +271,7 @@ FILES_${PN} += "${sysconfdir}/init.d/${BPN}-server \ else ''} \ " -FILES_${PN}-client = "${bindir}/clusterdb \ +FILES:${PN}-client = "${bindir}/clusterdb \ ${bindir}/createdb \ ${bindir}/createuser \ ${bindir}/dropdb \ @@ -259,7 +285,7 @@ FILES_${PN}-client = "${bindir}/clusterdb \ ${bindir}/vacuumlo \ ${datadir}/${BPN}/psqlrc.sample \ " -FILES_${PN}-client-doc = "${mandir}/man1/clusterdb.* \ +FILES:${PN}-client-doc = "${mandir}/man1/clusterdb.* \ ${mandir}/man1/createdb.* ${mandir}/man1/createlang.* \ ${mandir}/man1/createuser.* ${mandir}/man1/dropdb.* \ ${mandir}/man1/droplang.* ${mandir}/man1/dropuser.* \ @@ -268,46 +294,46 @@ FILES_${PN}-client-doc = "${mandir}/man1/clusterdb.* \ ${mandir}/man1/reindexdb.* ${mandir}/man1/vacuumdb.* \ ${mandir}/man7/* \ " -FILES_${PN}-doc += "${docdir}/${BPN}/html ${libdir}/${BPN}/tutorial/ \ +FILES:${PN}-doc += "${docdir}/${BPN}/html ${libdir}/${BPN}/tutorial/ \ ${mandir}/man1/initdb.* ${mandir}/man1/pg_controldata.* \ ${mandir}/man1/pg_ctl.* ${mandir}/man1/pg_resetxlog.* \ ${mandir}/man1/postgres.* ${mandir}/man1/postmaster.* \ " -FILES_${PN}-timezone = "${datadir}/${BPN}/timezone \ +FILES:${PN}-timezone = "${datadir}/${BPN}/timezone \ ${datadir}/${BPN}/timezonesets \ " -RDEPENDS_${PN} += "${PN}-timezone" -FILES_${PN}-server-dev = "${includedir}/${BPN}/server \ +RDEPENDS:${PN} += "${PN}-timezone" +FILES:${PN}-server-dev = "${includedir}/${BPN}/server \ ${libdir}/${BPN}/pgxs \ " -FILES_libecpg = "${libdir}/libecpg*${SOLIBS}" -FILES_libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \ +FILES:libecpg = "${libdir}/libecpg*${SOLIBS}" +FILES:libecpg-dev = "${libdir}/libecpg*${SOLIBSDEV} \ ${libdir}/libpgtypes*${SOLIBSDEV} \ ${includedir}/ecpg*.h ${includedir}/${BPN}/ecpg*.h \ ${includedir}/pgtypes*.h ${includedir}/${BPN}/informix \ ${includedir}/sql3types.h ${includedir}/sqlca.h \ " -FILES_libecpg-doc = "${mandir}/man1/ecpg.*" -FILES_libecpg-staticdev = "${libdir}/libecpg*.a" -SECTION_libecpg-staticdev = "devel" -RDEPENDS_libecpg-staticdev = "libecpg-dev (= ${EXTENDPKGV})" +FILES:libecpg-doc = "${mandir}/man1/ecpg.*" +FILES:libecpg-staticdev = "${libdir}/libecpg*.a" +SECTION:libecpg-staticdev = "devel" +RDEPENDS:libecpg-staticdev = "libecpg-dev (= ${EXTENDPKGV})" -FILES_libpq = "${libdir}/libpq*${SOLIBS}" -FILES_libpq-dev = "${libdir}/libpq*${SOLIBSDEV} \ +FILES:libpq = "${libdir}/libpq*${SOLIBS}" +FILES:libpq-dev = "${libdir}/libpq*${SOLIBSDEV} \ ${includedir} \ " -FILES_libpq-staticdev = "${libdir}/libpq*.a ${libdir}/libpgport.a" -SECTION_libpq-staticdev = "devel" -RDEPENDS_libpq-staticdev = "libpq-dev (= ${EXTENDPKGV})" +FILES:libpq-staticdev = "${libdir}/libpq*.a ${libdir}/libpgport.a" +SECTION:libpq-staticdev = "devel" +RDEPENDS:libpq-staticdev = "libpq-dev (= ${EXTENDPKGV})" -FILES_libecpg-compat = "${libdir}/libecpg_compat*${SOLIBS}" -FILES_libecpg-compat-dev = "${libdir}/libecpg_compat*${SOLIBS}" -FILES_libpgtypes = "${libdir}/libpgtypes*${SOLIBS}" -FILES_libpgtypes-staticdev = "${libdir}/libpgtypes*.a" -FILES_libpgtypes-dev = "${libdir}/libpgtypes*${SOLIBS} ${includedir}/pgtypes*.h" +FILES:libecpg-compat = "${libdir}/libecpg_compat*${SOLIBS}" +FILES:libecpg-compat-dev = "${libdir}/libecpg_compat*${SOLIBS}" +FILES:libpgtypes = "${libdir}/libpgtypes*${SOLIBS}" +FILES:libpgtypes-staticdev = "${libdir}/libpgtypes*.a" +FILES:libpgtypes-dev = "${libdir}/libpgtypes*${SOLIBS} ${includedir}/pgtypes*.h" -FILES_${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \ +FILES:${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \ ${bindir}/pgbench \ ${S}/contrib/spi/*.example \ ${libdir}/${BPN}/_int.so ${libdir}/${BPN}/adminpack.so \ @@ -335,27 +361,27 @@ FILES_${PN}-contrib = " ${bindir}/oid2name ${bindir}/pg_standby \ ${libdir}/${BPN}/pg_upgrade_support.so ${libdir}/${BPN}/.so \ ${libdir}/${BPN}/unaccent.so \ " -DESCRIPTION_${PN}-contrib = "The postgresql-contrib package contains \ +DESCRIPTION:${PN}-contrib = "The postgresql-contrib package contains \ contributed packages that are included in the PostgreSQL distribution." -FILES_${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \ +FILES:${PN}-pltcl = "${libdir}/${BPN}/pltcl.so ${bindir}/pltcl_delmod \ ${binddir}/pltcl_listmod ${bindir}/pltcl_loadmod \ ${datadir}/${BPN}/unknown.pltcl" -SUMMARY_${PN}-pltcl = "The Tcl procedural language for PostgreSQL" -DESCRIPTION_${PN}-pltcl = "PostgreSQL is an advanced Object-Relational \ +SUMMARY:${PN}-pltcl = "The Tcl procedural language for PostgreSQL" +DESCRIPTION:${PN}-pltcl = "PostgreSQL is an advanced Object-Relational \ database management system. The postgresql-pltcl package contains the PL/Tcl \ procedural language for the backend." -FILES_${PN}-plperl = "${libdir}/${BPN}/plperl.so" -SUMMARY_${PN}-plperl = "The Perl procedural language for PostgreSQL" -DESCRIPTION_${PN}-plperl = "PostgreSQL is an advanced Object-Relational \ +FILES:${PN}-plperl = "${libdir}/${BPN}/plperl.so" +SUMMARY:${PN}-plperl = "The Perl procedural language for PostgreSQL" +DESCRIPTION:${PN}-plperl = "PostgreSQL is an advanced Object-Relational \ database management system. The postgresql-plperl package contains the \ PL/Perl procedural language for the backend." # In version 8, it will be plpython.so # In version 9, it might be plpython{2,3}.so depending on python2 or 3 -FILES_${PN}-plpython = "${libdir}/${BPN}/plpython*.so" -SUMMARY_${PN}-plpython = "The Python procedural language for PostgreSQL" -DESCRIPTION_${PN}-plpython = "PostgreSQL is an advanced Object-Relational \ +FILES:${PN}-plpython = "${libdir}/${BPN}/plpython*.so" +SUMMARY:${PN}-plpython = "The Python procedural language for PostgreSQL" +DESCRIPTION:${PN}-plpython = "PostgreSQL is an advanced Object-Relational \ database management system. The postgresql-plpython package contains \ the PL/Python procedural language for the backend." |