Sync with portage [Fri Mar 31 08:19:53 MSK 2023].

master
root 1 year ago
parent 3284d1b2fe
commit 6b7243e20b

Binary file not shown.

Binary file not shown.

@ -11,7 +11,7 @@ SRC_URI="mirror://apache/httpd/httpd-${PV}.tar.bz2"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc64-solaris ~x64-solaris"
IUSE="ssl"
RESTRICT="test"

@ -1,6 +1,7 @@
DIST aws-cli-1.27.100.gh.tar.gz 2389951 BLAKE2B 02fac88ec2451c7c0f8b96c17c08e767ab629ab4480abf195023298aaf8b3f98f2fe5805da0051cbcc2fad0a93e5277dfaa38ffdf979d991f3873268ee530ffd SHA512 2a6f0be41d0d20edef0d5d2b75d455e928d82e373cdfc921f1fed5a189b42c11c5f08eb516d312caa5de13fd4a6139240233a7b0d4784640bb3b6dbfe5485895
DIST aws-cli-1.27.101.gh.tar.gz 2390624 BLAKE2B ccb01bf7d3349c709b095b7a1fe3b0e39f6fbc0e7239d39f7fd0ff4c6f716fe0df0190518cbf9765d04e38111bbca934c74970f5e1f55d5f69ceee1eb3f49160 SHA512 9184326d067c59517aeb5178fc308cf753c6b6a3b2e3489b040c1053a24b63d637e9b775e7de52e0e501f4ec69bb410bff4e4e8f8ec294d089b7aaa7f604e514
DIST aws-cli-1.27.102.gh.tar.gz 2390826 BLAKE2B b756ebd3f73d24f3456f4a1ece5230bc91335e2fd655220cfdfb85a4d853f6e18370adbf83ac650e6e5b375c681280bea414a1411fcda4a952f3788ddc11f1f5 SHA512 9a4018224bf1cd22377650ac5beabf44db3069196ef7bf21880edeb2e547e85b1ef9febb3355f22957d8c69e321a3be934ccf01ae817ab2151e1e51a503ad1b1
DIST aws-cli-1.27.103.gh.tar.gz 2392724 BLAKE2B 294a0cfc4d5ad4a258edf38728dced04d50937cadd5418b5be8fde36f75a3c0ffd8367db19b79ecbe0adc3467a09d8552222625bb0e6d6fde8d43ea0a04b7255 SHA512 771f28f6a6c3526aeee6b6487a018093b7ac60f4ecab4dec1af70a9dbc90ebcc39b56ffab6c5f3b965e27c545accc99910bfd28639f540dccb19461ccb237623
DIST aws-cli-1.27.89.gh.tar.gz 2382599 BLAKE2B 3a2dae3cc1928e149dd605de1e9a350989e1cf4f813dc14466ba40c0a2747e69b6a8c5716d48f2526920798f0d341dcaa7ec0c2fd95af1b5decd3830814a243b SHA512 9a90c933e5ae3f25271ec369607cb6c44adf96dc9d324205714c9790b6744d7f2c8e4c6b901d4bb4f58b6871c315e0543b3f846cf530e7f95ed31d196f8c3326
DIST aws-cli-1.27.94.gh.tar.gz 2385480 BLAKE2B 8712056c53d704e368f81d38779201d0ef28d0b633ac4a877957b5d6338a6daf45b5408dcf0bee3f6c48a0b10af625bfee835f63e837814b42ec3a57745e4d61 SHA512 48dc09f0af71eb9b9d93ffd2c008511e2379f2a47d4913c6c4296804d3ec3c30a1811564c017388329cac9261b1c3021fadc60771ca9d0952982401f5e4f7c59
DIST aws-cli-1.27.99.gh.tar.gz 2388286 BLAKE2B f9be204722470fdbc5b4a1f7453370033c78800dac6d4ca63480705988e6bd02899f0646c034f39a3e87a2988f79d9d23989ba9f4036e931102ca4c0e46989b1 SHA512 a07ac30eab8cd8f19f35bb7d203b6ef150c585a61df63dfa54d469591e57766f3cbdab3053a155837da82d1c9f702302f4821558c7b7cb9dc985fec7a58dacf1

@ -0,0 +1,80 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..11} )
inherit bash-completion-r1 distutils-r1 multiprocessing
MY_P=aws-cli-${PV}
DESCRIPTION="Universal Command Line Environment for AWS"
HOMEPAGE="
https://github.com/aws/aws-cli/
https://pypi.org/project/awscli/
"
SRC_URI="
https://github.com/aws/aws-cli/archive/${PV}.tar.gz
-> ${MY_P}.gh.tar.gz
"
S=${WORKDIR}/${MY_P}
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
# botocore is x.(y+2).z
BOTOCORE_PV="$(ver_cut 1).$(( $(ver_cut 2) + 2)).$(ver_cut 3-)"
RDEPEND="
>=dev-python/botocore-${BOTOCORE_PV}[${PYTHON_USEDEP}]
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/docutils[${PYTHON_USEDEP}]
dev-python/rsa[${PYTHON_USEDEP}]
>=dev-python/s3transfer-0.6.0[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
!app-admin/awscli-bin
"
BDEPEND="
test? (
dev-python/pytest-forked[${PYTHON_USEDEP}]
dev-python/pytest-xdist[${PYTHON_USEDEP}]
)
"
distutils_enable_tests pytest
src_prepare() {
# do not rely on bundled deps in botocore (sic!)
find -name '*.py' -exec sed -i \
-e 's:from botocore[.]vendored import:import:' \
-e 's:from botocore[.]vendored[.]:from :' \
{} + || die
# strip overzealous upper bounds on requirements
sed -i -e 's:,<[0-9.]*::' -e 's:==:>=:' setup.py || die
distutils-r1_src_prepare
}
python_test() {
local EPYTEST_DESELECT=(
# TODO
tests/functional/eks/test_kubeconfig.py::TestKubeconfigLoader::test_load_simple
tests/unit/customizations/eks/test_update_kubeconfig.py::TestKubeconfigSelector::test_choose_env_only
tests/unit/customizations/eks/test_update_kubeconfig.py::TestKubeconfigSelector::test_choose_existing
tests/unit/customizations/eks/test_kubeconfig.py::TestKubeconfigValidator::test_valid
)
# integration tests require AWS credentials and Internet access
epytest tests/{functional,unit} -n "$(makeopts_jobs)" --forked
}
python_install_all() {
newbashcomp bin/aws_bash_completer aws
insinto /usr/share/zsh/site-functions
newins bin/aws_zsh_completer.sh _aws
distutils-r1_python_install_all
rm "${ED}"/usr/bin/{aws.cmd,aws_bash_completer,aws_zsh_completer.sh} || die
}

@ -11,7 +11,7 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="dcron debug nls lm-sensors lto selinux systemd"
BDEPEND="

Binary file not shown.

@ -1,2 +1 @@
DIST backupninja-backupninja_upstream-1.2.1.tar.gz 186791 BLAKE2B 2e761b5538c77f359b2cc8b8c593589303f36b5b4d4d9f65457a1786cc671bdc57ad067c5bc7678fbe1afdd17406c3dedd641f2553213ec28186defd4b9d1fd4 SHA512 974276697f908cbf2203fd0cd3ebfe4f44c350714616d3a74191df4f9e101ce6d5f90cd2887dc06c5ed937ea19f9b72db28f5735255fae9d6db4faeaacee808c
DIST backupninja-backupninja_upstream-1.2.2.tar.gz 187862 BLAKE2B cfc2c31a4e53179f9167874d1d5785a9dfdb4bc0e891ea353b5f5ff44dc5eb4f86358b210a96327de9701f7e6913f7afbf8fe104fea138f8006835e2bf04a7e6 SHA512 a11085998ff7342baa242e31a64ddc1d6e6cabd43572435b444ef0523ef8644ed9d362392bfb5c8ade06fbf046fecccf5c05ba2ae4345c65551dddcaa25a13a6

@ -1,21 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="lightweight, extensible meta-backup system"
HOMEPAGE="https://0xacab.org/liberate/backupninja"
SRC_URI="https://0xacab.org/liberate/backupninja/-/archive/backupninja_upstream/${PV}/backupninja-backupninja_upstream-${PV}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
RDEPEND="dev-util/dialog"
DEPEND=""
S="${WORKDIR}/${PN}-${PN}_upstream-${PV}"
src_configure() {
econf --localstatedir=/var #578614
}

@ -1,2 +1 @@
DIST deja-dup-42.8.tar.bz2 1467818 BLAKE2B 6f02fc458890f076bf0a8e1ffdc9d72880fd9f1a692d439ecfa5d8b08234472f3ae27aa801144b3e42e9c8b67b550c0882dc93c23d27e6e428ce1eddd80a912d SHA512 76c98e8635ffae076008efa73a92860c6d4e67d39339d452c253269bb3ed032b819ac40d65c2d8fbf195ecaf304796f516e861b0552be972838f95bf59af0a5c
DIST deja-dup-43.4.tar.bz2 989830 BLAKE2B c67056b4498dbdb8f1346d682449e4a23070f052d6c4b3e205bd10da63148a6327666de79d163bd6450b34c130fedcdccc2053fabf7578a2d7d68decb325f510 SHA512 2413a3b1ef891e0151d61ee6fcec00f609f209da0faebe387dc8dba4abb55aa4ed925bdfee5768c7e8e8794bc9a793fb0769947030102aed57ac56983cd78943

@ -1,58 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit meson gnome2-utils vala xdg
DESCRIPTION="Simple backup tool using duplicity back-end"
HOMEPAGE="https://wiki.gnome.org/Apps/DejaDup"
SRC_URI="https://gitlab.gnome.org/World/deja-dup/-/archive/${PV}/${P}.tar.bz2"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="
$(vala_depend)
dev-util/intltool
dev-util/itstool
sys-devel/gettext
virtual/pkgconfig
test? ( dev-libs/appstream-glib )
"
DEPEND="
dev-libs/atk
>=app-backup/duplicity-0.7.14
>=app-crypt/libsecret-0.18.6[vala]
>=dev-libs/glib-2.64:2[dbus]
>=dev-libs/json-glib-1.2
dev-libs/libgpg-error
>=gui-libs/libhandy-1.0:1
>=net-libs/libsoup-2.48:2.4
x11-libs/gdk-pixbuf:2
>=x11-libs/gtk+-3.22:3
"
RDEPEND="${DEPEND}
gnome-base/dconf
gnome-base/gvfs[fuse]
"
src_prepare() {
default
vala_src_prepare
}
pkg_postinst() {
gnome2_schemas_update
xdg_icon_cache_update
}
pkg_postrm() {
gnome2_schemas_update
xdg_icon_cache_update
}

Binary file not shown.

@ -1,2 +1,3 @@
DIST apptainer-1.1.2.tar.gz 12896912 BLAKE2B 29a8df78617661e0a181955942e8321c112a69efaf15f4bb3e1563cc0789197916a3be1eb5396fb608d57b0edd5d5de2a70a2bda935095d8d511410660ebc106 SHA512 3fad253379a87ea790f22a14aec703296f606255d4ce847454a59f9dba0b9a6fc449489e7760c4696c1df90fc6abec198934310c1b762e33a83c72cafc7cb370
DIST apptainer-1.1.6.tar.gz 12914465 BLAKE2B a04ed9b9b429d7885d6c91f72d574d2a3a2955fdbe5cb2d30b59744b1f3bfb6f7d4f07ce7f1863caa83fb3361d7fdd2739b82334458d606ce053de43e1e9f755 SHA512 dd38abe1e343352e29a8a1fd1922901e4d48282fef641c75360253392ad53c6f1e5f7510ef612594e29db5f090fb41ff55b9d52d126be253450b0630fc7d383b
DIST apptainer-1.1.7.tar.gz 12926719 BLAKE2B ed12ae933166f03742c04551f3b231458e9ccd2d62184e965f91ab6f996bd32aa53b4efd6552e8f83a3735ff38bd48cb9c4450b9b6da064fe9029ea15555282e SHA512 10a4faa28f08961d483a63384671388d14ceedb150af752da576c035be79372401fd6ddb2eb5491569bb79b250c0f1e89e1b747463defc4a7f495610ebf2d371

@ -0,0 +1,92 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit linux-info toolchain-funcs
DESCRIPTION="The container system for secure high-performance computing"
HOMEPAGE="https://apptainer.org/"
SRC_URI="https://github.com/apptainer/${PN}/releases/download/v${PV}/${P}.tar.gz"
SLOT="0"
LICENSE="BSD"
KEYWORDS="~amd64 ~riscv ~x86 ~amd64-linux ~x86-linux"
IUSE="examples +network suid systemd"
# Do not complain about CFLAGS etc. since go projects do not use them.
QA_FLAGS_IGNORED='.*'
DEPEND="app-crypt/gpgme
>=dev-lang/go-1.17.6
dev-libs/openssl
sys-apps/util-linux
sys-fs/cryptsetup
sys-fs/squashfs-tools
sys-libs/libseccomp
!suid? (
sys-fs/e2fsprogs[fuse]
sys-fs/squashfuse
)"
RDEPEND="${DEPEND}
!sys-cluster/singularity"
BDEPEND="virtual/pkgconfig"
CONFIG_CHECK="~SQUASHFS"
PATCHES=(
"${FILESDIR}"/${PN}-1.0.2-trim_upstream_cflags.patch
)
DOCS=( README.md CONTRIBUTORS.md CONTRIBUTING.md )
src_configure() {
local myconfargs=(
-c "$(tc-getBUILD_CC)" \
-x "$(tc-getBUILD_CXX)" \
-C "$(tc-getCC)" \
-X "$(tc-getCXX)" \
--prefix="${EPREFIX}"/usr \
--sysconfdir="${EPREFIX}"/etc \
--runstatedir="${EPREFIX}"/run \
--localstatedir="${EPREFIX}"/var \
$(usex network "" "--without-network") \
$(use_with suid)
)
./mconfig -v ${myconfargs[@]} || die "Error invoking mconfig"
}
src_compile() {
emake -C builddir
}
src_install() {
emake DESTDIR="${D}" -C builddir install
keepdir /var/${PN}/mnt/session
if use systemd; then
sed -i -e '/systemd cgroups/ s/no/yes/' "${ED}"/etc/${PN}/${PN}.conf \
|| die "Failed to enable systemd use in configuration"
else
sed -i -e '/systemd cgroups/ s/yes/no/' "${ED}"/etc/${PN}/${PN}.conf \
|| die "Failed to disable systemd use in configuration"
fi
einstalldocs
if use examples; then
dodoc -r examples
fi
}
pkg_postinst() {
if ! use suid; then
local oldver
for oldver in ${REPLACING_VERSIONS}; do
if ver_test "${oldver}" -lt 1.1.0; then
ewarn "Since version 1.1.0 ${PN} no longer installs setuid-root components by default, relying on unprivileged user namespaces instead. For details, see https://apptainer.org/docs/admin/main/user_namespace.html"
ewarn "Make sure user namespaces (possibly except network ones for improved security) are enabled on your system, or re-enable installation of setuid root components by passing USE=suid to ${CATEGORY}/${PN}"
break
fi
done
fi
}

Binary file not shown.

@ -11,7 +11,7 @@ HOMEPAGE="https://wiki.gnome.org/Apps/Seahorse"
LICENSE="GPL-2+ FDL-1.1+"
SLOT="0"
IUSE="ldap zeroconf"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc x86"
RDEPEND="
>=dev-libs/glib-2.66:2

@ -13,7 +13,7 @@ SRC_URI="https://github.com/stefanberger/swtpm/archive/v${PV}.tar.gz -> ${P}.tar
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv ~x86"
KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv x86"
IUSE="fuse +gnutls seccomp test"
RESTRICT="!test? ( test )"

Binary file not shown.

@ -13,7 +13,7 @@ if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/ghex.git"
SRC_URI=""
else
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="amd64 ~arm ~ppc ppc64 ~riscv x86 ~amd64-linux ~x86-linux"
fi
LICENSE="GPL-2+ FDL-1.1+"

@ -16,7 +16,7 @@ if [[ ${PV} == 9999* ]] ; then
else
SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> vim-${PV}.tar.gz
https://gitweb.gentoo.org/proj/vim-patches.git/snapshot/vim-patches-vim-${VIM_PATCHES_VERSION}-patches.tar.bz2"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
fi
S="${WORKDIR}/vim-${PV}"

@ -21,7 +21,7 @@ if [[ ${PV} == 9999* ]] ; then
else
SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> ${P}.tar.gz
https://gitweb.gentoo.org/proj/vim-patches.git/snapshot/vim-patches-vim-${VIM_PATCHES_VERSION}-patches.tar.bz2"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
fi
DESCRIPTION="Vim, an improved vi-style text editor"

Binary file not shown.

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
USE_RUBY="ruby27 ruby30"
USE_RUBY="ruby30"
inherit autotools ruby-utils

Binary file not shown.

@ -13,7 +13,7 @@ SRC_URI="https://gitlab.freedesktop.org/geoclue/${PN}/-/archive/${PV}/${P}.tar.b
LICENSE="LGPL-2.1+ GPL-2+"
SLOT="2.0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~sparc x86"
IUSE="+introspection gtk-doc modemmanager vala zeroconf"
REQUIRED_USE="vala? ( introspection )"

@ -10,7 +10,7 @@ HOMEPAGE="https://wiki.gnome.org/Apps/Gnote"
LICENSE="GPL-3+ FDL-1.1"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
KEYWORDS="amd64 ~arm64 ~riscv x86"
IUSE="test"
RESTRICT="!test? ( test )"

Binary file not shown.

@ -11,7 +11,7 @@ HOMEPAGE="http://www.gnumeric.org/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
IUSE="+introspection libgda perl"
REQUIRED_USE="introspection? ( ${PYTHON_REQUIRED_USE} )"

Binary file not shown.

@ -1,3 +1,2 @@
DIST discount-2.2.7b.tar.bz2 102685 BLAKE2B 1af4d47248e4a65ea1517b03d0b1a0b15eb79bdb7d1f00779515e2a1113b2a923f5d9e5d0a93d63cfc6c7257f11d3825d9baa55c7f2252fe3d2513785ab67ae3 SHA512 d68ffb85ae3e6d6ce8a2e506609bd4cb042617e350d113dd632a1ed81adb0b076df75ca4e70e97d43f3a3a2907555a9f28087a3762f41806289c526af3c55806
DIST discount-2.2.7c.tar.gz 133282 BLAKE2B 3258cfa34d58ef5944ae5282f6df061b8183bccc1ca7f9f3a39b3c001a8b86a4deb86b80d109d937e334b2773e5065a0f6c212ac7a79317ce2ae665778a023e2 SHA512 2a959fb24d7291b3a8c6d659b5c904b8c2f8b6d9b0666e998ca5313533cc25898b9c2114f7922272f3bc6b9bfe4bc486fe08c620b4cb2a2282624e128dc92781
DIST discount-3.0.0a.tar.gz 140250 BLAKE2B 1e89f9c58c4d90157a9ccd925b89f098538c93191937e86eeefd32810e937feb78b6eeab96aead029fc35e4bf6699a40f67bdceb3c2d70fdc645fcd14091a3e7 SHA512 d86bfc6d3e11131622046418a1f54bd9dfa5f1233e510189cd2c89dc857da31e88ffbe6670cc506ca8b9763e8fb74ed215f1018f83e25767c77acb8a7c296b8a

@ -1,67 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit toolchain-funcs
DESCRIPTION="A Markdown-to HTML translator written in C"
HOMEPAGE="http://www.pell.portland.or.us/~orc/Code/discount/"
SRC_URI="http://www.pell.portland.or.us/~orc/Code/${PN}/${P}.tar.bz2"
LICENSE="BSD"
SLOT="0/2.2.7"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ppc ppc64 ~riscv sparc x86"
IUSE="minimal test"
RESTRICT="!test? ( test )"
src_prepare() {
default
# for QA, we remove the Makefiles usage of install -s.
# Drop ldconfig invocation.
# Force “librarian.sh” to respect LDFLAGS ($FLAGS should have CFLAGS
# at that point).
sed -i \
-e '/INSTALL_PROGRAM/s,\$_strip ,,' \
-e 's/\(LDCONFIG=\).*/\1:/' \
-e 's/\(.\)\$FLAGS/& \1$LDFLAGS/' \
configure.inc || die "sed configure.inc failed"
}
src_configure() {
local configure_call=(
./configure.sh
--libdir="${EPREFIX}/usr/$(get_libdir)"
--prefix="${EPREFIX}/usr"
--mandir="${EPREFIX}/usr/share/man"
--shared
--pkg-config
$(usex minimal '' --enable-all-features)
# Enable deterministic HTML generation behavior. Otherwise, will
# actually call rand() as part of its serialization code...
--debian-glitch
)
einfo "Running ${configure_call[@]}"
CC="$(tc-getCC)" AR="$(tc-getAR)" \
"${configure_call[@]}" || die
}
src_compile() {
emake libmarkdown
emake
}
src_install() {
emake \
DESTDIR="${D}" \
$(usex minimal install install.everything) \
SAMPLE_PFX="${PN}-"
}
pkg_postinst() {
if ! use minimal; then
elog 'Sample binaries with overly-generic names have been'
elog "prefixed with \"${PN}-\"."
fi
}

@ -11,7 +11,7 @@ SRC_URI="https://github.com/Orc/discount/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0/2.2.7"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ppc ppc64 ~riscv sparc x86"
IUSE="minimal test"
RESTRICT="!test? ( test )"

@ -9,7 +9,7 @@ SRC_URI="https://github.com/AbiWord/enchant/releases/download/v${PV}/${P}.tar.gz
LICENSE="LGPL-2.1+"
SLOT="2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-solaris"
IUSE="aspell +hunspell nuspell test voikko"
RESTRICT="!test? ( test )"

@ -1,3 +1,4 @@
DIST ghostscript-10.0.0.tar.xz 62749144 BLAKE2B 10b962d358994506b69aba34827ea9d6a86c61e5093d7371b8350ff29a74b1db4816d0a62ff64f5d0e5a652fcd0304224c6236d33e717299789dfb2c9f350e24 SHA512 660252841e9b24c411bc92d0eb104de464686131e70051f60108db1a6ecfe2ada2ccacbeed8f2ac84bf69338ad75c850e814c9ac4e0351943f9989d66b3b082d
DIST ghostscript-10.01.0.tar.xz 67564800 BLAKE2B 6b4b724158e7878f879e56154eaa399be0a53c97292e8df5b2a324ef329d83c31e85850d10b463e3e5373d5b47b7ac4a8b0d92769c76162b5e445292882ca831 SHA512 b679b35bcdcf211d6aa41a571225a50449e7e36def75cf37fee8f06889df3a5a9726a7aef2fd5ae819c2071cb6fcf8712741cd2c131c9341b60936e684bd8d98
DIST ghostscript-10.01.1.tar.xz 67567268 BLAKE2B 26f14f11362c7cd6e129044b8e094ad421fc607a702e1f5d10ae03b8ebfb1e76fc094281df739d6ebfa815c6080f1b2223036268474c41d795e2a1e5fc66bab2 SHA512 d944be9e8aef68d1176d64c40db6fa86d55d0c9e30047f2147c02806ab61cfe9ac2cb00d4e5b218ff3c51cc6ed47ceffe1bac4dd9d4cc1760b7974f30c6c2735
DIST ghostscript-gpl-10.0-patches.tar.xz 2980 BLAKE2B e2c20195b153bf45f374e84d91a4df1885a3696f4061340a0a2ac5f586b9723b45eade343ad0e5760e66616624b5f7dad82d62747040493d7ca40c13329b2df2 SHA512 dac26d7f75bbdc2a56891db7d607c2120717fdf8b1cd55c53ed3be09de3e0a62338585f4dac74496d634ce03ecb2212f386187e72b5e6b59debf8d07694e0c83

@ -0,0 +1,190 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools flag-o-matic toolchain-funcs
MY_PN=${PN/-gpl}
MY_P="${MY_PN}-${PV/_}"
PVM=$(ver_cut 1-2)
PVM_S=$(ver_rs 1-2 "")
# Use https://gitweb.gentoo.org/proj/codec/ghostscript-gpl-patches.git/ for patches
# See 'index' branch for README
MY_PATCHSET="ghostscript-gpl-10.0-patches.tar.xz"
DESCRIPTION="Interpreter for the PostScript language and PDF"
HOMEPAGE="https://ghostscript.com/ https://git.ghostscript.com/?p=ghostpdl.git;a=summary"
SRC_URI="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${PVM_S}/${MY_P}.tar.xz"
if [[ -n "${MY_PATCHSET}" ]] ; then
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${MY_PATCHSET}"
fi
LICENSE="AGPL-3 CPL-1.0"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="cups dbus gtk l10n_de static-libs unicode X"
LANGS="ja ko zh-CN zh-TW"
for X in ${LANGS} ; do
IUSE="${IUSE} l10n_${X}"
done
DEPEND="app-text/libpaper:=
media-libs/fontconfig
>=media-libs/freetype-2.4.9:2=
>=media-libs/jbig2dec-0.19:=
>=media-libs/lcms-2.6:2
>=media-libs/libpng-1.6.2:=
media-libs/libjpeg-turbo:=
>=media-libs/openjpeg-2.1.0:2=
>=media-libs/tiff-4.0.1:=
>=sys-libs/zlib-1.2.7
cups? ( >=net-print/cups-1.3.8 )
dbus? ( sys-apps/dbus )
gtk? ( x11-libs/gtk+:3 )
unicode? ( net-dns/libidn:= )
X? ( x11-libs/libXt x11-libs/libXext )"
BDEPEND="virtual/pkgconfig"
# bug #844115 for newer poppler-data dep
RDEPEND="${DEPEND}
>=app-text/poppler-data-0.4.11-r2
>=media-fonts/urw-fonts-2.4.9
l10n_ja? ( media-fonts/kochi-substitute )
l10n_ko? ( media-fonts/baekmuk-fonts )
l10n_zh-CN? ( media-fonts/arphicfonts )
l10n_zh-TW? ( media-fonts/arphicfonts )"
S="${WORKDIR}/${MY_P}"
src_prepare() {
if [[ -n ${MY_PATCHSET} ]] ; then
# apply various patches, many borrowed from Fedora
# https://src.fedoraproject.org/rpms/ghostscript
# and Debian
# https://salsa.debian.org/printing-team/ghostscript/-/tree/debian/latest/debian/patches
eapply "${WORKDIR}"/${MY_PATCHSET%%.tar*}
fi
default
# Remove internal copies of various libraries
rm -r cups/libs || die
rm -r freetype || die
rm -r jbig2dec || die
rm -r jpeg || die
rm -r lcms2mt || die
rm -r libpng || die
rm -r tiff || die
rm -r zlib || die
rm -r openjpeg || die
# Remove internal CMaps (CMaps from poppler-data are used instead)
rm -r Resource/CMap || die
if ! use gtk ; then
sed -e "s:\$(GSSOX)::" \
-e "s:.*\$(GSSOX_XENAME)$::" \
-i base/unix-dll.mak || die "sed failed"
fi
# Force the include dirs to a neutral location.
sed -e "/^ZLIBDIR=/s:=.*:=${T}:" \
-i configure.ac || die
# Some files depend on zlib.h directly. Redirect them. #573248
# Also make sure to not define OPJ_STATIC to avoid linker errors due to
# hidden symbols (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203327#c1)
sed -e '/^zlib_h/s:=.*:=:' \
-e 's|-DOPJ_STATIC ||' \
-i base/lib.mak || die
# Search path fix
# put LDFLAGS after BINDIR, bug #383447
sed -e "s:\$\(gsdatadir\)/lib:@datarootdir@/ghostscript/${PV}/$(get_libdir):" \
-e "s:exdir=.*:exdir=@datarootdir@/doc/${PF}/examples:" \
-e "s:docdir=.*:docdir=@datarootdir@/doc/${PF}/html:" \
-e "s:GS_DOCDIR=.*:GS_DOCDIR=@datarootdir@/doc/${PF}/html:" \
-e 's:-L$(BINDIR):& $(LDFLAGS):g' \
-i Makefile.in base/*.mak || die "sed failed"
# Remove incorrect symlink, bug 590384
rm ijs/ltmain.sh || die
eautoreconf
cd ijs || die
eautoreconf
}
src_configure() {
# Unsupported upstream, bug #884841
filter-lto
local FONTPATH
for path in \
"${EPREFIX}"/usr/share/fonts/urw-fonts \
"${EPREFIX}"/usr/share/fonts/Type1 \
"${EPREFIX}"/usr/share/fonts
do
FONTPATH="${FONTPATH}${FONTPATH:+:}${EPREFIX}${path}"
done
# Do not add --enable-dynamic here, it's not supported fully upstream
# https://bugs.ghostscript.com/show_bug.cgi?id=705895
# bug #884707
#
# leptonica and tesseract are bundled but modified upstream, like in
# mujs/mupdf.
PKGCONFIG=$(type -P $(tc-getPKG_CONFIG)) econf \
--enable-freetype \
--enable-fontconfig \
--enable-openjpeg \
--disable-compile-inits \
--with-drivers=ALL \
--with-fontpath="${FONTPATH}" \
--with-ijs \
--with-jbig2dec \
--with-libpaper \
--with-system-libtiff \
$(use_enable cups) \
$(use_enable dbus) \
$(use_enable gtk) \
$(use_with cups pdftoraster) \
$(use_with unicode libidn) \
$(use_with X x) \
DARWIN_LDFLAGS_SO_PREFIX="${EPREFIX}/usr/lib/"
cd "${S}/ijs" || die
econf \
--enable-shared \
$(use_enable static-libs static)
}
src_compile() {
emake so all
cd ijs || die
emake
}
src_install() {
emake DESTDIR="${D}" install-so install
# move gsc to gs, bug #343447
# gsc collides with gambit, bug #253064
mv -f "${ED}"/usr/bin/{gsc,gs} || die
cd "${S}/ijs" || die
emake DESTDIR="${D}" install
# Sometimes the upstream versioning deviates from the tarball(!)
# bug #844115#c32
local my_gs_version=$(find "${ED}"/usr/share/ghostscript/ -maxdepth 1 -mindepth 1 -type d || die)
my_gs_version=${my_gs_version##*/}
# Install the CMaps from poppler-data properly, bug #409361
dosym -r /usr/share/poppler/cMaps /usr/share/ghostscript/${my_gs_version}/Resource/CMap
if ! use static-libs; then
find "${ED}" -name '*.la' -delete || die
fi
}

@ -14,7 +14,7 @@ SRC_URI="https://salsa.debian.org/${PN}-team/${PN}/-/archive/v${PV}/${PN}-v${PV}
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
BDEPEND="${PYTHON_DEPS}
sys-devel/gettext

@ -16,8 +16,9 @@ SLOT="0"
KEYWORDS="~amd64 ~ppc ~riscv ~x86"
IUSE="nls"
# wxGTK version cap is due to Bug #895982
RDEPEND=">=dev-libs/chmlib-0.36
x11-libs/wxGTK:${WX_GTK_VER}[X]
<x11-libs/wxGTK-3.2.2.1:${WX_GTK_VER}[X]
nls? ( virtual/libintl )"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"

Binary file not shown.

@ -1 +1,2 @@
DIST msgpack-cxx-5.0.0.tar.gz 476103 BLAKE2B e631a47e8d39b6ad9c2dd5e782fbbd5044c177e18c619fb52d1293e2c5f2ea7e766e7b26ce6cac36a2ff98217143e12456e0541992afb4f78597ffd3852f2acf SHA512 5ee0237eb1bf05bd4becad32ab145a8f0654f8f0e2e3452331ed3df088cda03ee4cdf1557ba867447e3e18baed924c105c76934f7009dac98b6dc69282c39d0c
DIST msgpack-cxx-6.0.0.tar.gz 476132 BLAKE2B 89b6505511bd8f6994a2e61661c7a33bd1aa68804c081ec2fcaf074f845caf4338ac362916af9fb0bab7285b0d0508c74b229316fa75ef8083546ac84c4ca95d SHA512 90f89216676af5a656d570fbff5a716d1177fa1941b0a928b2da20e0b6cd6d0ca880b7369e085dbbca944499c05694a73df919042d8cd78498ed4b34b77a0e9d

@ -0,0 +1,59 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
DESCRIPTION="MessagePack for C++"
HOMEPAGE="https://msgpack.org/ https://github.com/msgpack/msgpack-c/"
SRC_URI="https://github.com/msgpack/msgpack-c/releases/download/cpp-${PV}/${P}.tar.gz"
LICENSE="Boost-1.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="+boost doc examples test"
REQUIRED_USE="test? ( boost )"
RESTRICT="!test? ( test )"
RDEPEND="boost? ( dev-libs/boost[context] )
!<dev-libs/msgpack-5.0.0"
DEPEND="${RDEPEND}"
BDEPEND="doc? ( app-doc/doxygen[dot] )
test? ( sys-libs/zlib )"
src_configure() {
local mycmakeargs=(
-DMSGPACK_BUILD_EXAMPLES=OFF
-DMSGPACK_CXX17=ON
-DMSGPACK_BUILD_TESTS="$(usex test)"
-DMSGPACK_USE_BOOST="$(usex boost)"
-DMSGPACK_USE_X3_PARSE="$(usex boost)"
)
cmake_src_configure
}
src_compile() {
cmake_src_compile
if use doc; then
cmake_build doxygen
fi
}
src_install() {
if use doc; then
local HTML_DOCS=( "${BUILD_DIR}"/doc_cpp/html/. )
fi
if use examples; then
docinto examples
dodoc -r example/.
docompress -x /usr/share/doc/${PF}/examples
fi
cmake_src_install
}

Binary file not shown.

@ -1,17 +1,6 @@
DIST postgresql-10.22.tar.bz2 19455874 BLAKE2B 10a8a894ba6e649abcc68abfd829bd30bca04b6e90f987ae5771fe02474517254ea2b48c7c9f2a899309de7b84aeaf13bac025965a9cc44814727ba257a633d7 SHA512 2e1ea75be7696ffbbb947351a8e8e55aaf067f86ad318308499a6a58797f0bf86227ed33e257e261c5c71ebba2f73ba514ef195a2394b91414ce6a0c3ab62532
DIST postgresql-10.23.tar.bz2 19485297 BLAKE2B 71045313ab03a6c0382c88d5c817c7d1647b0e2feba511b8a09e2f6ec2c1b9473d50aa29777b159f1362695a5a742471b00676bc85a25c80c9801761b6edb1e2 SHA512 9fd031cad0c3caacae105215167abd5dc4fdd15dea77a12cb0a977fab6e245e3fda163f202cc7786e50c69e5c3f180d32676a3b18ea30a9a14f0bcab56aa19dd
DIST postgresql-11.17.tar.bz2 20385599 BLAKE2B d145bc0f5e0f277be91bf46868c78c9ce5bb2eebbbd84fbdcdbb1ec115911d124a0a054df783739fb912eeae1322fb7eb58b7b1b8d40a8f81cffe2f24d3dda01 SHA512 35304279c06577eca134581490710db976edeac8cca169d3436fcdce8eebb18159459ea3b5ef403f6a8efe85542726f9960c4ca653da4619e081ce5869866032
DIST postgresql-11.18.tar.bz2 20428126 BLAKE2B f0f01cb1f479032615b1b15e37d5c9955c560218de5e5cb480d920253a23615636fd8ed5e5310bdc1f80dc1f6da81cbb2ca41b90b0cc095139b6d9b59fc57d78 SHA512 17b4f9a0200814ae210076a677b9c68375d896bb1817b4f8b327ee208da9a1672625cdcbd213af2b01fe501a051436e9acf5cc9ed0a2b798f257d07b08cdf1b8
DIST postgresql-11.19.tar.bz2 20457793 BLAKE2B f20767ef3e05766f9ff085e401bf1ad14318db625b33459dd63a981228601443694025d9fc366a072661b80d9fb10a9fd1fd22876c66b916304d1eaa0543c7ec SHA512 0b9247d82a0eaddd8254799197c3bef1ba47a633f616a556167ebcf956961a50955c11e98034a717fb77ff18987ccb8fd80b98588c2ec3c70fd2d62bc27fe05b
DIST postgresql-12.12.tar.bz2 21089064 BLAKE2B 7285dcfc8ed6cf2dbbe29d894dbcef53fad18cbeddbfdb3a43893234a1ee75a9bf5d966968a0c481a8ab15bf8a37400bf6eb4b57a83359501b729e70398e3551 SHA512 eeff79279ac11db04fdddeb2c52ba1ec6b549223b862222540e1f659fbfc3617130699c22694b465bde46b1a4a665c01aef70b68b86d80e58a5657efd019407d
DIST postgresql-12.13.tar.bz2 21114311 BLAKE2B df168e29090376379b0e0de18f31f7d5c6c1297e9763c5ce2b0d453a36fabaec3477461b431fb319246d5fbc6c01f4a00dcc9172b29f1bc0b13041b009f6e68f SHA512 a502236dcc4c56645dd57ed3c920d996adace3bc3a855c869344c8580393ad4c6ad17503928564683817066f6e9c5794f3d214b5f8e3b900ebb23474673bac24
DIST postgresql-12.14.tar.bz2 21124742 BLAKE2B c77015244a71485f386983f0b86b4d4e0a1880b1b9d544a7e465e19cc561fde3f6de02ff64bb3afefbe483c457aa9584147212753408828e884e2089e8e7e7ba SHA512 a859067119cc21702ab1af6507bf703e4263d9399745cd7b025a3c73d55367ba0f960fd2b1b4af43e73b8448bb2e52555734d60a5f306041719190f28a8bd505
DIST postgresql-13.10.tar.bz2 21457594 BLAKE2B fa73d774b9f7a36a9749b5e8a082f0f31e4bcc707995748bfc67f7b900e1c83f5af57d953add58b38be959a3900373f000c06e9f35d7df628e2c219d67b41cde SHA512 328c81f7c2ca2bad92fa62f4b0377d7cc104f294636db019c68ceccb580003eebe79455bbafa24eab2b3cce305e3d9c702a8544b38556f9c3431cc3c78d00cff
DIST postgresql-13.8.tar.bz2 21397381 BLAKE2B eb076382027a175789652a6ae8579d9b9c8856918741e8058456d22f1ef89525cff5fafe863bf615f658bc94b740b00d1268825969e37a7cefed6b5c90f402c5 SHA512 3b39448b291342a5e9b610d410c222aeb85f8acf95632e73e138ae316133af3dadc795a6e706f6447f543cf10df3c786da4f1afa1d91489b50eb77e2d9ed5d84
DIST postgresql-13.9.tar.bz2 21439045 BLAKE2B be653bcfa619af9319357f52aa7a289a6701cfb511574e60ea8321e6d5c646223e783343bdabbc43c151e10e8c50446d77b688a3d2d306a7d439019ec3fb3854 SHA512 7f226d917c97752a49bb603829789c02820d5a746e89bf879b63cad6ce22b0000762a2f5584af1a928fcb9a444abbf78f6fd8761898291830a21ac42b2d72858
DIST postgresql-14.5.tar.bz2 22132996 BLAKE2B 6d303850ef1e8f9f5d66a53275fc814475646c762b9747a4f0401a472ebaf59be06d6e7c08e9c1c5ad5d3b9dbc3bb3c06d58bae137806e1a437c86bcc8cae501 SHA512 3051c5ab729f6a55952c6108098b022517398b1de64f7fefbdd6c806c7e2eb0637d00f3c98a6203c5bee654656528c4ff3530db5a69470e7888864c77900178a
DIST postgresql-14.6.tar.bz2 22177474 BLAKE2B 675283751a51500382395cb07a956fa0392987f938e12c0757c4c537327aa119d62fe86c78372d7607ae1ff4c811a567ffb89a8c087d2d029c32bd7271733fb6 SHA512 133083eb5709ace65dd81d326a960654dd6cfb35b3e85a35f71763c59dad0052a561c2aa1d1f52652b4bf81ed71edd232f170d483989d65ca354e653331faf2e
DIST postgresql-14.7.tar.bz2 22182073 BLAKE2B ad07ce5852b10c44a40c3ce2e991b806b8067cba09046715de76a672142517cd7ea633872235595b39b3fb41d4bfd11a56c6cda74703e821b3896206b1e68801 SHA512 931c3850d09a90b44b986f0ea6eb96eb549919ffd28ca71a7f1896e40dbbbc77601179d480c614f80cf67e5c1a4ccb4d38e06c846c13262723de621463a95508
DIST postgresql-15.0.tar.bz2 22403741 BLAKE2B b5ac4ad23a92dc7f33278d551a40fb4e2f5bd770415eaf002f50f2ba224e279ba95f2fd76705b625c571f23dec502f032ffe1c349de3816b6bc0a3b1773996fb SHA512 537d223be619d8b192756791cb614638f7188532f981e233bbfa8c0245adf5afe94ba5160d771af77f7d4ead41bcf346cbb2197e1358a6411ead06b19e29f120
DIST postgresql-15.1.tar.bz2 22666134 BLAKE2B 964607856637764cedf3f832a49ca673e22e2fa2afe9a141c98b0b4a1dfc5c978928f4c3ec470395dea041e8f1fdc218d54796c72ff597c819ad03e95d1730db SHA512 803900363106d2e343305e6d1546016b6a6a37bbd49d7a84a9a6467c1dc3fc4eb52698411af9c2178590c2f7680967466b1a211a76955dcec5445d0b8b254202
DIST postgresql-15.2.tar.bz2 22688379 BLAKE2B 5f8b8b111122a4cdd7913132491b9dc9287bc725d5310004e94a05c8994ce4e9e9c7a6abb26e13a6f77bc2e04bbda06d81393ce31d6372e4f05f5d07796274fe SHA512 115a8a4234791bba4e6dcc4617e9dd77abedcf767894ce9472c59cce9d5d4ef2d4e1746f3a0c7a99de4fc4385fb716652b70dce9f48be45a9db5a682517db7e8

@ -1,453 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
inherit flag-o-matic linux-info pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap nls pam perl
python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libcrypt:=
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Work around PPC{,64} compilation bug where bool is already defined
sed '/#ifndef __cplusplus/a #undef bool' -i src/include/c.h || die
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-10.2-no-server.patch"
if use pam ; then
sed -e "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
# https://bugs.gentoo.org/753257
# https://bugs.gentoo.org/766225
eapply "${FILESDIR}"/postgresql-10.0-icu68.patch
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "${DATA_DIR}"
chown -Rf postgres:postgres "${DATA_DIR}"
chmod 0700 "${DATA_DIR}"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -7,7 +7,7 @@ PYTHON_COMPAT=( python3_{9,10,11} )
inherit flag-o-matic linux-info pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc ~x86 ~ppc-macos ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos ~x86-solaris"
SLOT=$(ver_cut 1)

@ -1,453 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-15:=
<sys-devel/clang-15:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,453 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=15
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-16:=
<sys-devel/clang-16:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY doc/{TODO,bug.template}
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -8,7 +8,7 @@ LLVM_MAX_SLOT=16
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)

@ -1,453 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-15:=
<sys-devel/clang-15:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,453 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=15
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-16:=
<sys-devel/clang-16:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-12.1-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
econf \
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable !alpha spinlocks) \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
emake check
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -8,7 +8,7 @@ LLVM_MAX_SLOT=16
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)

@ -8,7 +8,7 @@ LLVM_MAX_SLOT=16
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)

@ -1,465 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-15:=
<sys-devel/clang-15:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-13.8-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,465 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=15
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-16:=
<sys-devel/clang-16:=
)
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
eapply "${FILESDIR}"/${PN}-13.3-riscv-spinlocks.patch
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-13.8-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,465 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-15:=
<sys-devel/clang-15:=
)
lz4? ( app-arch/lz4 )
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-14.5-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with lz4) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,465 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=15
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-16:=
<sys-devel/clang-16:=
)
lz4? ( app-arch/lz4 )
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-14.5-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with lz4) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -8,7 +8,7 @@ LLVM_MAX_SLOT=16
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)

@ -1,467 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib zstd"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-15:=
<sys-devel/clang-15:=
)
lz4? ( app-arch/lz4 )
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
zstd? ( app-arch/zstd )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-15_beta3-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with lz4) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_with zstd) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -1,467 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9,10,11} )
LLVM_MAX_SLOT=15
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)
MY_PV=${PV/_/}
S="${WORKDIR}/${PN}-${MY_PV}"
SRC_URI="https://ftp.postgresql.org/pub/source/v${MY_PV}/postgresql-${MY_PV}.tar.bz2"
LICENSE="POSTGRESQL GPL-2"
DESCRIPTION="PostgreSQL RDBMS"
HOMEPAGE="https://www.postgresql.org/"
IUSE="debug doc icu kerberos ldap llvm lz4 nls pam
perl python +readline selinux +server systemd ssl static-libs tcl
threads uuid xml zlib zstd"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
CDEPEND="
>=app-eselect/eselect-postgresql-2.0
acct-group/postgres
acct-user/postgres
sys-apps/less
virtual/libintl
icu? ( dev-libs/icu:= )
kerberos? ( virtual/krb5 )
ldap? ( net-nds/openldap:= )
llvm? (
<sys-devel/llvm-16:=
<sys-devel/clang-16:=
)
lz4? ( app-arch/lz4 )
pam? ( sys-libs/pam )
perl? ( >=dev-lang/perl-5.8:= )
python? ( ${PYTHON_DEPS} )
readline? ( sys-libs/readline:0= )
server? ( systemd? ( sys-apps/systemd ) )
ssl? ( >=dev-libs/openssl-0.9.6-r1:0= )
tcl? ( >=dev-lang/tcl-8:0= )
xml? ( dev-libs/libxml2 dev-libs/libxslt )
zlib? ( sys-libs/zlib )
zstd? ( app-arch/zstd )
"
# uuid flags -- depend on sys-apps/util-linux for Linux libcs, or if no
# supported libc in use depend on dev-libs/ossp-uuid. For BSD systems,
# the libc includes UUID functions.
UTIL_LINUX_LIBC=( elibc_{glibc,musl} )
nest_usedep() {
local front back
while [[ ${#} -gt 1 ]]; do
front+="${1}? ( "
back+=" )"
shift
done
echo "${front}${1}${back}"
}
CDEPEND+="
uuid? (
${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )}
$(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} dev-libs/ossp-uuid)
)"
DEPEND="${CDEPEND}
sys-devel/bison
sys-devel/flex
nls? ( sys-devel/gettext )
xml? ( virtual/pkgconfig )
"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-postgresql )
"
pkg_setup() {
use llvm && llvm_pkg_setup
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
use python && python-single-r1_pkg_setup
}
src_prepare() {
# Set proper run directory
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
-i src/include/pg_config_manual.h || die
# Rely on $PATH being in the proper order so that the correct
# install program is used for modules utilizing PGXS in both
# hardened and non-hardened environments. (Bug #528786)
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
use server || eapply "${FILESDIR}/${PN}-15_beta3-no-server.patch"
if use pam ; then
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
-i src/backend/libpq/auth.c || \
die 'PGSQL_PAM_SERVICE rename failed.'
fi
eapply_user
}
src_configure() {
case ${CHOST} in
*-darwin*|*-solaris*)
use nls && append-libs intl
;;
esac
export LDFLAGS_SL="${LDFLAGS}"
export LDFLAGS_EX="${LDFLAGS}"
local PO="${EPREFIX}"
local i uuid_config=""
if use uuid; then
for i in ${UTIL_LINUX_LIBC[@]}; do
use ${i} && uuid_config="--with-uuid=e2fs"
done
[[ -z $uuid_config ]] && uuid_config="--with-uuid=ossp"
fi
local myconf="\
--prefix="${PO}/usr/$(get_libdir)/postgresql-${SLOT}" \
--datadir="${PO}/usr/share/postgresql-${SLOT}" \
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
$(use_enable debug) \
$(use_enable threads thread-safety) \
$(use_with icu) \
$(use_with kerberos gssapi) \
$(use_with ldap) \
$(use_with llvm) \
$(use_with lz4) \
$(use_with pam) \
$(use_with perl) \
$(use_with python) \
$(use_with readline) \
$(use_with ssl openssl) \
$(usex server "$(use_with systemd)" '--without-systemd') \
$(use_with tcl) \
${uuid_config} \
$(use_with xml libxml) \
$(use_with xml libxslt) \
$(use_with zlib) \
$(use_with zstd) \
$(use_enable nls)"
if use alpha; then
myconf+=" --disable-spinlocks"
else
# Should be the default but just in case
myconf+=" --enable-spinlocks"
fi
econf ${myconf}
}
src_compile() {
emake
emake -C contrib
}
src_install() {
emake DESTDIR="${D}" install
emake DESTDIR="${D}" install -C contrib
dodoc README HISTORY
# man pages are already built, but if we have the target make them,
# they'll be generated from source before being installed so we
# manually install man pages.
# We use ${SLOT} instead of doman for postgresql.eselect
insinto /usr/share/postgresql-${SLOT}/man/
doins -r doc/src/sgml/man{1,3,7}
if ! use server; then
# Remove man pages for non-existent binaries
serverman=(
initdb
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
pg_{test_{fsync,timing},upgrade,waldump}
post{gres,master}
)
for m in ${serverman[@]} ; do
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
done
fi
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
# Create slot specific man pages
local bn f mansec slotted_name
for mansec in 1 3 7 ; do
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
bn=$(basename "${f}")
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
case ${bn} in
TABLE.7|WITH.7)
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
;;
*)
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
;;
esac
done
popd > /dev/null
done
insinto /etc/postgresql-${SLOT}
newins src/bin/psql/psqlrc.sample psqlrc
# Don't delete libpg{port,common}.a (Bug #571046). They're always
# needed by extensions utilizing PGXS.
use static-libs || \
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
-delete
# Make slot specific links to programs
local f bn
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
-mindepth 1 -maxdepth 1)
do
bn=$(basename "${f}")
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
"/usr/bin/${bn}${SLOT/.}"
done
if use doc ; then
docinto html
dodoc doc/src/sgml/html/*
fi
if use server; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
if use systemd; then
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
"${FILESDIR}/${PN}.service-9.6-r1" | \
systemd_newunit - ${PN}-${SLOT}.service
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf
fi
use pam && pamd_mimic system-auth ${PN}-${SLOT} auth account session
if use prefix ; then
keepdir /run/postgresql
fperms 1775 /run/postgresql
fi
fi
}
pkg_postinst() {
use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf
postgresql-config update
elog "If you need a global psqlrc-file, you can place it in:"
elog " ${EROOT}/etc/postgresql-${SLOT}/"
if use server ; then
elog
elog "Gentoo specific documentation:"
elog "https://wiki.gentoo.org/wiki/PostgreSQL"
elog
elog "Official documentation:"
elog "https://www.postgresql.org/docs/${SLOT}/static/index.html"
elog
elog "The default location of the Unix-domain socket is:"
elog " ${EROOT}/run/postgresql/"
elog
elog "Before initializing the database, you may want to edit PG_INITDB_OPTS"
elog "so that it contains your preferred locale in:"
elog " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
elog
elog "Then, execute the following command to setup the initial database"
elog "environment:"
elog " emerge --config =${CATEGORY}/${PF}"
if [[ -n ${REPLACING_VERSIONS} ]] ; then
ewarn "If your system is using 'pg_stat_statements' and you are running a"
ewarn "version of PostgreSQL ${SLOT}, we advise that you execute"
ewarn "the following command after upgrading:"
ewarn
ewarn "ALTER EXTENSION pg_stat_statements UPDATE;"
fi
fi
}
pkg_prerm() {
if use server && [[ -z ${REPLACED_BY_VERSION} ]] ; then
ewarn "Have you dumped and/or migrated the ${SLOT} database cluster?"
ewarn "\thttps://wiki.gentoo.org/wiki/PostgreSQL/QuickStart#Migrating_PostgreSQL"
ebegin "Resuming removal in 10 seconds (Control-C to cancel)"
sleep 10
eend 0
fi
}
pkg_postrm() {
postgresql-config update
}
pkg_config() {
use server || die "USE flag 'server' not enabled. Nothing to configure."
[[ -f "${EROOT}/etc/conf.d/postgresql-${SLOT}" ]] \
&& source "${EROOT}/etc/conf.d/postgresql-${SLOT}"
[[ -z "${PGDATA}" ]] && PGDATA="${EROOT}/etc/postgresql-${SLOT}/"
[[ -z "${DATA_DIR}" ]] \
&& DATA_DIR="${EROOT}/var/lib/postgresql/${SLOT}/data"
# environment.bz2 may not contain the same locale as the current system
# locale. Unset and source from the current system locale.
if [ -f "${EROOT}/etc/env.d/02locale" ]; then
unset LANG
unset LC_CTYPE
unset LC_NUMERIC
unset LC_TIME
unset LC_COLLATE
unset LC_MONETARY
unset LC_MESSAGES
unset LC_ALL
source "${EROOT}/etc/env.d/02locale"
[ -n "${LANG}" ] && export LANG
[ -n "${LC_CTYPE}" ] && export LC_CTYPE
[ -n "${LC_NUMERIC}" ] && export LC_NUMERIC
[ -n "${LC_TIME}" ] && export LC_TIME
[ -n "${LC_COLLATE}" ] && export LC_COLLATE
[ -n "${LC_MONETARY}" ] && export LC_MONETARY
[ -n "${LC_MESSAGES}" ] && export LC_MESSAGES
[ -n "${LC_ALL}" ] && export LC_ALL
fi
einfo "You can modify the paths and options passed to initdb by editing:"
einfo " ${EROOT}/etc/conf.d/postgresql-${SLOT}"
einfo
einfo "Information on options that can be passed to initdb are found at:"
einfo " https://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
einfo " https://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
einfo
einfo "PG_INITDB_OPTS is currently set to:"
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
einfo " (none)"
else
einfo " ${PG_INITDB_OPTS}"
fi
einfo
einfo "Configuration files will be installed to:"
einfo " ${PGDATA}"
einfo
einfo "The database cluster will be created in:"
einfo " ${DATA_DIR}"
einfo
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
sleep 5
eend 0
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
eerror "The given directory, '${DATA_DIR}', is not empty."
eerror "Modify DATA_DIR to point to an empty directory."
die "${DATA_DIR} is not empty."
fi
einfo "Creating the data directory ..."
if [[ ${EUID} == 0 ]] ; then
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
fi
einfo "Initializing the database ..."
if [[ ${EUID} == 0 ]] ; then
su - postgres -c "${EROOT}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
else
"${EROOT}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
fi
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
fi
# unix_socket_directory has no effect in postgresql.conf as it's
# overridden in the initscript
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
# On the off-chance that you might need to work with UTF-8 encoded
# characters in PL/Perl
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
EOF
einfo "The autovacuum function, which was in contrib, has been moved to the main"
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
einfo "by default. You can disable it in the cluster's:"
einfo " ${PGDATA%/}/postgresql.conf"
einfo
if ! use systemd; then
einfo "The PostgreSQL server, by default, will log events to:"
einfo " ${DATA_DIR%/}/postmaster.log"
einfo
fi
if use prefix ; then
einfo "The location of the configuration files have moved to:"
einfo " ${PGDATA}"
einfo "To start the server:"
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
einfo "To stop:"
einfo " pg_ctl stop -D ${DATA_DIR}"
einfo
einfo "Or move the configuration files back:"
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
elif use systemd; then
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
einfo "instead of 'pg_ctl'."
else
einfo "You should use the '${EROOT}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
einfo "instead of 'pg_ctl'."
fi
}
src_test() {
if use server && [[ ${UID} -ne 0 ]] ; then
# Some ICU tests fail if LC_CTYPE and LC_COLLATE aren't the same. We set
# LC_CTYPE to be equal to LC_COLLATE since LC_COLLATE is set by Portage.
local old_ctype=${LC_CTYPE}
export LC_CTYPE=${LC_COLLATE}
emake check
export LC_CTYPE=${old_ctype}
einfo "If you think other tests besides the regression tests are necessary, please"
einfo "submit a bug including a patch for this ebuild to enable them."
else
use server || \
ewarn 'Tests cannot be run without the "server" use flag enabled.'
[[ ${UID} -eq 0 ]] || \
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
ewarn 'Skipping.'
fi
}

@ -8,7 +8,7 @@ LLVM_MAX_SLOT=16
inherit flag-o-matic linux-info llvm pam python-single-r1 systemd tmpfiles
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
SLOT=$(ver_cut 1)

Binary file not shown.

@ -14,7 +14,7 @@ SRC_URI="https://github.com/javaee/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz
LICENSE="GPL-2-with-linking-exception"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 x86"
CDEPEND="
dev-java/javax-jsp-api:2.0

@ -14,7 +14,7 @@ SRC_URI="https://repo1.maven.org/maven2/javax/servlet/jsp/jsp-api/${PV}/jsp-api-
LICENSE="CDDL GPL-2-with-classpath-exception"
SLOT="2.0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
KEYWORDS="amd64 ~arm ~arm64 x86"
CP_DEPEND="dev-java/javax-servlet-api:2.5"

Binary file not shown.

@ -10,7 +10,7 @@ HOMEPAGE="https://wiki.gnome.org/Projects/Vala https://gitlab.gnome.org/GNOME/va
LICENSE="LGPL-2.1+"
SLOT="0.56"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~x86-linux"
IUSE="test valadoc"
RESTRICT="!test? ( test )"

@ -1,336 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{9..10} )
RUBY_OPTIONAL="yes"
USE_RUBY="ruby27"
PHP_EXT_NAME="IcePHP"
PHP_EXT_INI="yes"
PHP_EXT_ZENDEXT="no"
PHP_EXT_OPTIONAL_USE=php
USE_PHP="php7-4"
# This variable does not belong to any eclass. It is solely used in this ebuild
BERKDB_SLOTS=( 6.2 6.1 5.3 5.1 4.8 )
inherit db-use mono-env php-ext-source-r3 python-r1 ruby-ng toolchain-funcs
DESCRIPTION="ICE middleware C++ library and generator tools"
HOMEPAGE="https://zeroc.com/products/ice"
SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
doc? ( https://download.zeroc.com/Ice/$(ver_cut 1-2)/${PN}-3.6.4.pdf )"
LICENSE="GPL-2"
SLOT="0/36"
KEYWORDS="amd64 ~arm ~arm64 x86"
IUSE="debug doc examples +readline mono php python ruby test"
RESTRICT="test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND=">=dev-libs/expat-2.0.1
>=app-arch/bzip2-1.0.5
dev-libs/openssl:0=
virtual/libcrypt:=
|| (
$(for slot in ${BERKDB_SLOTS[@]} ; do printf '%s\n' "sys-libs/db:${slot}[cxx]" ; done)
)
dev-cpp/libmcpp
python? ( ${PYTHON_DEPS} )
ruby? ( $(ruby_implementation_depend ruby27) )
mono? ( dev-lang/mono )"
DEPEND="${RDEPEND}
readline? ( sys-libs/readline:0= )
test? (
${PYTHON_DEPS}
dev-python/passlib[${PYTHON_USEDEP}]
)"
# Maintainer notes:
# TODO: java bindings
S="${WORKDIR}/${P,}"
PHP_EXT_S="${S}/php"
PATCHES=(
"${FILESDIR}/${PN}-3.6.3-no-arch-opts.patch"
"${FILESDIR}/${P}-db6.patch"
"${FILESDIR}/${P}-csharp.patch"
)
pkg_setup() {
# prevent ruby-ng.eclass from messing with pkg_setup
return
}
src_unpack() {
# prevent ruby-ng.eclass from messing with src_unpack
default
}
src_prepare() {
default
sed -i \
-e 's|-L\$\(libdir\)||' \
cpp/config/Make.rules || die
sed -i \
-e 's|-O2 ||g' \
-e 's|-Werror ||g' \
cpp/config/Make.rules.Linux || die
sed -i \
-e 's|install-common||' \
{cpp,csharp,php,python,ruby}/Makefile || die
sed -i \
-e 's|-f -root|-f -gacdir $(GAC_DIR) -root|' \
csharp/config/Make.rules.cs || die
# skip mono tests, bug #498484
sed -i \
-e '/SUBDIRS/s|\ test||' \
csharp/Makefile || die
# skip udp test due to multicast
# skip IceGrid/admin bug #649850
# skip IceSSL tests due to requirement of internet connection
# skip IceStorm/single bug #636834
# IceUtil/stacktrace and IceStorm/stress fail with USE=debug
# Glacier2/staticFiltering requires network access
sed -i \
-e 's|allTests.py|allTests.py --rfilter=udp --rfilter=IceGrid\/admin --rfilter=IceSSL --rfilter=IceStorm\/single --rfilter=IceStorm\/stress --rfilter=IceUtil\/stacktrace --rfilter=Glacier2\/staticFiltering|' \
cpp/Makefile || die
# fails even on unicode locale
sed -i \
-e 's|allTests.py|allTests.py --rfilter=Slice\/unicodePaths|' \
ruby/Makefile || die
# fix for x86 IceBox test
sed -i \
-e 's|"32"|""|' \
scripts/TestUtil.py || die
}
src_configure() {
suitable_db_version() {
local ver
for ver in "${BERKDB_SLOTS[@]}"; do
if [[ -n $(db_findver sys-libs/db:${ver}) ]]; then
echo "${ver}"
return 0
fi
done
die "No suitable BerkDB versions found, aborting"
}
MAKE_RULES=(
"prefix=\"${ED}/usr\""
"install_docdir=\"${ED}/usr/share/doc/${PF}\""
"install_configdir=\"${ED}/usr/share/${P}/config\""
"install_mandir=\"${ED}/usr/share/man/man1\""
"embedded_runpath_prefix=\"${EPREFIX}/usr\""
"LP64=yes"
"new_dtags=yes"
"NOTEST=$(usex !test)"
"USE_READLINE=$(usex readline)"
"OPTIMIZE=$(usex !debug)"
)
local BERKDB_VERSION="$(suitable_db_version)"
MAKE_RULES+=("DB_FLAGS=-I$(db_includedir ${BERKDB_VERSION})")
sed -i \
-e "s|g++|$(tc-getCXX)|" \
-e "s|\(CFLAGS[[:space:]]*=\)|\1 ${CFLAGS}|" \
-e "s|\(CXXFLAGS[[:space:]]*=\)|\1 ${CXXFLAGS}|" \
-e "s|\(LDFLAGS[[:space:]]*=\)|\1 ${LDFLAGS}|" \
-e "s|\(DB_LIBS[[:space:]]*=\) \-ldb_cxx|\1 -ldb_cxx-$(db_findver sys-libs/db:${BERKDB_VERSION})|" \
cpp/config/Make.rules{,.Linux} python/config/Make.rules || die
if use python; then
local S="${S}/python"
python_copy_sources
fi
if use ruby; then
SITERUBY="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')"
SITERUBYARCH="$(ruby26 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
MAKE_RULES_RUBY=(
"install_rubydir=\"${ED}/${SITERUBY}\""
"install_libdir=\"${ED}/${SITERUBYARCH}\""
)
# make it use ruby26 only
sed -i \
-e 's|RUBY = ruby|\026|' \
ruby/config/Make.rules || die
sed -i \
-e 's|env ruby|\026|' \
ruby/config/s2rb.rb || die
sed -i \
-e 's|env ruby|\026|' \
ruby/scripts/slice2rb || die
sed -i \
-e 's|output.write("ruby|\026|' \
scripts/TestUtil.py || die
fi
MAKE_RULES_MONO=(
"GACINSTALL=yes"
"GAC_ROOT=\"${ED}/usr/$(get_libdir)\""
"GAC_DIR=\"${EPREFIX}/usr/$(get_libdir)\""
"install_libdir=\"${ED}/usr/$(get_libdir)\""
"install_pkgconfigdir=\"${ED}/usr/$(get_libdir)/pkgconfig\""
)
if has_version ">dev-lang/mono-4"; then
MAKE_RULES_MONO+=("MCS=mcs")
fi
use test && python_setup
}
src_compile() {
# Do not remove this export or build will break!
tc-export CXX
emake -C cpp "${MAKE_RULES[@]}"
if use php; then
local i
for i in $(php_get_slots); do
mkdir -p "${WORKDIR}/${i}" || die
cp -r "${PHP_EXT_S}" "${WORKDIR}/${i}/" || die "Failed to copy source ${PHP_EXT_S} to PHP target directory"
pushd "${WORKDIR}/${i}" >/dev/null || die
ln -s "${S}/cpp" || die
ln -s "${S}/config" || die
ln -s "${S}/slice" || die
ln -s "${S}/Makefile" || die
emake -C php "${MAKE_RULES[@]}" USE_NAMESPACES=yes "PHP_CONFIG=\"${EPREFIX}/usr/$(get_libdir)/${i}/bin/php-config\""
popd >/dev/null || die
done
fi
if use python; then
building() {
emake -C "${BUILD_DIR}" "${MAKE_RULES[@]}" PYTHON="${EPYTHON}"
}
local S="${S}/python"
python_foreach_impl building
fi
if use ruby; then
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}"
fi
if use mono; then
emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}"
fi
}
src_test() {
local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
emake -C cpp "${MAKE_RULES[@]}" test
# php tests require the extension loaded and are therefore skipped
if use python; then
testing() {
PYTHONPATH="${BUILD_DIR}"/python emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \
PYTHON="${EPYTHON}" \
install_pythondir="\"${D}/$(python_get_sitedir)\"" \
install_libdir="\"${D}/$(python_get_sitedir)\"" test
}
local S="${S}/python"
python_foreach_impl testing
fi
if use ruby; then
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" test
fi
if use mono; then
# skip mono tests, bug #498484
ewarn "Tests for C# are currently disabled."
#emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}" test
fi
}
src_install() {
local DOCS=( CHANGELOG*.md README.md )
use doc && DOCS+=( "${DISTDIR}/${PN}-3.6.4.pdf" )
einstalldocs
insinto /usr/share/${P}
doins -r slice
emake -C cpp "${MAKE_RULES[@]}" install
if use examples; then
docinto examples-cpp
dodoc cpp/config/*.cfg
docompress -x /usr/share/doc/${PF}/examples-cpp
fi
if use php; then
insinto "/usr/share/php/${PN}"
local i
while IFS="" read -d $'\0' -r i; do
doins "${i}"
done < <(find "${S}/php/lib/" -name '*.php' -print0)
pushd "${ED}/usr/share/${P}/slice" >/dev/null || die
local -x LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
for i in *; do
mkdir -p "${ED}/usr/share/php/${i}" || die
"${ED}"/usr/bin/slice2php \
-I"${ED}/usr/share/${P}/slice/" --all \
--output-dir "${ED}/usr/share/php/${i}" \
--ice "${ED}/usr/share/${P}/slice/${i}"/*
done
for i in $(php_get_slots); do
php_init_slot_env "${i}"
insinto "${EXT_DIR}"
newins "php/lib/${PHP_EXT_NAME}.so" "${PHP_EXT_NAME}.so"
done
php-ext-source-r3_createinifiles
popd >/dev/null || die
fi
if use python; then
installation() {
mkdir -p "${D}/$(python_get_sitedir)" || die
emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \
install_pythondir="\"${D}/$(python_get_sitedir)\"" \
install_libdir="\"${D}/$(python_get_sitedir)\"" \
install
python_optimize
}
local S="${S}/python"
python_foreach_impl installation
fi
if use ruby; then
dodir "${SITERUBY}"
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" install
fi
if use mono; then
emake -C csharp "${MAKE_RULES[@]}" "${MAKE_RULES_MONO[@]}" install
fi
}

@ -24,7 +24,7 @@ SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
doc? ( https://download.zeroc.com/Ice/$(ver_cut 1-2)/${PN}-3.7.1.pdf )"
LICENSE="GPL-2"
SLOT="0/37"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
KEYWORDS="amd64 ~arm ~arm64 x86"
IUSE="debug doc examples php python ruby test"
RESTRICT="test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

@ -1,258 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
RUBY_OPTIONAL="yes"
USE_RUBY="ruby27"
PHP_EXT_NAME="IcePHP"
PHP_EXT_INI="yes"
PHP_EXT_ZENDEXT="no"
PHP_EXT_OPTIONAL_USE=php
USE_PHP="php8-0 php8-1 php8-2"
inherit php-ext-source-r3 python-r1 ruby-ng toolchain-funcs
DESCRIPTION="ICE middleware C++ library and generator tools"
HOMEPAGE="https://zeroc.com/products/ice"
SRC_URI="https://github.com/zeroc-ice/ice/archive/v${PV}.tar.gz -> ${P}.tar.gz
doc? ( https://download.zeroc.com/Ice/$(ver_cut 1-2)/${PN}-3.7.1.pdf )"
LICENSE="GPL-2"
SLOT="0/37"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
IUSE="debug doc examples php python ruby test"
RESTRICT="test"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
RDEPEND=">=app-arch/bzip2-1.0.5
>=dev-libs/expat-2.0.1
dev-libs/libedit
dev-cpp/libmcpp
dev-db/lmdb:=
dev-libs/openssl:0=
virtual/libcrypt:=
python? ( ${PYTHON_DEPS} )
ruby? ( $(ruby_implementation_depend ruby27) )"
DEPEND="${RDEPEND}
test? (
${PYTHON_DEPS}
dev-python/passlib[${PYTHON_USEDEP}]
)"
# Maintainer notes:
# TODO: java bindings
S="${WORKDIR}/${P,}"
PHP_EXT_S="${S}/php"
PATCHES=(
"${FILESDIR}/${P}-fix-musl-build.patch"
"${FILESDIR}/${P}-py3k11.patch"
)
pkg_setup() {
# prevent ruby-ng.eclass from messing with pkg_setup
return
}
src_unpack() {
# prevent ruby-ng.eclass from messing with src_unpack
default
}
src_prepare() {
default
sed -i \
-e 's|-Werror ||g' \
config/Make.rules.Linux || die
# fix for x86 IceBox test
sed -i \
-e 's|"32"|""|' \
scripts/IceBoxUtil.py || die
if use !test; then
# Disable building tests
sed -i \
-e 's|include \$(top_srcdir)/config/Make.tests.rules||' \
config/Make.rules || die
fi
}
src_configure() {
MAKE_RULES=(
"embedded_runpath_prefix=\"${EPREFIX}/usr\""
"OPTIMIZE=$(usex !debug)"
"V=1"
)
if use python; then
local S="${S}/python"
python_copy_sources
fi
if use ruby; then
SITERUBY="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')"
SITERUBYARCH="$(ruby27 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
MAKE_RULES_RUBY=(
"install_rubydir=\"${EPREFIX}/${SITERUBY}\""
"install_rubylibdir=\"${EPREFIX}/${SITERUBYARCH}\""
)
# make it use ruby27 only
sed -i \
-e 's|RUBY ?= ruby|\027|' \
ruby/config/Make.rules || die
sed -i \
-e 's|env ruby|\027|' \
ruby/config/s2rb.rb || die
sed -i \
-e 's|env ruby|\027|' \
ruby/scripts/slice2rb || die
fi
use test && python_setup
}
src_compile() {
# Do not remove this export or build will break!
tc-export CXX
emake -C cpp "${MAKE_RULES[@]}"
if use php; then
local i
for i in $(php_get_slots); do
mkdir -p "${WORKDIR}/${i}" || die
cp -r "${PHP_EXT_S}" "${WORKDIR}/${i}/" || die "Failed to copy source ${PHP_EXT_S} to PHP target directory"
pushd "${WORKDIR}/${i}" >/dev/null || die
ln -s "${S}/cpp" || die
ln -s "${S}/config" || die
ln -s "${S}/slice" || die
ln -s "${S}/Makefile" || die
emake -C php "${MAKE_RULES[@]}" "PHP_CONFIG=\"${EPREFIX}/usr/$(get_libdir)/${i}/bin/php-config\""
popd >/dev/null || die
done
fi
if use python; then
building() {
emake -C "${BUILD_DIR}" "${MAKE_RULES[@]}" PYTHON="${EPYTHON}"
}
local S="${S}/python"
python_foreach_impl building
fi
if use ruby; then
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}"
fi
}
src_test() {
local -x LD_LIBRARY_PATH="${S}/cpp/$(get_libdir)${LD_LIBRARY_PATH+:}${LD_LIBRARY_PATH}"
emake -C cpp "${MAKE_RULES[@]}" test
# php tests require the extension loaded and are therefore skipped
if use python; then
testing() {
PYTHONPATH="${BUILD_DIR}"/python emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \
PYTHON="${EPYTHON}" \
install_pythondir="\"$(python_get_sitedir)\"" \
install_libdir="\"$(python_get_sitedir)\"" test
}
local S="${S}/python"
python_foreach_impl testing
fi
if use ruby; then
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_RUBY[@]}" test
fi
}
src_install() {
local DOCS=( CHANGELOG*.md README.md )
use doc && DOCS+=( "${DISTDIR}/${PN}-3.7.1.pdf" )
einstalldocs
MAKE_RULES_INSTALL=(
"prefix=\"${ED}/usr\""
"install_docdir=\"${ED}/usr/share/doc/${PF}\""
"install_configdir=\"${ED}/usr/share/${P}/config\""
"install_mandir=\"${ED}/usr/share/man/man1\""
)
insinto /usr/share/${P}
doins -r slice
emake -C cpp "${MAKE_RULES[@]}" "${MAKE_RULES_INSTALL[@]}" install
if use examples; then
docinto examples-cpp
dodoc cpp/config/*.cfg
docompress -x /usr/share/doc/${PF}/examples-cpp
fi
if use php; then
insinto "/usr/share/php/${PN}"
local i
while IFS="" read -d $'\0' -r i; do
doins "${i}"
done < <(find "${S}/php/lib/" -name '*.php' -print0)
pushd "${ED}/usr/share/${P}/slice" >/dev/null || die
local -x LD_LIBRARY_PATH="${ED}/usr/$(get_libdir):${LD_LIBRARY_PATH}"
for i in *; do
mkdir -p "${ED}/usr/share/php/${i}" || die
"${ED}"/usr/bin/slice2php \
-I"${ED}/usr/share/${P}/slice/" --all \
--output-dir "${ED}/usr/share/php/${i}" \
--ice "${ED}/usr/share/${P}/slice/${i}"/*
done
for i in $(php_get_slots); do
php_init_slot_env "${i}"
insinto "${EXT_DIR}"
newins "php/lib/ice.so" "${PHP_EXT_NAME}.so"
done
php-ext-source-r3_createinifiles
popd >/dev/null || die
fi
if use python; then
installation() {
mkdir -p "${D}/$(python_get_sitedir)" || die
emake -C "${BUILD_DIR}" \
"${MAKE_RULES[@]}" \
"${MAKE_RULES_INSTALL[@]}" \
install_pythondir="\"${D}/$(python_get_sitedir)\"" \
install_libdir="\"${D}/$(python_get_sitedir)\"" \
install
python_optimize
}
local S="${S}/python"
python_foreach_impl installation
fi
if use ruby; then
MAKE_RULES_RUBY=(
"install_rubydir=\"${ED}/${SITERUBY}\""
"install_rubylibdir=\"${ED}/${SITERUBYARCH}\""
)
dodir "${SITERUBY}"
emake -C ruby "${MAKE_RULES[@]}" "${MAKE_RULES_INSTALL[@]}" "${MAKE_RULES_RUBY[@]}" install
fi
}

@ -1,4 +1,2 @@
DIST Ice-3.6.4.pdf 8907736 BLAKE2B 5a631c1e2e147c8ed3b31a84192210c92bbe83e8644ec9d7d164d1b94a20069ce77f6baf54910ac00c7216cbc2979caac6fa78457e9292a84407e93000f9903a SHA512 9bd2d373eb83e08e563cab174a53063a490367dea3e4b910f93f0477c3817282c859f07e46e503006e9bd37678fb6da31a58b88bfabd217b5e371fff685321a0
DIST Ice-3.6.5.tar.gz 5505499 BLAKE2B e16e8932f09270ac6bb86984ab47fa229ad873ee343ac4f56bb48b6f9547387ded0392a76302afac2c98b6d31da7c1faf294574cdba52654e7dea0af16b4169d SHA512 3431928e6168d716919aa9b3126d17a8ae14895bb78a369902a2bb350b2e82923f38ee17965ed3696512a016fcd34dc128e9aaca40fb2b032e7f7eb07bcb903b
DIST Ice-3.7.1.pdf 9351739 BLAKE2B 527f2c37aea19aedbfc580efd93ce4fae2eb7264342bb485822593e2da6fb75a61eea2b1a46187898af07f138d10bf9a213d0b2a0685c18cd1d4c624709a935b SHA512 199b59f14b87b2896ba970bf5aa32f6fd858cbd3fed18eac93acafe4e296db1361ca2d2000ed49f3390ed66c1d4ff8c1fcd3f14ab8197d7804c87fce422c8486
DIST Ice-3.7.8.tar.gz 11056950 BLAKE2B 66686d6e66a997badef53ee30782775047a2fa39d70fa8ed73c5e7a1bad3c3899efd8d68f557a416caacd65860a73834a6bdc3188730fa19a3f1e47f028c5e21 SHA512 eb5863cb5e83000199c27a5a505a19e5f1ec05e8575eb9cdc03f6db30447212e3b02e6adc70fb2ae6ddc63cfd93bc2b6b290f38919364ee9f08b238a0aa11e88

@ -1,50 +0,0 @@
--- ice-3.6.3/cpp/config/Make.rules.Linux~ 2015-06-27 16:56:56.000000000 +0200
+++ ice-3.6.3/cpp/config/Make.rules.Linux 2015-06-27 17:23:45.810591931 +0200
@@ -79,19 +79,6 @@
CXXARCHFLAGS += -mtune=v8 -pipe -Wno-deprecated -DICE_USE_MUTEX_SHARED
endif
- #
- # Only use multilib -m32/-m64 options for amd64 arch, x32 arch can also run
- # in amd64 macines but doesn't use multilib, in this case MACHINE_TYPE will
- # be x86_64 and HOST_ARCH x32.
- #
- ifeq ($(HOST_ARCH),amd64)
- ifeq ($(LP64),yes)
- CXXARCHFLAGS += -m64
- else
- CXXARCHFLAGS += -m32
- endif
- endif
-
CXXFLAGS += $(CXXARCHFLAGS) -fvisibility=hidden -Wall -Werror -pthread
# If MAXWARN is set then enable extra warnings
--- ice-3.6.3/config/Make.common.rules~ 2015-06-23 17:30:20.000000000 +0200
+++ ice-3.6.3/config/Make.common.rules 2015-06-28 01:53:57.149666595 +0200
@@ -101,25 +101,7 @@
ifeq ($(LP64),)
LP64 = yes
endif
-
- #
- # x86 binaries build on x86_64 machine use 32 binsuffix
- #
- ifneq ($(STATICLIBS),yes)
- ifneq ($(LP64),yes)
- binsuffix = 32
- endif
- endif
endif
-
- #
- # x86 builds uses 32 binsuffix
- #
- ifneq ($(STATICLIBS),yes)
- ifeq ($(findstring $(MACHINE_TYPE),i386 i486 i586 i686),$(MACHINE_TYPE))
- binsuffix = 32
- endif
- endif
endif
ifeq ($(CPP11),yes)

@ -1,50 +0,0 @@
--- ice-3.6.5/csharp/src/Makefile~ 2015-06-23 17:30:20.000000000 +0200
+++ ice-3.6.5/csharp/src/Makefile 2015-06-27 20:07:04.217188211 +0200
@@ -11,7 +11,7 @@
include $(top_srcdir)/config/Make.rules.cs
-SUBDIRS = Ice IceStorm Glacier2 IcePatch2 IceGrid IceBox IceDiscovery IceLocatorDiscovery
+SUBDIRS = Ice IceStorm Glacier2 IcePatch2 IceGrid IceBox IceSSL IceDiscovery IceLocatorDiscovery
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
--- /dev/null 2015-06-27 16:44:15.733558105 +0200
+++ ice-3.6.5/csharp/lib/pkgconfig/IceSSL.pc 2015-06-27 20:19:30.731894653 +0200
@@ -0,0 +1,10 @@
+version = 3.6.5
+mono_root = /usr
+
+name = IceSSL
+
+Name: ${name}
+Description: IceSSL run-time support
+Version: ${version}
+Libs: -r:${mono_root}/lib/mono/${name}/${name}.dll
+Requires: Ice = ${version}
--- /dev/null 2015-06-27 16:44:15.733558105 +0200
+++ ice-3.6.5/csharp/lib/pkgconfig/IceDiscovery.pc 2015-06-27 20:20:44.312515987 +0200
@@ -0,0 +1,10 @@
+version = 3.6.5
+mono_root = /usr
+
+name = IceDiscovery
+
+Name: ${name}
+Description: IceDiscovery run-time support
+Version: ${version}
+Libs: -r:${mono_root}/lib/mono/${name}/${name}.dll
+Requires: Ice = ${version}
--- /dev/null 2015-06-27 16:44:15.733558105 +0200
+++ ice-3.6.5/csharp/lib/pkgconfig/IceLocatorDiscovery.pc 2015-06-27 20:21:22.206185123 +0200
@@ -0,0 +1,10 @@
+version = 3.6.5
+mono_root = /usr
+
+name = IceLocatorDiscovery
+
+Name: ${name}
+Description: IceLocatorDiscovery run-time support
+Version: ${version}
+Libs: -r:${mono_root}/lib/mono/${name}/${name}.dll
+Requires: Ice = ${version}

@ -1,48 +0,0 @@
Avoid ambiguous ctor call (uint32_t vs DB_ENV*) with db 6.x.
--- ice-3.6.3/cpp/src/Freeze/SharedDbEnv.cpp.orig 2016-10-05 16:59:08.000000000 +0200
+++ ice-3.6.3/cpp/src/Freeze/SharedDbEnv.cpp 2017-06-28 18:42:43.411869639 +0200
@@ -530,7 +530,7 @@
{
if(_env == 0)
{
- _envHolder.reset(new DbEnv(0));
+ _envHolder.reset(new DbEnv(0u));
_env = _envHolder.get();
if(_trace >= 1)
--- ice-3.6.3/cpp/src/FreezeScript/transformdb.cpp.orig 2016-10-05 16:59:08.000000000 +0200
+++ ice-3.6.3/cpp/src/FreezeScript/transformdb.cpp 2017-06-28 19:15:03.928514164 +0200
@@ -766,8 +766,8 @@
//
// Transform the database.
//
- DbEnv dbEnv(0);
- DbEnv dbEnvNew(0);
+ DbEnv dbEnv(0u);
+ DbEnv dbEnvNew(0u);
Freeze::TransactionPtr txNew;
Freeze::ConnectionPtr connection;
Freeze::ConnectionPtr connectionNew;
--- ice-3.6.3/cpp/src/FreezeScript/Util.cpp.orig 2016-10-05 16:59:08.000000000 +0200
+++ ice-3.6.3/cpp/src/FreezeScript/Util.cpp 2017-06-28 19:22:29.318509063 +0200
@@ -209,7 +209,7 @@
{
CatalogDataMap result;
- DbEnv dbEnv(0);
+ DbEnv dbEnv(0u);
try
{
#ifdef _WIN32
--- ice-3.6.3/cpp/src/FreezeScript/DumpDB.cpp.orig 2016-10-05 16:59:08.000000000 +0200
+++ ice-3.6.3/cpp/src/FreezeScript/DumpDB.cpp 2017-06-28 19:33:38.555168088 +0200
@@ -481,7 +481,7 @@
FreezeScript::ObjectFactoryPtr objectFactory = new FreezeScript::ObjectFactory;
communicator->addObjectFactory(objectFactory, "");
- DbEnv dbEnv(0);
+ DbEnv dbEnv(0u);
DbTxn* txn = 0;
Freeze::ConnectionPtr connection;
int status = EXIT_SUCCESS;

Binary file not shown.

@ -15,7 +15,7 @@ SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv ~sparc x86"
RDEPEND="
>=dev-libs/glib-2.58:2

@ -11,7 +11,7 @@ HOMEPAGE="https://wiki.gnome.org/Projects/Gjs https://gitlab.gnome.org/GNOME/gjs
LICENSE="MIT || ( MPL-1.1 LGPL-2+ GPL-2+ )"
SLOT="0"
IUSE="+cairo examples readline sysprof test"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
KEYWORDS="amd64 ~arm arm64 ~ppc ppc64 ~riscv x86"
RESTRICT="!test? ( test )"
RDEPEND="

@ -16,7 +16,7 @@ IUSE="dbus debug +elf gtk-doc +mime selinux static-libs sysprof systemtap test u
RESTRICT="!test? ( test )"
#REQUIRED_USE="gtk-doc? ( test )" # Bug #777636
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
# * elfutils (via libelf) does not build on Windows. gresources are not embedded
# within ELF binaries on that platform anyway and inspecting ELF binaries from

@ -12,7 +12,7 @@ SRC_URI="https://github.com/AyatanaIndicators/${PN}/archive/${PV}.tar.gz -> ${P}
LICENSE="GPL-3 LGPL-2 LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv ~sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -12,7 +12,7 @@ SRC_URI="https://github.com/AyatanaIndicators/${PN}/archive/${PV}.tar.gz -> ${P}
LICENSE="GPL-3"
SLOT="3"
KEYWORDS="amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86"
KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ppc64 ~riscv ~sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -14,7 +14,7 @@ S="${WORKDIR}/${PN}-${P}"
LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv sparc x86"
IUSE="python test"
RESTRICT="!test? ( test )"

@ -1,2 +1,3 @@
DIST libfastjson-0.99.8.tar.gz 433819 BLAKE2B f988c01de8e7becc5a848825c18151fec2b80f81eb5b50e459b1a3bb535f5521fb63e9350eb133eb984f57f42c5f529220a0c9461eb4689e1421ad815c4c4d87 SHA512 1e7eb7eaae2c6ccb78b77ac883808e1d311b03bad083dc72ab7712765a2ed139accd762850d60f54c6fe0ad48c4385714818fd2c8ed76700ce3546e5aff1c823
DIST libfastjson-0.99.9.1.tar.gz 89468 BLAKE2B 6922c482043499d5c39845c5d8db12a956c7820c15514eed7e4a0ba74f24b68c4cb580ea53f215a965de4b2e6fe70d07e5a14dee09f52725f88328de279dd62a SHA512 32b513fb66ac5a54b0a3d028fabffad5d675fe50475ddd834de45c69eb0a60f83f85a0706071e5d61df25fb09a3de65ac37c295a620a65801782e0f24d033d41
DIST libfastjson-0.99.9.tar.gz 436502 BLAKE2B 5ed542f373dee2e28c85f8b48e9d35c7727d7e565c691f90caed7a9ac1192814c6371e03bce18dd9765b4251e6a78b7e612eeb38872d2833cd72021d41fb889a SHA512 90505fba033179aa92f12ac5dbbb071f69f3491de5bbbbb46d553b08ac325448459c9e33ba22ef4f9db0bae4496cca60046eebf6325d70b045c1a0a9845b0d48

@ -0,0 +1,39 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
DESCRIPTION="Fork of the json-c library, which is optimized for liblognorm processing"
HOMEPAGE="https://www.rsyslog.com/tag/libfastjson/"
SRC_URI="https://github.com/rsyslog/${PN}/archive/v${PV}.tar.gz
-> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0/4.3.0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc64 ~riscv ~sparc ~x86"
IUSE="static-libs"
BDEPEND=">=sys-devel/autoconf-archive-2015.02.04"
DOCS=( AUTHORS ChangeLog )
src_prepare() {
default
eautoreconf
}
src_configure() {
local -a myconf=(
$(use_enable static-libs static)
--disable-rdrand
--enable-compile-warnings=yes
)
econf "${myconf[@]}"
}
src_install() {
default
find "${ED}"/usr/lib* -name '*.la' -delete || die
}

@ -14,7 +14,7 @@ SRC_URI="https://github.com/hughsie/libgusb/releases/download/${PV}/${P}.tar.xz"
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~sparc x86"
IUSE="gtk-doc +introspection test +vala"
REQUIRED_USE="

@ -10,7 +10,7 @@ HOMEPAGE="https://github.com/stefanberger/libtpms"
SRC_URI="https://github.com/stefanberger/libtpms/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv ~x86"
KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv x86"
DEPEND="dev-libs/openssl:="
RDEPEND="${DEPEND}"

@ -1,2 +1,3 @@
DIST msgpack-3.3.0.tar.gz 508001 BLAKE2B 3017c44689f8afbf078b9c498449e21b4e3b87591c50a37bf9ae73869dab550819f24d6e5179a3600df297aa2c024e5a7fe1defcbab7c0f1aff826870de2ab32 SHA512 ad3e32edc8c6afd70282b3d4b493c2ffe74a697c41bd1f39030c5b4752cccefaa965bc049d4c2e63103a210bf714dc3bddd474691bc067d1475ae017593f55e6
DIST msgpack-c-5.0.0.tar.gz 69275 BLAKE2B 9c4ebc60387028cba04d5a8f4d97ca3cf6caa3db93fa7da1a90089d63cd58b36a7fb387b4fd5410d0c422719c1aed6d479418d3cbc011b609afb49cf89c4d0e3 SHA512 f61f19c7dcb5ef2a94cd3fb84e9b090e236caa922f590496e6455bd49a3d001021b55d0f28cea3ce3c35558bedb64f2f932c0e107fb15e6efc6855b99cbe4de6
DIST msgpack-c-6.0.0.tar.gz 69341 BLAKE2B e5f4f99266e568e7df46064803f869874559b766d32a3eb61f722b610753dd20eb755657eab305079ce0c3c6798848d6511b56d9e60cfedab6fa809cb2f1cb2f SHA512 77a2a3c984e04fcda298ae34571b6826f1d4f6e53b5f7166992269421ae3153b986ed69ba0360347920047e38f6941680bc9e38563ec79f15591bf8d66cd7978

@ -1,77 +0,0 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-multilib
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/${PN}/${PN}-c.git"
else
SRC_URI="https://github.com/${PN}/${PN}-c/releases/download/cpp-${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
fi
DESCRIPTION="MessagePack is a binary-based efficient data interchange format"
HOMEPAGE="https://msgpack.org/ https://github.com/msgpack/msgpack-c/"
LICENSE="Boost-1.0"
SLOT="0/2"
IUSE="boost +cxx doc examples test"
RESTRICT="!test? ( test )"
BDEPEND="doc? ( app-doc/doxygen[dot] )"
RDEPEND="boost? ( dev-libs/boost[context,${MULTILIB_USEDEP}] )
!dev-cpp/msgpack-cxx"
DEPEND="${RDEPEND}
test? (
>=dev-cpp/gtest-1.6.0-r2[${MULTILIB_USEDEP}]
sys-libs/zlib[${MULTILIB_USEDEP}]
)
"
multilib_src_configure() {
local mycmakeargs=(
-DMSGPACK_BOOST="$(usex boost)"
-DMSGPACK_ENABLE_CXX="$(usex cxx)"
-DMSGPACK_BUILD_TESTS="$(usex test)"
# don't build the examples
-DMSGPACK_BUILD_EXAMPLES=OFF
# enable C++17 by default
-DMSGPACK_CXX17=ON
)
cmake_src_configure
}
multilib_src_compile() {
cmake_src_compile
if multilib_is_native_abi && use doc; then
cmake_build doxygen
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use doc; then
local HTML_DOCS=( "${BUILD_DIR}"/docs/. )
mkdir docs || die
mv doc_c/html docs/c || die
if use cxx; then
mv doc_cpp/html docs/cpp || die
fi
fi
if use examples; then
docinto examples
dodoc -r "${WORKDIR}/${P}/example/."
docompress -x /usr/share/doc/${PF}/examples
fi
fi
cmake_src_install
}

@ -0,0 +1,61 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake-multilib
MY_PN="${PN}-c"
MY_P="${MY_PN}-${PV}"
DESCRIPTION="MessagePack is a binary-based efficient data interchange format"
HOMEPAGE="https://msgpack.org/ https://github.com/msgpack/msgpack-c/"
SRC_URI="https://github.com/${PN}/${PN}-c/releases/download/c-${PV}/${MY_P}.tar.gz"
LICENSE="Boost-1.0"
SLOT="0/2"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="doc examples test"
RESTRICT="!test? ( test )"
BDEPEND="doc? ( app-doc/doxygen[dot] )
test? (
dev-cpp/gtest[${MULTILIB_USEDEP}]
sys-libs/zlib[${MULTILIB_USEDEP}]
)"
S="${WORKDIR}"/${MY_P}
multilib_src_configure() {
local mycmakeargs=(
-DMSGPACK_BUILD_EXAMPLES=OFF
-DMSGPACK_BUILD_TESTS="$(usex test)"
)
cmake_src_configure
}
multilib_src_compile() {
cmake_src_compile
if multilib_is_native_abi && use doc; then
cmake_build doxygen
fi
}
multilib_src_install() {
if multilib_is_native_abi; then
if use doc; then
local HTML_DOCS=( "${BUILD_DIR}"/doc_c/html/. )
fi
if use examples; then
docinto examples
dodoc -r "${S}"/example/.
docompress -x /usr/share/doc/${PF}/examples
fi
fi
cmake_src_install
}

@ -11,7 +11,7 @@ SRC_URI="https://github.com/frankmorgner/${PN}/archive/refs/tags/${PV}.tar.gz ->
LICENSE="GPL-3"
SLOT="0/3"
KEYWORDS="~amd64 ppc64 ~x86"
KEYWORDS="amd64 ppc64 x86"
BDEPEND="
dev-util/gengetopt

@ -11,7 +11,7 @@ SRC_URI="https://github.com/OpenSC/OpenSC/releases/download/${PV}/${P}.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ppc64 ~x86"
KEYWORDS="amd64 ppc64 x86"
IUSE="ctapi doc openct notify pace +pcsc-lite readline secure-messaging ssl test zlib"
RESTRICT="!test? ( test )"

@ -16,7 +16,7 @@ S="${WORKDIR}/${MY_P}"
LICENSE="openssl"
SLOT="0/1.1" # .so version of libssl/libcrypto
if [[ ${PV} != *_pre* ]] ; then
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
fi
IUSE="+asm rfc3779 sctp cpu_flags_x86_sse2 sslv3 static-libs test tls-compression tls-heartbeat vanilla verify-sig weak-ssl-ciphers"
RESTRICT="!test? ( test )"

@ -10,7 +10,7 @@ HOMEPAGE="https://gitlab.gnome.org/GNOME/template-glib"
LICENSE="LGPL-2.1+"
SLOT="0/1"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 x86"
IUSE="gtk-doc +introspection test vala"
RESTRICT="!test? ( test )"

@ -11,7 +11,7 @@ HOMEPAGE="https://wiki.gnome.org/Projects/Vala https://gitlab.gnome.org/GNOME/va
LICENSE="LGPL-2.1+"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos ~x64-solaris"
RDEPEND=""
DEPEND=""

@ -11,7 +11,7 @@ SRC_URI="https://oligarchy.co.uk/xapian/${PV}/${MY_P}.tar.xz"
LICENSE="GPL-2"
SLOT="0/30" # ABI version of libxapian.so
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos ~x64-solaris"
IUSE="doc static-libs cpu_flags_x86_sse cpu_flags_x86_sse2 +inmemory +remote"
DEPEND="sys-apps/util-linux

Binary file not shown.

@ -12,7 +12,7 @@ SRC_URI="https://gitlab.com/irill/${PN}/-/archive/v${PV}/${MYP}.tar.bz2"
LICENSE="LGPL-3"
SLOT="0/${PV}"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ppc64 ~riscv x86"
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
IUSE="+ocamlopt llvm-libunwind test"
RESTRICT="!test? ( test )"

@ -12,7 +12,7 @@ S="${WORKDIR}/${PN}-$(ver_cut 1-3)"
LICENSE="LGPL-3"
SLOT="0/${PV}"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ppc64 ~riscv x86"
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
IUSE="+ocamlopt"
BDEPEND="

@ -11,7 +11,7 @@ SRC_URI="https://github.com/garrigue/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="QPL-1.0 LGPL-2"
SLOT="0/${PV}"
KEYWORDS="amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv x86 ~amd64-linux ~x86-linux"
KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv x86 ~amd64-linux ~x86-linux"
IUSE="+ocamlopt X"
RDEPEND="dev-lang/tk:=

@ -11,7 +11,7 @@ SRC_URI="https://github.com/ocamllabs/ocaml-ctypes/archive/${PV}.tar.gz -> ${P}.
LICENSE="MIT"
SLOT="0/${PV}"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ppc64 ~riscv x86"
KEYWORDS="amd64 arm ~arm64 ~ppc ppc64 ~riscv x86"
IUSE="test"
RESTRICT="!test? ( test )"

@ -20,7 +20,7 @@ DEPEND="${RDEPEND}
SLOT="0/${PV}"
LICENSE="MIT"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
KEYWORDS="amd64 arm ~arm64 ~ppc ppc64 ~riscv x86"
PATCHES=(
"${FILESDIR}/ounit2.patch"
"${FILESDIR}/${PN}-1.1.0-cc.patch"

@ -11,7 +11,7 @@ SRC_URI="https://github.com/janestreet/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.g
LICENSE="Apache-2.0"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="~amd64 arm arm64 ~ppc ppc64 ~riscv ~x86"
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
IUSE="+ocamlopt"
DEPEND="

@ -11,7 +11,7 @@ SRC_URI="https://github.com/janestreet/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.g
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"
KEYWORDS="amd64 arm ~arm64 ~ppc ppc64 ~riscv x86"
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
IUSE="+ocamlopt test"
RESTRICT="!test? ( test )"

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save