[dev-db/postgresql] sync
This commit is contained in:
parent
c7ef7152b8
commit
cf35e3d9f3
@ -21,9 +21,8 @@ LICENSE="POSTGRESQL GPL-2"
|
|||||||
DESCRIPTION="PostgreSQL RDBMS"
|
DESCRIPTION="PostgreSQL RDBMS"
|
||||||
HOMEPAGE="https://www.postgresql.org/"
|
HOMEPAGE="https://www.postgresql.org/"
|
||||||
|
|
||||||
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam
|
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam perl python +readline
|
||||||
perl python +readline selinux +server systemd ssl static-libs tcl
|
selinux +server systemd ssl static-libs tcl uuid xml zlib zstd"
|
||||||
threads uuid xml zlib zstd"
|
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
|
||||||
@ -142,7 +141,6 @@ src_configure() {
|
|||||||
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
|
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
|
||||||
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
||||||
$(use_enable debug) \
|
$(use_enable debug) \
|
||||||
$(use_enable threads thread-safety) \
|
|
||||||
$(use_with icu) \
|
$(use_with icu) \
|
||||||
$(use_with kerberos gssapi) \
|
$(use_with kerberos gssapi) \
|
||||||
$(use_with ldap) \
|
$(use_with ldap) \
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
EAPI=8
|
EAPI=8
|
||||||
|
|
||||||
PYTHON_COMPAT=( python3_{9,10,11} )
|
PYTHON_COMPAT=( python3_{10,11,12} )
|
||||||
|
|
||||||
inherit flag-o-matic git-r3 linux-info pam python-single-r1 systemd tmpfiles
|
inherit flag-o-matic git-r3 linux-info meson pam python-single-r1 \
|
||||||
|
systemd tmpfiles
|
||||||
|
|
||||||
KEYWORDS=""
|
KEYWORDS=""
|
||||||
|
|
||||||
@ -17,9 +18,8 @@ LICENSE="POSTGRESQL GPL-2"
|
|||||||
DESCRIPTION="PostgreSQL RDBMS"
|
DESCRIPTION="PostgreSQL RDBMS"
|
||||||
HOMEPAGE="https://www.postgresql.org/"
|
HOMEPAGE="https://www.postgresql.org/"
|
||||||
|
|
||||||
IUSE="debug icu kerberos ldap llvm +lz4
|
IUSE="debug +icu kerberos ldap llvm +lz4 nls pam perl python +readline
|
||||||
nls pam perl python +readline selinux server systemd
|
selinux server systemd ssl static-libs tcl uuid xml zlib zstd"
|
||||||
ssl static-libs tcl threads uuid xml zlib zstd"
|
|
||||||
|
|
||||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ pkg_pretend() {
|
|||||||
if ! use server; then
|
if ! use server; then
|
||||||
elog "You are using a live ebuild that uses the current source code as it is"
|
elog "You are using a live ebuild that uses the current source code as it is"
|
||||||
elog "available from PostgreSQL's Git repository at emerge time. Given such,"
|
elog "available from PostgreSQL's Git repository at emerge time. Given such,"
|
||||||
elog "the GNU Makefiles may be altered by upstream without notice and the"
|
elog "the Meson build files may be altered by upstream without notice and the"
|
||||||
elog "documentation for this live version is not readily available"
|
elog "documentation for this live version is not readily available"
|
||||||
elog "online. Ergo, the ebuild maintainers will not support building a"
|
elog "online. Ergo, the ebuild maintainers will not support building a"
|
||||||
elog "client-only and/or document-free version."
|
elog "client-only and/or document-free version."
|
||||||
@ -127,69 +127,76 @@ src_prepare() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
|
local emesonargs=()
|
||||||
|
|
||||||
case ${CHOST} in
|
case ${CHOST} in
|
||||||
*-darwin*|*-solaris*)
|
*-darwin*|*-solaris*)
|
||||||
use nls && append-libs intl
|
use nls && append-libs intl
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export LDFLAGS_SL="${LDFLAGS}"
|
|
||||||
export LDFLAGS_EX="${LDFLAGS}"
|
|
||||||
|
|
||||||
local PO="${EPREFIX}"
|
|
||||||
|
|
||||||
local i uuid_config=""
|
local i uuid_config=""
|
||||||
if use uuid; then
|
if use uuid; then
|
||||||
for i in ${UTIL_LINUX_LIBC[@]}; do
|
for i in ${UTIL_LINUX_LIBC[@]}; do
|
||||||
use ${i} && uuid_config="--with-uuid=e2fs"
|
use ${i} && uuid_config="-Duuid=e2fs"
|
||||||
done
|
done
|
||||||
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
|
|
||||||
|
emesonargs+=( ${uuid_config:-"-Duuid=ossp"} )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local myconf="\
|
use debug && emesonargs+=( "--debug" )
|
||||||
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
|
|
||||||
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
|
local PO="${EPREFIX}"
|
||||||
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
|
emesonargs+=(
|
||||||
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
|
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}"
|
||||||
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
|
--datadir="${PO}/usr/share/postgresql-${SLOT}"
|
||||||
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
--includedir="${PO}/usr/include/postgresql-${SLOT}"
|
||||||
$(use_enable debug) \
|
--mandir="${PO}/usr/share/postgresql-${SLOT}/man"
|
||||||
$(use_enable nls) \
|
--sysconfdir="${PO}/etc/postgresql-${SLOT}"
|
||||||
$(use_enable threads thread-safety) \
|
-Dsystem_tzdata="${PO}/usr/share/zoneinfo"
|
||||||
$(use_with icu) \
|
$(meson_feature icu)
|
||||||
$(use_with kerberos gssapi) \
|
$(meson_feature kerberos gssapi)
|
||||||
$(use_with ldap) \
|
$(meson_feature ldap)
|
||||||
$(use_with llvm) \
|
$(meson_feature llvm)
|
||||||
$(use_with lz4) \
|
$(meson_feature lz4)
|
||||||
$(use_with pam) \
|
$(meson_feature nls)
|
||||||
$(use_with perl) \
|
$(meson_feature pam)
|
||||||
$(use_with python) \
|
$(meson_feature perl plperl)
|
||||||
$(use_with readline) \
|
$(meson_feature python plpython)
|
||||||
$(use_with ssl openssl) \
|
$(meson_feature readline)
|
||||||
$(use_with tcl) \
|
$(meson_feature systemd)
|
||||||
$(use_with xml libxml) \
|
$(meson_feature tcl pltcl)
|
||||||
$(use_with xml libxslt) \
|
$(meson_feature xml libxml)
|
||||||
$(use_with zlib) \
|
$(meson_feature xml libxslt)
|
||||||
$(use_with zstd ) \
|
$(meson_feature zlib)
|
||||||
$(use_with systemd) \
|
$(meson_feature zstd)
|
||||||
${uuid_config}"
|
)
|
||||||
if use alpha; then
|
|
||||||
myconf+=" --disable-spinlocks"
|
use ssl && emesonargs+=( "-Dssl=openssl" )
|
||||||
else
|
use alpha && emesonargs+=( "-Dspinlocks=false" )
|
||||||
# Should be the default but just in case
|
|
||||||
myconf+=" --enable-spinlocks"
|
export LDFLAGS_SL="${LDFLAGS}"
|
||||||
fi
|
export LDFLAGS_EX="${LDFLAGS}"
|
||||||
econf ${myconf}
|
|
||||||
|
meson_src_configure
|
||||||
}
|
}
|
||||||
|
|
||||||
src_compile() {
|
src_compile() {
|
||||||
emake world
|
meson_src_compile
|
||||||
|
meson_src_compile {docs,man}
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
emake DESTDIR="${D}" install-world
|
meson_src_install
|
||||||
|
|
||||||
dodoc README HISTORY doc/TODO
|
dodoc README HISTORY doc/TODO
|
||||||
|
dodoc -r "${BUILD_DIR}"/doc/src/sgml/html
|
||||||
|
|
||||||
|
# postgresql.eselect places the man files of the selected slot, which may
|
||||||
|
# not be this ${SLOT}, hence doins instead of doman
|
||||||
|
insinto /usr/share/postgresql-${SLOT}/man/
|
||||||
|
doins -r "${BUILD_DIR}"/doc/src/sgml/man{1,3,7}
|
||||||
|
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
|
||||||
|
|
||||||
insinto /etc/postgresql-${SLOT}
|
insinto /etc/postgresql-${SLOT}
|
||||||
newins src/bin/psql/psqlrc.sample psqlrc
|
newins src/bin/psql/psqlrc.sample psqlrc
|
||||||
@ -222,11 +229,8 @@ src_install() {
|
|||||||
-mindepth 1 -maxdepth 1)
|
-mindepth 1 -maxdepth 1)
|
||||||
do
|
do
|
||||||
bn=$(basename "${f}")
|
bn=$(basename "${f}")
|
||||||
# Temporarily tack on tmp to workaround a file collision
|
|
||||||
# issue. This is only necessary for 9.7 and earlier. 10 never
|
|
||||||
# had this issue.
|
|
||||||
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
|
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
|
||||||
"/usr/bin/${bn}${SLOT/.}tmp"
|
"/usr/bin/${bn}${SLOT/.}"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create slot specific man pages
|
# Create slot specific man pages
|
||||||
@ -259,40 +263,6 @@ src_install() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_preinst() {
|
|
||||||
# Find all of the slot-specific symlinks, if any, in /usr/bin (e.g.,
|
|
||||||
# /usr/bin/psql97). They may have been created by the
|
|
||||||
# postgresql.eselect module, but they're handled within this ebuild
|
|
||||||
# now. It's alright if we momentarily delete /usr/bin/psql as it
|
|
||||||
# will be recreated by the eselect module in pkg_ppostinst(). We
|
|
||||||
# only worry about the 9.7 slot as that's the last slot that had its
|
|
||||||
# slot-specific links generated by eselect.
|
|
||||||
#
|
|
||||||
# This can be removed when 10 is the lowest slot in the tree.
|
|
||||||
local canonicalise
|
|
||||||
if type -p realpath > /dev/null; then
|
|
||||||
canonicalise=realpath
|
|
||||||
elif type -p readlink > /dev/null; then
|
|
||||||
canonicalise='readlink -f'
|
|
||||||
else
|
|
||||||
# can't die, subshell
|
|
||||||
die "No readlink nor realpath found, cannot canonicalise"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local l
|
|
||||||
# First remove any symlinks in /usr/bin that may have been created
|
|
||||||
# by the old eselect
|
|
||||||
for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do
|
|
||||||
[[ $(${canonicalise} "${l}") == *postgresql-9.7* ]] && rm "${l}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Then move the symlinks created by the ebuild to their proper place.
|
|
||||||
for l in "${ED}"/usr/bin/*tmp ; do
|
|
||||||
mv "${l}" "${l%tmp}" \
|
|
||||||
|| ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
use systemd && tmpfiles_process ${PN}-${SLOT}.conf
|
use systemd && tmpfiles_process ${PN}-${SLOT}.conf
|
||||||
postgresql-config update
|
postgresql-config update
|
||||||
@ -460,7 +430,7 @@ src_test() {
|
|||||||
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
|
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
|
||||||
local old_ctype=${LC_CTYPE}
|
local old_ctype=${LC_CTYPE}
|
||||||
export LC_CTYPE=${LC_COLLATE}
|
export LC_CTYPE=${LC_COLLATE}
|
||||||
emake check
|
meson_src_test
|
||||||
export LC_CTYPE=${old_ctype}
|
export LC_CTYPE=${old_ctype}
|
||||||
|
|
||||||
einfo "If you think other tests besides the regression tests are necessary, please"
|
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||||
|
Loading…
Reference in New Issue
Block a user