Sync with portage [Fri Aug 19 12:42:40 MSK 2022].

akrasnyh 2318
root 2 years ago
parent 73d4316681
commit 0728b3efd0

Binary file not shown.

Binary file not shown.

@ -42,7 +42,7 @@ by adding the following to your ~/.emacs file:
(load "/usr/share/emacs/site-lisp/emacspeak/lisp/emacspeak-setup.el")
'
HTML_DOCS=( info/ )
HTML_DOCS=( etc/ info/ )
src_configure() {
MAKEOPTS+=" -j1"

@ -42,7 +42,7 @@ by adding the following to your ~/.emacs file:
(load "/usr/share/emacs/site-lisp/emacspeak/lisp/emacspeak-setup.el")
'
HTML_DOCS=( info/ )
HTML_DOCS=( etc/ info/ )
src_configure() {
MAKEOPTS+=" -j1"

Binary file not shown.

@ -7,3 +7,4 @@ DIST aws-cli-1.25.50.gh.tar.gz 2241527 BLAKE2B 76a594e977bedaeb89bef7b3d61cbd08a
DIST aws-cli-1.25.51.gh.tar.gz 2241823 BLAKE2B 86e7463a8fb63311351d60ac3dcd01a2f87a774dd63430265dbb5546661d6533fa528c81cab72e08d805518c1896779451533a0e4af02ba2565115402a1aae76 SHA512 6ea6d6532dc6e5ad8e3a392cff6034ad3084b8dbdbdcb197ae737f7912088e415da992a56915cf355a7f39206ab28ec3865c10cb618271b2d1f8a71a89a809fd
DIST aws-cli-1.25.52.gh.tar.gz 2241932 BLAKE2B e11ce7250040886ae9a00413c8ce67c929e90b5697a83d36184750d69d947c389afc4fc97d590c64874c2c259ba4a10b97b5d20f6148aee167d9cf6b9af6ff9d SHA512 5c5e06c9e2b0529508edc829c1baa7359238a1e72712e45e269030fd58644fde2f7b94767d1e33b1ff35859a25985f2b00b7d13c96e37dc5999bc7e24cc4f5da
DIST aws-cli-1.25.53.gh.tar.gz 2242474 BLAKE2B 000bb154882210f52f8fe5c40e56d43526b28665a9e5666d7d8b61f95302d411a8f0d0c6eeaef3bd5aff46cfa6ae1133263dc38cb6a7274b4d7058c26005c369 SHA512 82790f15c9fdd736f2bdda976aa5990849521f7af05c95ee9c2c55cf232e140d875b396714be8be1ffba382ebf8f26f8b0a03bc064699de0316ca41156b993b8
DIST aws-cli-1.25.54.gh.tar.gz 2252442 BLAKE2B 7f3f55af39f52be60daa039c42cd494a806998bbf0e27d5218949f0b6b8de29d85fc515697b76fa163e93e051405ac69a4df82322ac573fd124117d548040cc8 SHA512 bae88f022cfc8d596569412dfacddeed626ac88019632fc846a8351447ff02ae07dd481962e9a1495897896bb2f8b96186f8e3572bcb4fbd37d82b016afb8e33

@ -0,0 +1,72 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..10} )
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 ~arm64 ~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() {
# 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
}

@ -1 +1 @@
DIST exo-1.58.0.tar.gz 5609630 BLAKE2B 266820bd6e51aeaf1bde21b3ecea42e5e7242ffd8b96c60b73316ab938d07764e14e387271f24bb1e71c0692eea11a97deb45e76dfc66a5db82b46a60362bf8a SHA512 5032549d98f9eb9e411387667fe64a75b7ff4f5d830047ebae1cfada2b684fa108e5b945472347d3297f45ef0b2b87baf38750f8f9814cc60af6d08584fce0a3
DIST exo-1.59.0.tar.gz 5614442 BLAKE2B 89e7d50e33b7883b697c168d31e376f240873f416045e00fc7918335b9fff497c809b4a6f9301e6f5e633586f59694e73b50a92fea1c16475df379fab9ee7abb SHA512 06789bbb845a06f0c2b185471989f4fffcaba8350c1d6b5b6398fe0dfbb6a2c2729aee8b464328ed95ba0b028de7c238a6343a132d40c57c0c9a7ed06695d4fe

@ -1 +1,2 @@
DIST hcloud-1.30.1.tar.xz 1688764 BLAKE2B b1044a3d9e5dd28d6010763dd2c3322e56418bd2b8b48669fd2bfb4297a0a75def85a63c08f99f0bacb78bee976438af72feae2d8d38982cfc5ce2bd3a978569 SHA512 808eb06718f1e9e3ecc6de37683cc632b822e1ef9236011fba7b72ba3cd4be238c01ae66651bae304e5118d930898635116488517ca7ec3124e4bc2f987e24e6
DIST hcloud-1.30.3.tar.xz 1690980 BLAKE2B 115a6769d5bd5e6a10d812502506f9921a7659a262eea7088c88205e9fc748a570c1c9830e5061923f1be18a64d96104e6e930c9edc3316645e5d86450fbf69c SHA512 64bc692b8d098149815ba63aec8346a7f4f2ff7461fac3369343595a733a5c727b41ec8341e4eee1a98804b14bfc5a94ff9fc0621abb798d381d9bc802818b77

@ -0,0 +1,34 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="A command-line interface for Hetzner Cloud"
HOMEPAGE="https://github.com/hetznercloud/cli"
SRC_URI="https://dev.gentoo.org/~ago/distfiles/${P}.tar.xz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="dev-lang/go:="
RESTRICT="strip"
QA_FLAGS_IGNORED=".*"
src_compile() {
go build -mod vendor -o ${PN} -ldflags "-w -X github.com/hetznercloud/cli/internal/version.Version=${PV}-gentoo" ./cmd/${PN} || die "build failed"
}
src_test() {
# For upstream a simple test is run 'hcloud version'
./hcloud version
if [[ $? -ne 0 ]]
then
die "Test failed"
fi
}
src_install() {
dobin ${PN}
}

Binary file not shown.

@ -3,7 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
DESCRIPTION="Extremely Fast Compression algorithm"

@ -1,2 +1 @@
DIST snappy-1.1.8.tar.gz 1096137 BLAKE2B e21f2ea23727f118920b7f67981354194f12d1d61eaa18eb1cb2f4285fabafdd221b88cf1e3b3261634f65469a714d3efe6b218c0b1e9d41639cdeb21097d75e SHA512 efe18ff1b3edda1b4b6cefcbc6da8119c05d63afdbf7a784f3490353c74dced76baed7b5f1aa34b99899729192b9d657c33c76de4b507a51553fa8001ae75c1c
DIST snappy-1.1.9.tar.gz 1102382 BLAKE2B 926d03156168e3d4800dc17144db3de2c182c6eb9970d87a00b94fb09b67e403479a64cbed75833b83fd03173c1bb8caaf248a55627e89fe2a34456f12ff3b42 SHA512 f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024

@ -1,30 +0,0 @@
From 1c9f699a6275f085ad710c9ae940e096ce552452 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 31 Jul 2017 20:49:22 +0200
Subject: [PATCH] cmake: Add missing linking to GTEST_LIBRARIES
Since the snappy_unittest target uses gtest routines (when available),
it needs to link to gtest explicitly. Otherwise, the build fails due
to unavailable gtest symbols.
---
CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f534b1..3a44aa9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -119,6 +119,9 @@ if(SNAPPY_BUILD_TESTS)
)
target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H)
- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES})
+ target_link_libraries(snappy_unittest
+ snappy
+ ${GFLAGS_LIBRARIES}
+ ${GTEST_LIBRARIES})
if(HAVE_LIBZ)
target_link_libraries(snappy_unittest z)
--
2.14.1

@ -1,64 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
DESCRIPTION="A high-speed compression/decompression library by Google"
HOMEPAGE="https://github.com/google/snappy"
SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0/${PV%%.*}"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"
# all test dependencies are optional:
# - gflags-2.2 is supposedly needed for command-line option parsing
# but it's a huge hack and does not work,
# - gtest probably gives nicer output,
# - compression libraries are used for benchmarks which we do not run.
DEPEND="test? ( dev-cpp/gtest )"
# AUTHORS is useless, ChangeLog is stale
DOCS=( format_description.txt framing_format.txt NEWS README.md )
src_prepare() {
local PATCHES=(
"${FILESDIR}"/snappy-1.1.7-0001-cmake-Add-missing-linking-to-GTEST_LIBRARIES.patch
)
# command-line option parsing does not work at all, so just force
# it off
sed -i -e '/run_microbenchmarks/s:true:false:' snappy-test.cc || die
cmake_src_prepare
}
multilib_src_configure() {
# TODO: would be nice to make unittest build conditional
# but it is not a priority right now
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
# use gtest for tests only
-DCMAKE_DISABLE_FIND_PACKAGE_GTest=$(usex '!test')
# gflags does not work anyway
-DCMAKE_DISABLE_FIND_PACKAGE_Gflags=ON
# we do not want to run benchmarks, and those are only used
# for benchmarks
-DHAVE_LIBZ=NO
-DHAVE_LIBLZO2=NO
)
cmake_src_configure
}
multilib_src_test() {
# run tests directly to get verbose output
cd "${S}" || die
"${BUILD_DIR}"/snappy_unittest || die
}

@ -1,46 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
DESCRIPTION="A high-speed compression/decompression library by Google"
HOMEPAGE="https://github.com/google/snappy"
SRC_URI="https://github.com/google/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0/${PV%%.*}"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="test? ( dev-cpp/gtest )"
DOCS=( format_description.txt framing_format.txt NEWS README.md )
PATCHES=(
"${FILESDIR}/${P}_gcc_inline.patch"
"${FILESDIR}/${P}_external_gtest.patch"
"${FILESDIR}/${PN}-1.1.9-clang-werror.patch"
)
multilib_src_configure() {
local mycmakeargs=(
-DSNAPPY_BUILD_TESTS=$(usex test)
-DSNAPPY_BUILD_BENCHMARKS=OFF
# Options below are related to benchmarking, that we disable.
-DHAVE_LIBZ=NO
-DHAVE_LIBLZO2=NO
-DHAVE_LIBLZ4=NO
)
cmake_src_configure
}
multilib_src_test() {
# run tests directly to get verbose output
cd "${S}" || die
"${BUILD_DIR}"/snappy_unittest || die
}

Binary file not shown.

@ -1,45 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs vcs-snapshot
COMMIT="8f47670dd582c96ad1b6dd3c9b9da0acebded5d8"
DESCRIPTION="A tool to dump and debug bootable CD-like images"
HOMEPAGE="https://github.com/rhboot/dumpet"
SRC_URI="https://github.com/rhboot/dumpet/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="test"
#Restrict tests since required test file is unavailable
RESTRICT="test"
RDEPEND="dev-libs/libxml2
dev-libs/popt"
DEPEND="${RDEPEND}
virtual/pkgconfig
test? ( dev-util/valgrind )"
PATCHES=( "${FILESDIR}"/musl-byteswap-fix.patch )
src_prepare() {
sed -i Makefile \
-e "s/^install : all$/install :/" \
-e "s/^CFLAGS:=/CFLAGS?=/" \
-e "s/^CC:=/CC?=/" \
-e '/^LFLAGS/ s/$/$(LDFLAGS)/' \
|| die
default
}
src_compile() {
emake CFLAGS="${CFLAGS}" dumpet
}
pkg_setup() {
tc-export CC
}

Binary file not shown.

@ -125,7 +125,7 @@ src_compile() {
go install -v -x "${S}/${k}" || die "failed compiling ${k}"
done
go install -v -x -tags libsqlite3 ${S}/lxd || die "Failed to build the daemon"
go install -v -x -tags libsqlite3 "${S}"/lxd || die "Failed to build the daemon"
# Needs to be built statically
CGO_ENABLED=0 go install -v -tags netgo "${S}"/lxd-migrate
@ -177,4 +177,14 @@ pkg_postinst() {
optfeature "zfs storage backend" sys-fs/zfs
elog
elog "Be sure to add your local user to the lxd group."
if [[ -n ${REPLACING_VERSIONS} ]] && has_version app-emulation/qemu[spice,usbredir,virtfs]; then
ewarn ""
ewarn "You're updating from <5.0.1. Due to incompatible API updates in the lxd-agent"
ewarn "product, you'll have to restart any running virtual machines before they work"
ewarn "properly."
ewarn ""
ewarn "Run: 'lxc restart your-vm' after the update for your vm's managed by lxd."
ewarn ""
fi
}

Binary file not shown.

@ -1,2 +1 @@
DIST halibut-1.2.tar.gz 991975 BLAKE2B e5751d2f90968240825e3ddadbc070de856f6a340e832bcf0977fb8d31f7b7c8eefa776f3bba4df58641d22cca7e9ac562eef236069e1d9a8e9cdb41324a7376 SHA512 b04cc5c52f2d7cd2bb9a36a1aa896c6a4fd11bcfc5fad3d9c74576bf2576ce237cd7ac3ceeff3bd10dfd5a229614d06d23323509d3a83ff74b4a1965e1d726fc
DIST halibut-1.3.tar.gz 995916 BLAKE2B 78a4409ff1f787134f7cd4eb307e77c81865a2591b55b359b0ef7a45b303cd361f85d344972714dfe8b3e823345de715d99ea542bf3cdf63d6d92548d027c27b SHA512 872f0cdb398002843d7e1b19f6eaf80ff848ce5ffee8653fa88da63c57e89efcbfaadc09b476280d25d38136f7d8af286fa98b9b36598515e0eb50f1945ee34a

@ -1,22 +0,0 @@
--- a/bk_paper.c
+++ b/bk_paper.c
@@ -75,6 +75,8 @@
#include "halibut.h"
#include "paper.h"
+font_info *all_fonts;
+
typedef struct paper_conf_Tag paper_conf;
typedef struct paper_idx_Tag paper_idx;
--- a/paper.h
+++ b/paper.h
@@ -78,7 +78,7 @@ struct ligature_Tag {
* metrics are read in.
*/
-font_info *all_fonts;
+extern font_info *all_fonts;
struct font_info_Tag {
font_info *next;

@ -1,46 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
inherit toolchain-funcs
DESCRIPTION="yet another free document preparation system"
HOMEPAGE="https://www.chiark.greenend.org.uk/~sgtatham/halibut/"
SRC_URI="https://www.chiark.greenend.org.uk/~sgtatham/${PN}/${P}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 ppc ~riscv x86"
PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
src_compile() {
tc-export CC
CFLAGS="${CFLAGS}" \
CPPFLAGS="${CPPFLAGS}" \
LFLAGS="${LDFLAGS}" \
BUILDDIR="${S}/build" \
VERSION="${PV}" \
emake
emake -C doc
}
DOCS=( doc/halibut.txt )
HTML_DOCS=(
doc/index.html
doc/IndexPage.html
doc/input.html
doc/intro.html
doc/licence.html
doc/manpage.html
doc/output.html
doc/running.html
)
src_install() {
dobin build/halibut
doman doc/halibut.1
doinfo doc/halibut.info
einstalldocs
}

Binary file not shown.

@ -1,4 +1,3 @@
DIST featherpad-1.0.0.tar.gz 1010200 BLAKE2B 22a11a0655ed57f7a7d53949e59c3b989a304b7c3db1f7308af0a52cc00a151cee505b02c19ece286da1be37e76c8874cee4102db3d881ef2c4ad48ecbb2f20a SHA512 9f7e24fa5e89e269693bc0a37f79d987e4914dde2d2b46bd0385886383dab8b35556fbc0f5c5b7b9a2c3a41694174ffa8532c48def87d2972fbc73c1e9c38bf3
DIST featherpad-1.0.1.tar.gz 1014744 BLAKE2B 1525b0894e47facdc51da0c6417d69b12d630bb0e6e8d7b3916b0c4e82380243b1b4dd0ddf82f7954d83edcd7b30346cff0305d98296b4aeccc1fe3cab325cd7 SHA512 8d1a07f8f32f63ec77e6bff8a39badd1eef87b0675096f964ff2fa770dda7c79ec9a1f788cbfa77528163aeb6c6067ca74e009293eca2e718dce92a48aef5f98
DIST featherpad-1.1.0.tar.gz 1061070 BLAKE2B 78c7ddf0b7961a300fe2e425876bfaf32a1186eb88c2619202cb2f07a780aed3c2f8d1ced0e963b1868c94e890d1d809baae534fe1f3d06b3f3036aeeccf7414 SHA512 c734619ea8eda2709ccfa4d1b3c2ac541f32d52f31f0896ddf3c1c5733f175da9d955458a62a34221400a73003970cf796f59cf574b499831267b6f4d1a28d21
DIST featherpad-1.2.0.tar.gz 1091776 BLAKE2B f63ddcc8bf02b3f9ad5f6ad2b56b8f99cc8566f70351a293fbe339930b41542e9ba27888afabfcf98a04ec6a1087dd77aa35006ea33526e1a7d6c45f5fe3b7d9 SHA512 cf21ed9394444920fcf3a8ce3a8338814d69322389c4652e79f0754fe67ee61260f81604c91adf0a864fb1441307706c60ee1bd29efd2e617ab8e1f5fc254cdd
DIST featherpad-1.3.1.tar.gz 1096886 BLAKE2B 360940f0fe781676baa89a99f3d0a7c8ff8219da05fc5757b2e96654ab6c937534e2ef1cd216a3df73fd417353a3285716d09198b27626183c58d031abed363e SHA512 d17eb4691c759a7e97f24bf149152d104141162bef9f819cb09ecdd440916d1f5aa1a56252e64b859220237ea078a072c75308ec7b2e131078df938a171f506f

@ -1,37 +0,0 @@
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit xdg cmake
DESCRIPTION="Lightweight Qt5 Plain-Text Editor for Linux"
HOMEPAGE="https://github.com/tsujan/FeatherPad"
SRC_URI="https://github.com/tsujan/FeatherPad/archive/V${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/FeatherPad-${PV}"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~riscv ~x86"
IUSE="+X"
RDEPEND="app-text/hunspell:=
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtprintsupport:5
dev-qt/qtsvg:5
dev-qt/qtwidgets:5
X? (
dev-qt/qtx11extras:5
x11-libs/libX11
)"
DEPEND="${RDEPEND}"
BDEPEND="dev-qt/linguist-tools:5"
src_configure() {
local mycmakeargs=(
-DWITHOUT_X11=$(usex !X)
)
cmake_src_configure
}

@ -1,7 +1,7 @@
# Copyright 2021 Gentoo Authors
# Copyright 2021-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit xdg cmake
@ -16,9 +16,9 @@ KEYWORDS="~amd64 ~riscv ~x86"
IUSE="+X"
RDEPEND="app-text/hunspell:=
dev-qt/qtcore:5
>=dev-qt/qtcore-5.15.0:5
dev-qt/qtdbus:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtprintsupport:5
dev-qt/qtsvg:5
dev-qt/qtwidgets:5

@ -96,6 +96,9 @@ src_install() {
# Cleanup
rm -r ./resources/app/LICENSES.chromium.html ./resources/app/LICENSE.rtf ./resources/app/licenses || die
# Disable update server
sed -e "/updateUrl/d" -i ./resources/app/product.json || die
# Install
pax-mark m code
insinto "/opt/${PN}"

@ -96,6 +96,9 @@ src_install() {
# Cleanup
rm -r ./resources/app/LICENSES.chromium.html ./resources/app/LICENSE.rtf ./resources/app/licenses || die
# Disable update server
sed -e "/updateUrl/d" -i ./resources/app/product.json || die
# Install
pax-mark m code
insinto "/opt/${PN}"

@ -88,6 +88,9 @@ src_install() {
# Cleanup
rm "${S}/resources/app/LICENSE.txt" || die
# Disable update server
sed -i "/updateUrl/d" ${S}/resources/app/product.json || die
# Install
pax-mark m codium
insinto "/opt/${PN}"

@ -88,6 +88,9 @@ src_install() {
# Cleanup
rm "${S}/resources/app/LICENSE.txt" || die
# Disable update server
sed -i "/updateUrl/d" ${S}/resources/app/product.json || die
# Install
pax-mark m codium
insinto "/opt/${PN}"

Binary file not shown.

@ -1,10 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# shellcheck disable=SC2034
EAPI=7
CMAKE_ECLASS=cmake
CMAKE_MAKEFILE_GENERATOR="emake"
MULTILIB_COMPAT=( abi_x86_{32,64} )

@ -1,10 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# shellcheck disable=SC2034
EAPI=7
CMAKE_ECLASS=cmake
CMAKE_MAKEFILE_GENERATOR="emake"
MULTILIB_COMPAT=( abi_x86_{32,64} )

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>gnome@gentoo.org</email>
<name>Gentoo GNOME Desktop</name>
</maintainer>
<maintainer type="person">
<email>tamiko@gentoo.org</email>
<name>Matthias Maier</name>
</maintainer>
<maintainer type="project">
<email>gnome@gentoo.org</email>
<name>Gentoo GNOME Desktop</name>
</maintainer>
<maintainer type="person">
<email>tamiko@gentoo.org</email>
<name>Matthias Maier</name>
</maintainer>
<upstream>
<remote-id type="gitlab">libvirt/libvirt-glib</remote-id>
</upstream>
</pkgmetadata>

@ -15,4 +15,7 @@
<flag name="vnc">Support connecting to VNC-enabled virtual
machines.</flag>
</use>
<upstream>
<remote-id type="gitlab">virt-viewer/virt-viewer</remote-id>
</upstream>
</pkgmetadata>

@ -19,7 +19,7 @@ fi
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="amd64 ~x86"
IUSE="+libvirt sasl +spice +vnc vte"
RDEPEND="dev-libs/glib:2

@ -0,0 +1,16 @@
Bug https://bugs.gentoo.org/865361
gcc does not support -fcf-protection for i386 (needs i686+),
so disable it when building iPxeBaseBin.
--- a/src/VBox/Devices/PC/ipxe/Makefile.kmk
+++ b/src/VBox/Devices/PC/ipxe/Makefile.kmk
@@ -176,6 +177,8 @@
iPxeBaseBin_TEMPLATE = iPxe
+ iPxeBaseBin_CFLAGS = -fcf-protection=none
+
iPxeBaseBin_INCS = \
src \
src/include \

@ -172,6 +172,9 @@ PATCHES=(
# Patch grabbed from Arch Linux / upstream for Python 3.10 support
"${FILESDIR}"/${PN}-6.1.36-python3.10.patch
# 865361
"${FILESDIR}"/${PN}-6.1.36-fcf-protection.patch
# Downloaded patchset
"${WORKDIR}"/virtualbox-patches-${MY_PV}/patches
)

Binary file not shown.

@ -0,0 +1,27 @@
https://bugs.gentoo.org/805188
https://github.com/libyal/libewf/commit/033ea5b4e5f8f1248f74a2ec61fc1be183c6c46b
--- a/ewftools/ewftools_output.c
+++ b/ewftools/ewftools_output.c
@@ -238,12 +238,20 @@ void ewfoutput_version_detailed_fprint(
LIBHMAC_VERSION_STRING );
#if defined( HAVE_LIBCRYPTO )
+#if defined( SHLIB_VERSION_NUMBER )
fprintf(
stream,
" (libcrypto %s)",
SHLIB_VERSION_NUMBER );
-#endif
-#endif
+#elif defined( OPENSSL_VERSION_MAJOR ) && defined( OPENSSL_VERSION_MINOR )
+ fprintf(
+ stream,
+ " (libcrypto %d.%d)",
+ OPENSSL_VERSION_MAJOR,
+ OPENSSL_VERSION_MINOR );
+#endif
+#endif
+#endif
#if defined( HAVE_LIBODRAW ) || defined( HAVE_LOCAL_LIBODRAW )
fprintf(

@ -0,0 +1,66 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION="Implementation of the EWF (SMART and EnCase) image format"
HOMEPAGE="https://github.com/libyal/libewf"
SRC_URI="https://github.com/libyal/libewf/releases/download/${PV}/${PN}-experimental-${PV}.tar.gz"
LICENSE="BSD"
SLOT="0/3"
KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~riscv ~x86"
# Upstream bug #2597171, pyewf has implicit declarations
#IUSE="debug python unicode"
IUSE="bfio bzip2 debug +fuse nls +ssl static-libs +uuid unicode zlib"
# Uses bundled libbfio until tree version is bumped
RDEPEND="
bzip2? ( app-arch/bzip2 )
fuse? ( sys-fs/fuse:0= )
nls? (
virtual/libintl
virtual/libiconv
)
uuid? ( sys-apps/util-linux )
ssl? ( dev-libs/openssl:0= )
zlib? ( sys-libs/zlib )
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
nls? ( sys-devel/gettext )
"
# Issues finding test executables
RESTRICT="test"
PATCHES=(
"${FILESDIR}"/${P}-openssl-3.patch
)
src_configure() {
local econfargs=(
$(use_enable static-libs static)
$(use_enable nls)
$(use_enable debug verbose-output)
$(use_enable debug debug-output)
$(use_enable unicode wide-character-type)
$(use_with bfio libbfio)
$(use_with zlib)
$(use_with bzip2)
$(use_with ssl openssl)
$(use_with uuid libuuid)
$(use_with fuse libfuse)
)
econf "${econfargs[@]}"
}
src_install() {
default
if ! use static-libs ; then
find "${ED}"/usr -name '*.la' -delete || die
fi
}

Binary file not shown.

@ -1,2 +1 @@
DIST linux_logo-5.11.tar.gz 103623 BLAKE2B 5790bae07a9496a690e0ef2d6426a68365c4ab91df058a31a5bffed38b8f3caac01b80ce49d52583f77632cc5e3061a20a5530437ca3508e823eeb88eb2e94cb SHA512 3c11d59eeb1ea613eb66d3ea5ef2d7c9ef906cb12430b9350570a6a1937ec174bdd974e6227358339c3fd2e0647a5066a0bea22289c4aa9bc8b03afb0033f114
DIST linux_logo-6.0.tar.gz 117486 BLAKE2B 3340b893574f0c18561b208824cd80cff19c387d981af6ca63f56e691cebd2030e058ef367d91a999fd662592582da38b21a5a31f3f8364dbd87a43bd2c2b608 SHA512 ebd7513f90e79bb21acd984c671a1d1ce8421411d2b2948b01e6e08f7c9826184f9b9d528e0cfc814df8d8015d444a09c45025c344115ac9a6c2cff5743f03ad

@ -1,13 +0,0 @@
diff -Nuar a/libsysinfo-0.2.2/Linux/Makefile b/libsysinfo-0.2.2/Linux/Makefile
--- a/libsysinfo-0.2.2/Linux/Makefile 2010-02-15 18:15:07.000000000 +0100
+++ b/libsysinfo-0.2.2/Linux/Makefile 2018-01-03 20:16:48.299998620 +0100
@@ -6,6 +6,9 @@
ifneq (,$(findstring arm,$(ARCH)))
ARCH := arm
endif
+ifneq (,$(findstring aarch64,$(ARCH)))
+ ARCH := arm
+endif
ifneq (,$(findstring sh,$(ARCH)))
ARCH := sh
endif

@ -1,78 +0,0 @@
diff -Naur linux_logo-5.11.orig/configure linux_logo-5.11/configure
--- linux_logo-5.11.orig/configure 2010-02-19 23:47:46.000000000 +0100
+++ linux_logo-5.11/configure 2020-04-23 23:35:47.468728737 +0200
@@ -41,31 +41,8 @@
XGETTEXT=xgettext
fi
-which gcc
-GCC_MISSING=$?
-
-if [ $GCC_MISSING -eq 1 ]; then
- which cc
- CC_MISSING=$?
- if [ $CC_MISSING -eq 1 ]; then
- echo "C compiler not found!"
- else
- CC=cc
- fi
-else
- CC=gcc
-fi
-
LIBSYSINFO=libsysinfo-0.2.2
-LDFLAGS=""
-
-if [ $CC = gcc ]; then
- CFLAGS="-Wall -O2"
-else
- CFLAGS="-O2"
-fi
-
$CROSS$CC $CFLAGS -c intl_test.c
INTL_MISSING=$?
diff -Naur linux_logo-5.11.orig/libsysinfo-0.2.2/configure linux_logo-5.11/libsysinfo-0.2.2/configure
--- linux_logo-5.11.orig/libsysinfo-0.2.2/configure 2009-06-05 20:53:44.000000000 +0200
+++ linux_logo-5.11/libsysinfo-0.2.2/configure 2020-04-23 23:39:32.874812532 +0200
@@ -15,39 +15,6 @@
PREFIX=/usr/local
INSTALL=`which install`
-which gcc
-GCC_MISSING=$?
-
-if [ $GCC_MISSING -eq 1 ]; then
- which cc
- CC_MISSING=$?
- if [ $CC_MISSING -eq 1 ]; then
- echo "C compiler not found!"
- else
- CC=cc
- fi
-else
- CC=gcc
-fi
-
-which ar
-AR_MISSING=$?
-
-if [ $AR_MISSING -eq 0 ]; then
- AR=ar
-fi
-
-
-if [ $OS = SunOS ]; then
- AR=/usr/ccs/bin/ar
-fi
-
-if [ $CC = gcc ]; then
- CFLAGS="-Wall -O2"
-else
- CFLAGS="-O2"
-fi
-
LIBSYSINFO_INCLUDE="-I.."
LFLAGS=""

@ -1,78 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit toolchain-funcs systemd
MY_P=${PN/-/_}-${PV}
S=${WORKDIR}/${MY_P}
DESCRIPTION="A utility that displays an ANSI/ASCII logo and some system information"
HOMEPAGE="http://www.deater.net/weave/vmwprod/linux_logo/"
SRC_URI="http://www.deater.net/weave/vmwprod/linux_logo/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ppc sparc x86 ~amd64-linux ~x86-linux"
IUSE="nls"
RDEPEND="nls? ( virtual/libintl )"
DEPEND="${RDEPEND}
nls? ( sys-devel/gettext )"
src_prepare() {
cp "${FILESDIR}"/logo-config "${S}/logo_config" || die
cp "${FILESDIR}"/linux_logo_creator "${S}/" || die
cp "${FILESDIR}"/linux-logo.service "${S}/" || die
cp "${FILESDIR}"/gentoo-*.logo "${S}"/logos/ || die
eapply "${FILESDIR}"/"${P}"-add-aarch64-support.patch
# Remove warn_unused_result warning
sed -i -e 's/FILE \*fff;/FILE \*fff;\n char *stemp;/' \
-e 's/fgets/stemp=fgets/' "${S}"/load_logo.c || die
eapply_user
}
src_configure() {
ARCH="" ./configure --prefix="${ED}"/usr || die
}
src_compile() {
emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)"
}
src_install() {
emake install
dodoc BUGS README README.CUSTOM_LOGOS TODO USAGE LINUX_LOGO.FAQ
dobin "${FILESDIR}"/linux_logo_creator
newinitd "${FILESDIR}"/${PN}.init.d ${PN}
newconfd "${FILESDIR}"/${P}.conf ${PN}
# systemd support
systemd_newunit "${FILESDIR}/linux-logo.service" "linux-logo.service"
}
pkg_postinst() {
echo
elog "Linux_logo ebuild for Gentoo comes with two Gentoo logos."
elog ""
elog "To display the first Gentoo logo type: linux_logo -L gentoo"
elog "To display the second Gentoo logo type: linux_logo -L gentoo-alt"
elog "To display all the logos available type: linux_logo -L list."
elog ""
elog "To start linux_logo on boot, please type:"
elog " rc-update add linux-logo default"
elog "or for systemd"
elog " systemctl enable linux-logo.service"
elog "which uses the settings found in"
elog " /etc/conf.d/linux-logo"
echo
}
pkg_prerm() {
# Restore issue files
mv /etc/issue.linux-logo.backup /etc/issue 2> /dev/null
mv /etc/issue.net.linux-logo.backup /etc/issue.net 2> /dev/null
}

@ -1,80 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs systemd
MY_P=${PN/-/_}-${PV}
DESCRIPTION="A utility that displays an ANSI/ASCII logo and some system information"
HOMEPAGE="http://www.deater.net/weave/vmwprod/linux_logo/"
SRC_URI="http://www.deater.net/weave/vmwprod/linux_logo/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="nls"
RDEPEND="nls? ( virtual/libintl )"
DEPEND="${RDEPEND}"
BDEPEND="nls? ( sys-devel/gettext )"
PATCHES=(
"${FILESDIR}"/"${P}"-add-aarch64-support.patch
"${FILESDIR}"/"${P}"-configure.patch
)
DOCS=( BUGS README README.CUSTOM_LOGOS TODO USAGE LINUX_LOGO.FAQ )
S=${WORKDIR}/${MY_P}
src_prepare() {
cp "${FILESDIR}"/logo-config "${S}/logo_config" || die
cp "${FILESDIR}"/linux_logo_creator "${S}/" || die
cp "${FILESDIR}"/linux-logo.service "${S}/" || die
cp "${FILESDIR}"/gentoo-*.logo "${S}"/logos/ || die
# Remove warn_unused_result warning
sed -i -e 's/FILE \*fff;/FILE \*fff;\n char *stemp;/' \
-e 's/fgets/stemp=fgets/' "${S}"/load_logo.c || die
default
}
src_configure() {
ARCH="" CC="$(tc-getCC)" AR="$(tc-getAR)" LDFLAGS="${LDFLAGS}" \
./configure --prefix="${ED}"/usr || die
}
src_install() {
default
dobin "${FILESDIR}"/linux_logo_creator
newinitd "${FILESDIR}"/${PN}.init.d ${PN}
newconfd "${FILESDIR}"/${P}.conf ${PN}
# systemd support
systemd_newunit "${FILESDIR}/linux-logo.service" "linux-logo.service"
}
pkg_postinst() {
echo
elog "Linux_logo ebuild for Gentoo comes with two Gentoo logos."
elog ""
elog "To display the first Gentoo logo type: linux_logo -L gentoo"
elog "To display the second Gentoo logo type: linux_logo -L gentoo-alt"
elog "To display all the logos available type: linux_logo -L list."
elog ""
elog "To start linux_logo on boot, please type:"
elog " rc-update add linux-logo default"
elog "or for systemd"
elog " systemctl enable linux-logo.service"
elog "which uses the settings found in"
elog " /etc/conf.d/linux-logo"
echo
}
pkg_prerm() {
# Restore issue files
mv /etc/issue.linux-logo.backup /etc/issue 2> /dev/null
mv /etc/issue.net.linux-logo.backup /etc/issue.net 2> /dev/null
}

@ -11,7 +11,7 @@ SRC_URI="http://www.deater.net/weave/vmwprod/linux_logo/${MY_P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~riscv sparc x86 ~amd64-linux ~x86-linux"
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ppc ~riscv sparc x86 ~amd64-linux ~x86-linux"
IUSE="nls"
RDEPEND="nls? ( virtual/libintl )"

@ -1 +1,2 @@
DIST mosquitto-2.0.14.tar.gz 787414 BLAKE2B 926e39756a0293404c8591e489e64e47cd95640d7884f2cfb687a0d548b709d8aff6d671a4941aae8b3506315d28567520c183b762639822d2d78afe323d111e SHA512 a9e4f41b9af679b30318570e86a465546024651373df10e3b132f4593b89d22d0dbac01bb7371a57132ba030a2e73971c612acb5c9ac12f5ccd06aa38d9444c2
DIST mosquitto-2.0.15.tar.gz 792632 BLAKE2B a6e986998473c16efd4c5fc5fd743782e085b3e7e30bcdcb867f0ae87f85e608f5d50d0dcc5bbbcc2f25eb6a618ab2f287fdcba47660fa593fe1636d08eb183e SHA512 8a0c58222ea0b9304e7f096f6d13965478072baf1d1c9bc931b32a33f5ea8196c2dd54bde8d83fec7ed9cd413cb5fb115ce0a6701ca20664df52fdd7ca63ddaf

@ -0,0 +1,125 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{8..11} )
inherit python-any-r1 systemd toolchain-funcs
DESCRIPTION="An Open Source MQTT v3 Broker"
HOMEPAGE="https://mosquitto.org/ https://github.com/eclipse/mosquitto"
SRC_URI="https://mosquitto.org/files/source/${P}.tar.gz"
LICENSE="EPL-1.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
IUSE="bridge examples +persistence +srv ssl tcpd test websockets"
RESTRICT="!test? ( test )"
REQUIRED_USE="test? ( bridge )"
RDEPEND="
acct-user/mosquitto
acct-group/mosquitto
dev-libs/cJSON:=
srv? ( net-dns/c-ares:= )
ssl? (
dev-libs/openssl:0=
)
tcpd? ( sys-apps/tcp-wrappers )
"
DEPEND="
${RDEPEND}
test? ( dev-util/cunit )
websockets? ( net-libs/libwebsockets[lejp] )
"
BDEPEND="
test? ( ${PYTHON_DEPS} )
"
pkg_setup() {
use test && python_setup
}
_emake() {
local LIBDIR=$(get_libdir)
emake \
CC="$(tc-getCC)" \
CXX="$(tc-getCXX)" \
CLIENT_LDFLAGS="${LDFLAGS}" \
LIB_SUFFIX="${LIBDIR:3}" \
WITH_BRIDGE="$(usex bridge)" \
WITH_PERSISTENCE="$(usex persistence)" \
WITH_SRV="$(usex srv)" \
WITH_TLS="$(usex ssl)" \
WITH_WEBSOCKETS="$(usex websockets)" \
WITH_WRAP="$(usex tcpd)" \
"$@"
}
src_prepare() {
default
if use persistence; then
sed -i -e "/^#autosave_interval/s|^#||" \
-e "s|^#persistence false$|persistence true|" \
-e "/^#persistence_file/s|^#||" \
-e "s|#persistence_location|persistence_location /var/lib/mosquitto/|" \
mosquitto.conf || die
fi
# Remove failing tests
sed -i \
-e '/06-bridge-reconnect-local-out.py/d' \
test/broker/Makefile || die
sed -i \
-e '/02-subscribe-qos1-async2.test/d' \
test/lib/Makefile || die
# Extend test timeout to prevent spurious failures
sed -i -e 's/SUB_TIMEOUT=1/SUB_TIMEOUT=3/' \
test/client/test.sh || die
use test && python_fix_shebang test
}
src_compile() {
_emake
}
src_test() {
_emake test
}
src_install() {
_emake DESTDIR="${D}" prefix=/usr install
keepdir /var/lib/mosquitto
fowners mosquitto:mosquitto /var/lib/mosquitto
dodoc README.md CONTRIBUTING.md ChangeLog.txt
doinitd "${FILESDIR}"/mosquitto
insinto /etc/mosquitto
doins mosquitto.conf
insinto /usr/share/mosquitto
doins misc/letsencrypt/mosquitto-copy.sh
systemd_dounit "${FILESDIR}/mosquitto.service"
if use examples; then
docompress -x "/usr/share/doc/${PF}/examples"
dodoc -r examples
fi
}
pkg_postinst() {
for v in ${REPLACING_VERSIONS}; do
if [[ $(ver_cut 1 "$v") -lt 2 ]]; then
elog
elog "Please read the migration guide at:"
elog "https://mosquitto.org/documentation/migrating-to-2-0/"
elog
elog "If you use Lets Encrypt TLS certificates, take note of"
elog "the changes required to run the daemon as the unprivileged"
elog "mosquitto user. The mosquitto-copy.sh script has been"
elog "installed to /usr/share/mosquitto/ for your convenience."
elog
fi
done
}

@ -1,2 +1 @@
DIST rundeck-cli-0.1.11-all.jar 3447560 BLAKE2B e840d3b27dd173244781d1c37a6c3348d89896d3e81dd8fd36e7c3a33911228e46fff460d838d6c8d9bd79c254c9e469dd8b8e26bb645bd7334d38e04e257512 SHA512 3390d5b6ece391a9cf7754cc4c6d79a7720ac1db2f7a555d0b8216eea23feecc7e4cc947fb4c894362ece3bfaddcb383b7b10558d2e499e364e023c65636aa33
DIST rundeck-cli-2.0.1-all.jar 7470231 BLAKE2B 485b229f49aaf6fda912ab822a7997f8889d487367dcd28ae7fea9e03947f369e1aa61902e5bd38f0990086fc9c73fc5b61426de03cedec33057dee58de49a68 SHA512 9242bff4f736bb324b4ff3321876160d71ff8703f8b6be263df638f5e07e3a78e9edf9a2f47076c0a763c23a403de65819afc0a52890d492669889b593e7f2ae

@ -1,25 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
MY_PN="rundeck-cli"
MY_P="rundeck-cli-${PV}"
inherit java-pkg-2
DESCRIPTION="Command line tool for rundeck"
HOMEPAGE="http://www.rundeck.com/open-source"
SRC_URI="https://github.com/rundeck/${MY_PN}/releases/download/v${PV}/${MY_P}-all.jar"
S="${WORKDIR}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND=">=virtual/jre-1.8"
src_install() {
java-pkg_newjar "${DISTDIR}"/${MY_P}-all.jar ${MY_PN}.jar
java-pkg_dolauncher rd
}

Binary file not shown.

@ -14,7 +14,7 @@ HOMEPAGE="https://hackage.haskell.org/package/hackport"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
KEYWORDS="~amd64 ~ppc64 ~x86"
RDEPEND=">=dev-haskell/async-2.0:=
>=dev-haskell/base16-bytestring-0.1.1:=

Binary file not shown.

@ -1,3 +1,2 @@
DIST liquidprompt-2.0.3.tar.gz 539054 BLAKE2B c94375e0def1764103afe04bb47ff25ced2aeb940b45392bea8a2889ce88d1ea0e03efc0652ec8bc873b9910bee7208e48aaef9a846760177049cc550a5cd8b0 SHA512 a77f1548dd233de9877b2b5dd4a64f05ef03890917486792eb1c362708ab0b635c517cc2a3ddc82731940017f209f626d177a4ac0b5554566faa720a7d88b550
DIST liquidprompt-2.0.4.tar.gz 536123 BLAKE2B 181fe4c59d1a68e03893b1a2144d6b800d8d950a48d38b12fa04aafb01384a08d5b95741a9fac524b353cf7f1b5e09f838d45222009dfb94dcc890ec2a6ab985 SHA512 611931c5572abf1471a2cac1a88d91fadb935e97a3c32bb0ff8a5cc007ac96dd7a88575feecdf033a77226b769504fde93d4afd93fa60277eafdb5f96fb18bcb
DIST liquidprompt-2.1.1.tar.gz 621781 BLAKE2B b23dcbf44f6b0b3a56aa59fffc38336b00be5c3066729445be6b3cb53fb4cb39e12c3f4a31e30a2bfca2abc7a5b02d4015662fb8d303d42406976b6f4b24d1b9 SHA512 88511bb74355c1ffd9ab710170905daeac673073083e81ec165bf4dad47377a47eb5eb6f387010439456c6e6df059ff640bcde8e16eeb60621d1c3ae6b502963
DIST liquidprompt-2.1.2.tar.gz 621356 BLAKE2B b5c3c52179f86fc42164e08a01f4e114f5e7ce1cdb5fb19ef1c02e85569e895cb5f1cc2f61bf6f66380d5c20bc6daf41547eb281990221528d5c1d85b61d1329 SHA512 685da50d347ba0d7c6881d87426344840cc7ab960067035b43f9658c51d7d5cf89e80f4bf8344b49f3858fe91bcfd57dcfaf9a253246fc1a7ebedbba474dc5ff

@ -1,40 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Full-featured & carefully designed adaptive prompt for Bash & Zsh"
HOMEPAGE="https://github.com/nojhan/liquidprompt"
SRC_URI="
https://github.com/nojhan/liquidprompt/releases/download/v${PV}/${PN}-v${PV}.tar.gz
-> ${P}.tar.gz
"
S="${WORKDIR}/${PN}"
LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="test? ( dev-util/shunit2 )"
DOCS=( CHANGELOG.md example.bashrc README.md )
src_test() {
cp "$(type -P shunit2)" tests/shunit2 || die
./tests.sh || die
}
src_install() {
default
dobin liquidprompt
insinto /usr/share/${PN}
doins liquid.theme
doins liquid.ps1
doins -r themes
insinto /etc/
newins liquidpromptrc-dist liquidpromptrc
}

Binary file not shown.

@ -1,9 +1,8 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS="cmake"
inherit cmake-multilib
MY_PN=${PN^^}

@ -1,10 +1,8 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS="cmake"
inherit cmake-multilib
DESCRIPTION="Argument Parser for Modern C++"

@ -3,7 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
if [[ ${PV} == 9999 ]]; then

@ -3,7 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
if [[ ${PV} == 9999 ]]; then

@ -1,9 +1,8 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
if [[ ${PV} == 9999 ]]; then

@ -1,2 +1 @@
DIST yaml-cpp-0.6.3.tar.gz 1398768 BLAKE2B 07abe1c56740105a0af2335bb1cd48086cb614d9d04c61342e53788bfb043fd7eb2629e441a0a5be50898b288f3526f1707c5fdf1d734395b6450c3103773b14 SHA512 68b9ce987cabc1dec79382f922de20cc2c222cb9c090ecb93dc686b048da5c917facf4fce6d8f72feea44b61e5a6770ed3b0c199c4cd4e6bde5b6245c09f8e49
DIST yaml-cpp-0.7.0.tar.gz 1033237 BLAKE2B 69a11a8503ad607aa0d54912a5e53d305a643fe2d36dd86fa96832e3d4930b39a85318dc130e438210a9ca60357f3aa9aa6cd0f2b6bc45728b648c545a437368 SHA512 2de0f0ec8f003cd3c498d571cda7a796bf220517bad2dc02cba70c522dddde398f33cf1ad20da251adaacb2a07b77844111f297e99d45a7c46ebc01706bbafb5

@ -1,44 +0,0 @@
From c9460110e072df84b7dee3eb651f2ec5df75fb18 Mon Sep 17 00:00:00 2001
From: Jesse Beder <jbeder@gmail.com>
Date: Mon, 20 Jan 2020 18:05:15 -0600
Subject: [PATCH] Fix reading empty token stack with a node with properties but
no scalar.
E.g. `!2`.
---
src/singledocparser.cpp | 6 ++++++
test/integration/load_node_test.cpp | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/src/singledocparser.cpp b/src/singledocparser.cpp
index 52544dd6..47e9e047 100644
--- a/src/singledocparser.cpp
+++ b/src/singledocparser.cpp
@@ -79,6 +79,12 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
if (!anchor_name.empty())
eventHandler.OnAnchor(mark, anchor_name);
+ // after parsing properties, an empty node is again a possibility
+ if (m_scanner.empty()) {
+ eventHandler.OnNull(mark, anchor);
+ return;
+ }
+
const Token& token = m_scanner.peek();
if (token.type == Token::PLAIN_SCALAR && IsNullString(token.value)) {
diff --git a/test/integration/load_node_test.cpp b/test/integration/load_node_test.cpp
index 4f4f28e8..0e0dd6bc 100644
--- a/test/integration/load_node_test.cpp
+++ b/test/integration/load_node_test.cpp
@@ -257,5 +257,10 @@ TEST(NodeTest, LoadTagWithParenthesis) {
EXPECT_EQ(node.as<std::string>(), "foo");
}
+TEST(NodeTest, LoadTagWithNullScalar) {
+ Node node = Load("!2");
+ EXPECT_TRUE(node.IsNull());
+}
+
} // namespace
} // namespace YAML

@ -1,57 +0,0 @@
commit f5f288c7622d3547c29a8355b8ccda0155483b79
Author: Till Hofmann <hofmann@kbsg.rwth-aachen.de>
Date: Sun Nov 17 22:43:20 2019 +0100
Revert "fix up static, so works as DLL (#559)"
This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.
diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h
index 82fb79a..50bcd74 100644
--- a/include/yaml-cpp/node/detail/node_data.h
+++ b/include/yaml-cpp/node/detail/node_data.h
@@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
shared_memory_holder pMemory);
public:
- static const std::string& empty_scalar();
+ static std::string empty_scalar;
private:
void compute_seq_size() const;
diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h
index 7a3deac..b363f86 100644
--- a/include/yaml-cpp/node/impl.h
+++ b/include/yaml-cpp/node/impl.h
@@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
inline const std::string& Node::Scalar() const {
if (!m_isValid)
throw InvalidNode(m_invalidKey);
- return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
+ return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
}
inline const std::string& Node::Tag() const {
if (!m_isValid)
throw InvalidNode(m_invalidKey);
- return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
+ return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
}
inline void Node::SetTag(const std::string& tag) {
diff --git a/src/node_data.cpp b/src/node_data.cpp
index 6cfedfc..eba1ae4 100644
--- a/src/node_data.cpp
+++ b/src/node_data.cpp
@@ -13,10 +13,7 @@
namespace YAML {
namespace detail {
-const std::string& node_data::empty_scalar() {
- static const std::string svalue;
- return svalue;
-}
+std::string node_data::empty_scalar;
node_data::node_data()
: m_isDefined(false),

@ -1,149 +0,0 @@
This patch comes from the upstream commit here[1], slightly modified to
apply to 0.6.3. The pull request[2] mentions fixing CVE-2017-5950,
CVE-2018-{20573,20574}, and CVE-2019-6285. Note that CVE-2019-6292 appears to
be a duplicate of CVE-2019-6285 [3].
[1] https://github.com/jbeder/yaml-cpp/commit/4edff1fa5dbfca16fc72d89870841bee89f8ef89
[2] https://github.com/jbeder/yaml-cpp/pull/807
[3] https://github.com/jbeder/yaml-cpp/issues/660
diff --git a/include/yaml-cpp/depthguard.h b/include/yaml-cpp/depthguard.h
new file mode 100644
index 00000000..8ca61ac6
--- /dev/null
+++ b/include/yaml-cpp/depthguard.h
@@ -0,0 +1,77 @@
+#ifndef DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
+#define DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
+
+#if defined(_MSC_VER) || \
+ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
+ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
+#pragma once
+#endif
+
+#include "exceptions.h"
+
+namespace YAML {
+
+/**
+ * @brief The DeepRecursion class
+ * An exception class which is thrown by DepthGuard. Ideally it should be
+ * a member of DepthGuard. However, DepthGuard is a templated class which means
+ * that any catch points would then need to know the template parameters. It is
+ * simpler for clients to not have to know at the catch point what was the
+ * maximum depth.
+ */
+class DeepRecursion : public ParserException {
+public:
+ virtual ~DeepRecursion() = default;
+
+ DeepRecursion(int depth, const Mark& mark_, const std::string& msg_);
+
+ // Returns the recursion depth when the exception was thrown
+ int depth() const {
+ return m_depth;
+ }
+
+private:
+ int m_depth = 0;
+};
+
+/**
+ * @brief The DepthGuard class
+ * DepthGuard takes a reference to an integer. It increments the integer upon
+ * construction of DepthGuard and decrements the integer upon destruction.
+ *
+ * If the integer would be incremented past max_depth, then an exception is
+ * thrown. This is ideally geared toward guarding against deep recursion.
+ *
+ * @param max_depth
+ * compile-time configurable maximum depth.
+ */
+template <int max_depth = 2000>
+class DepthGuard final {
+public:
+ DepthGuard(int & depth_, const Mark& mark_, const std::string& msg_) : m_depth(depth_) {
+ ++m_depth;
+ if ( max_depth <= m_depth ) {
+ throw DeepRecursion{m_depth, mark_, msg_};
+ }
+ }
+
+ DepthGuard(const DepthGuard & copy_ctor) = delete;
+ DepthGuard(DepthGuard && move_ctor) = delete;
+ DepthGuard & operator=(const DepthGuard & copy_assign) = delete;
+ DepthGuard & operator=(DepthGuard && move_assign) = delete;
+
+ ~DepthGuard() {
+ --m_depth;
+ }
+
+ int current_depth() const {
+ return m_depth;
+ }
+
+private:
+ int & m_depth;
+};
+
+} // namespace YAML
+
+#endif // DEPTH_GUARD_H_00000000000000000000000000000000000000000000000000000000
diff --git a/src/depthguard.cpp b/src/depthguard.cpp
new file mode 100644
index 00000000..b88cd340
--- /dev/null
+++ b/src/depthguard.cpp
@@ -0,0 +1,10 @@
+#include "yaml-cpp/depthguard.h"
+
+namespace YAML {
+
+DeepRecursion::DeepRecursion(int depth, const Mark& mark_, const std::string& msg_)
+ : ParserException(mark_, msg_),
+ m_depth(depth) {
+}
+
+} // namespace YAML
diff --git a/src/singledocparser.cpp b/src/singledocparser.cpp
index 47e9e047..3e5638be 100644
--- a/src/singledocparser.cpp
+++ b/src/singledocparser.cpp
@@ -7,6 +7,7 @@
#include "singledocparser.h"
#include "tag.h"
#include "token.h"
+#include "yaml-cpp/depthguard.h"
#include "yaml-cpp/emitterstyle.h"
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/exceptions.h" // IWYU pragma: keep
@@ -47,6 +48,8 @@ void SingleDocParser::HandleDocument(EventHandler& eventHandler) {
}
void SingleDocParser::HandleNode(EventHandler& eventHandler) {
+ DepthGuard<2000> depthguard(depth, m_scanner.mark(), ErrorMsg::BAD_FILE);
+
// an empty node *is* a possibility
if (m_scanner.empty()) {
eventHandler.OnNull(m_scanner.mark(), NullAnchor);
diff --git a/src/singledocparser.h b/src/singledocparser.h
index c8cfca9d..f484eb1f 100644
--- a/src/singledocparser.h
+++ b/src/singledocparser.h
@@ -15,6 +15,7 @@
namespace YAML {
class CollectionStack;
+template <int> class DepthGuard; // depthguard.h
class EventHandler;
class Node;
class Scanner;
@@ -55,6 +56,7 @@ class SingleDocParser {
anchor_t LookupAnchor(const Mark& mark, const std::string& name) const;
private:
+ int depth = 0;
Scanner& m_scanner;
const Directives& m_directives;
std::unique_ptr<CollectionStack> m_pCollectionStack;

@ -1,44 +0,0 @@
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0a669d5..bc8bbdd 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -7,22 +7,7 @@ if(MSVC)
set(CMAKE_STATIC_LIBRARY_PREFIX "")
endif()
-ExternalProject_Add(
- googletest_project
- SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.8.0"
- INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/prefix"
- CMAKE_ARGS
- -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
- -DBUILD_GMOCK=ON
- -Dgtest_force_shared_crt=ON
-)
-
-add_library(gmock UNKNOWN IMPORTED)
-set_target_properties(gmock PROPERTIES
- IMPORTED_LOCATION
- ${PROJECT_BINARY_DIR}/test/prefix/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
-)
-
+find_package(GTest REQUIRED CONFIG)
find_package(Threads)
include_directories(SYSTEM "${PROJECT_BINARY_DIR}/test/prefix/include")
@@ -56,14 +41,12 @@ set_target_properties(run-tests PROPERTIES
CXX_STANDARD_REQUIRED ON
)
-add_dependencies(run-tests googletest_project)
-
set_target_properties(run-tests PROPERTIES
COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} ${yaml_test_flags}"
)
target_link_libraries(run-tests
yaml-cpp
- gmock
+ GTest::gmock
${CMAKE_THREAD_LIBS_INIT})
add_test(yaml-test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run-tests)

@ -1,49 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS="cmake"
inherit cmake-multilib
DESCRIPTION="YAML parser and emitter in C++"
HOMEPAGE="https://github.com/jbeder/yaml-cpp"
SRC_URI="https://github.com/jbeder/${PN}/archive/${P}.tar.gz"
LICENSE="MIT"
SLOT="0/0.6"
KEYWORDS="amd64 ~arm arm64 ~hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
IUSE="test"
# test breaks build
#RESTRICT="!test? ( test )"
RESTRICT+="test"
DEPEND="test? ( dev-cpp/gtest )"
S="${WORKDIR}/${PN}-${P}"
PATCHES=(
"${FILESDIR}/${P}-abi-breakage.patch"
"${FILESDIR}/${P}-CVE-2017-11692.patch"
"${FILESDIR}/${P}-fix-overflows.patch"
)
src_prepare() {
sed -i \
-e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
yaml-cpp.pc.cmake || die
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DBUILD_SHARED_LIBS=ON
-DYAML_BUILD_SHARED_LIBS=ON
-DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
-DYAML_CPP_BUILD_TESTS=$(usex test)
)
cmake-multilib_src_configure
}

@ -1,46 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS="cmake"
inherit cmake-multilib
DESCRIPTION="YAML parser and emitter in C++"
HOMEPAGE="https://github.com/jbeder/yaml-cpp"
SRC_URI="https://github.com/jbeder/yaml-cpp/archive/${P}.tar.gz"
S="${WORKDIR}/yaml-cpp-${P}"
LICENSE="MIT"
SLOT="0/0.6"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
PATCHES=(
"${FILESDIR}/${P}-abi-breakage.patch"
"${FILESDIR}/${P}-CVE-2017-11692.patch"
"${FILESDIR}/${P}-fix-overflows.patch"
"${FILESDIR}/${P}-gtest.patch"
)
src_prepare() {
sed -i \
-e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
yaml-cpp.pc.cmake || die
rm -r test/gtest-* || die
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DYAML_BUILD_SHARED_LIBS=ON
-DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
-DYAML_CPP_BUILD_TESTS=$(usex test)
)
cmake-multilib_src_configure
}

@ -1,9 +1,8 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS="cmake"
inherit cmake-multilib
DESCRIPTION="YAML parser and emitter in C++"

Binary file not shown.

@ -4,5 +4,6 @@
<!-- maintainer-needed -->
<upstream>
<remote-id type="cpe">cpe:/a:freetds:freetds</remote-id>
<remote-id type="github">FreeTDS/freetds</remote-id>
</upstream>
</pkgmetadata>

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@ -14,7 +14,6 @@ else
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~ppc ppc64 ~riscv ~s390 sparc x86"
fi
CMAKE_ECLASS=cmake
inherit cmake-multilib toolchain-funcs
MULTILIB_CHOST_TOOLS=( /usr/bin/mariadb_config )

@ -1,2 +1 @@
DIST mariadb-connector-odbc-3.1.13-src.tar.gz 546893 BLAKE2B 7d3f02667ab3c5eb81063a2a2470bd49914cabea79d8756fd4d493b3117a692c9bd3594c00d5c7d8a866ad4677dec2848a08a80b0e97952e6e80edb5d677e93f SHA512 b50949b99207aeef18fc7f8e15ecb8e8c869fcdc85a04ce1922f2ff856d3f07eb6701df8515545e762abbcb97f74605c6b5ac66efa1927e761a80dcd1c29c2d3
DIST mariadb-connector-odbc-3.1.14-src.tar.gz 549698 BLAKE2B 612879086805c57b42036bb224b14ef1ab287d2ff288a5ec5ec6db7334fc8b82acd648476eca1dee282393486d117cadf1bbdcb0e78eae52bab26a0c05cb1fbe SHA512 bb3cb74ccd17a8df39456ccf3091579bbdfc56431954a978f488928df54e3f9ad1c5b67cb411be4b661ba0e0bdd69ccd4d00ea4bfd72c3f448b560031830512d

@ -1,69 +0,0 @@
# Copyright 2018-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib flag-o-matic
DESCRIPTION="MariaDB Connector/ODBC"
HOMEPAGE="https://downloads.mariadb.org/connector-odbc/"
SRC_URI="mirror://mariadb/connector-odbc-${PV}/${P}-src.tar.gz"
LICENSE="LGPL-2.1"
SLOT="0/3.1"
KEYWORDS="amd64 x86"
IUSE="ssl"
S="${S}-src"
# USE=ssl merely enables the configuration options (seemingly for interactive
# sessions) and does not cause direct linking to any SSL libraries. However,
# it doesn't make sense enable these configuration options unless the
# underlying mariadb-connector-c has ssl enabled, thus if we have USE=ssl,
# require mariadb-connector-c to have it too.
DEPEND="=dev-db/mariadb-connector-c-$(ver_cut 1-2)*:=[ssl?]
dev-db/unixODBC"
RDEPEND="${DEPEND}"
src_prepare() {
cmake_src_prepare
sed -e "s,/lib/,/$(get_libdir)/,g" "${FILESDIR}/odbcinst2.ini" > odbcinst.ini || die
}
multilib_src_configure() {
append-cppflags $(mariadb_config --cflags || die)
local mycmakeargs=(
-DWITH_SSL=$(usex ssl OPENSSL OFF)
-DMARIADB_LINK_DYNAMIC=YES
-DUSE_SYSTEM_INSTALLED_LIB=YES
-DINSTALL_DOCDIR="/usr/share/doc/${PF}"
-DINSTALL_LICENSEDIR="/usr/share/doc/${PF}"
#-DCMAKE_C_FLAGS="$(mariadb_config --cflags)"
)
cmake_src_configure
}
multilib_src_install_all() {
insinto /usr/share/${PN}
doins odbcinst.ini
}
pkg_postinst() {
elog "Please remember to use emerge --config =${P} to install the ODBC ini files."
elog "Alternatively run: /usr/bin/odbcinst -i -d -f /usr/share/${PN}/odbcinst.ini"
}
pkg_config() {
[[ -n "${ROOT}" ]] && die "Sorry, non-standard ROOT setting is not supported."
if /usr/bin/odbcinst -q -d -n maodbc &>/dev/null; then
einfo "maodbc (MariaDB ODBC driver) has already been installed."
else
ebegin "Installing maodbc (MariaDB ODBC driver)"
/usr/bin/odbcinst -i -d -f /usr/share/${PN}/odbcinst.ini
eend ${?} || die
fi
}

@ -3,8 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib flag-o-matic
DESCRIPTION="MariaDB Connector/ODBC"

@ -3,8 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib
MAJOR="$(ver_cut 1-2)"

@ -3,7 +3,6 @@
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib flag-o-matic
# wrap the config script

@ -1,122 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_ECLASS=cmake
inherit cmake-multilib flag-o-matic
# wrap the config script
MULTILIB_CHOST_TOOLS=( /usr/bin/mysql_config )
DESCRIPTION="C client library for MariaDB/MySQL"
HOMEPAGE="https://dev.mysql.com/downloads/"
if [[ ${PV} == "9999" ]]; then
EGIT_REPO_URI="https://github.com/mysql/mysql-server.git"
inherit git-r3
else
SRC_URI="https://dev.mysql.com/get/Downloads/MySQL-$(ver_cut 1-2)/mysql-boost-${PV}.tar.gz"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
S="${WORKDIR}/mysql-${PV}"
fi
LICENSE="GPL-2"
SLOT="0/21"
IUSE="ldap static-libs"
RDEPEND="
>=app-arch/lz4-0_p131:=[${MULTILIB_USEDEP}]
app-arch/zstd:=[${MULTILIB_USEDEP}]
sys-libs/zlib:=[${MULTILIB_USEDEP}]
ldap? ( dev-libs/cyrus-sasl:=[${MULTILIB_USEDEP}] )
dev-libs/openssl:0=[${MULTILIB_USEDEP}]
"
DEPEND="${RDEPEND}"
# Avoid file collisions, #692580
RDEPEND+=" !<dev-db/mysql-5.6.45-r1"
RDEPEND+=" !=dev-db/mysql-5.7.23*"
RDEPEND+=" !=dev-db/mysql-5.7.24*"
RDEPEND+=" !=dev-db/mysql-5.7.25*"
RDEPEND+=" !=dev-db/mysql-5.7.26-r0"
RDEPEND+=" !=dev-db/mysql-5.7.27-r0"
RDEPEND+=" !<dev-db/percona-server-5.7.26.29-r1"
DOCS=( README )
PATCHES=(
"${FILESDIR}"/${PN}-8.0.22-always-build-decompress-utilities.patch
"${FILESDIR}"/${PN}-8.0.19-do-not-install-comp_err.patch
"${FILESDIR}"/${PN}-8.0.27-add-OpenSSL-3.0.0-support.patch
)
src_prepare() {
sed -i -e 's/CLIENT_LIBS/CONFIG_CLIENT_LIBS/' "scripts/CMakeLists.txt" || die
# All these are for the server only.
# Disable rpm call which would trigger sandbox, #692368
sed -i \
-e '/MYSQL_CHECK_LIBEVENT/d' \
-e '/MYSQL_CHECK_RAPIDJSON/d' \
-e '/MYSQL_CHECK_ICU/d' \
-e '/MYSQL_CHECK_EDITLINE/d' \
-e '/MYSQL_CHECK_CURL/d' \
-e '/ADD_SUBDIRECTORY(man)/d' \
-e '/ADD_SUBDIRECTORY(share)/d' \
-e '/INCLUDE(cmake\/boost/d' \
-e 's/MY_RPM rpm/MY_RPM rpmNOTEXISTENT/' \
CMakeLists.txt || die
# Skip building clients
echo > client/CMakeLists.txt || die
# Forcefully disable auth plugin
if ! use ldap ; then
sed -i -e '/MYSQL_CHECK_SASL/d' CMakeLists.txt || die
echo > libmysql/authentication_ldap/CMakeLists.txt || die
fi
cmake_src_prepare
}
multilib_src_configure() {
CMAKE_BUILD_TYPE="RelWithDebInfo"
# Code is now requiring C++17 due to https://github.com/mysql/mysql-server/commit/236ab55bedd8c9eacd80766d85edde2a8afacd08
append-cxxflags -std=c++17
local mycmakeargs=(
-DCMAKE_C_FLAGS_RELWITHDEBINFO=-DNDEBUG
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-DNDEBUG
-DINSTALL_LAYOUT=RPM
-DINSTALL_LIBDIR=$(get_libdir)
-DWITH_DEFAULT_COMPILER_OPTIONS=OFF
-DENABLED_LOCAL_INFILE=ON
-DMYSQL_UNIX_ADDR="${EPREFIX}/run/mysqld/mysqld.sock"
-DWITH_LZ4=system
-DWITH_NUMA=OFF
-DWITH_SSL=system
-DWITH_ZLIB=system
-DWITH_ZSTD=system
-DLIBMYSQL_OS_OUTPUT_NAME=mysqlclient
-DSHARED_LIB_PATCH_VERSION="0"
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DWITHOUT_SERVER=ON
)
cmake_src_configure
}
multilib_src_install_all() {
doman \
man/my_print_defaults.1 \
man/perror.1 \
man/zlib_decompress.1
if ! use static-libs ; then
find "${ED}" -name "*.a" -delete || die
fi
}

@ -1,2 +1 @@
DIST ocp-0.2.tar.gz 144968 BLAKE2B 495b2af182768a0c18b08350fb77b09964be52afd72f3ff610ed6a0a54905b116744c93c6261986ca48a0a0c56fd23fd2d15d1919f4c8a4ff8b55ebe532efa07 SHA512 0ff132a368a615c2a8e8ecb391da138ce9fd52d638de82e5a4d1c9ec3340b117c9c4d8f971ee86724664f93b4073b189407c3c19a0c22c961922145d30221c85
DIST ocp-0.3.tar.gz 156447 BLAKE2B 0c7f8743fe4ae46c3b9d95847e39c51fd1b829af9e9a7e87f3b7a59ab146a89ccf0913bebc3b1c0ef985b0faf24152756dc73f243217e4d2dcf8013de342ed27 SHA512 1af862f21cc3572344d26b6765a93e4e9c8744e01d550a36647afbe690886717e3fb1d8264832563161d65d04c41fe183dd8b518320df959fd3aa4ebbe602d38

@ -1,41 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit flag-o-matic
DESCRIPTION="Oracle copy tool"
HOMEPAGE="https://github.com/maxsatula/ocp"
if [[ ${PV} == *9999 ]]; then
EGIT_REPO_URI="https://github.com/maxsatula/ocp.git"
EGIT_BRANCH="develop"
inherit git-r3 autotools
else
SRC_URI="https://github.com/maxsatula/ocp/releases/download/v${PV}/${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-2"
SLOT="0"
IUSE=""
RDEPEND="
dev-db/oracle-instantclient[sdk]
dev-libs/popt
sys-libs/zlib"
DEPEND="${RDEPEND}"
src_prepare() {
default
if [[ ${PV} == *9999 ]] ; then
eautoreconf
fi
}
src_configure() {
append-ldflags $(no-as-needed)
default
}

@ -1,22 +1,6 @@
DIST postgresql-10.19.tar.bz2 19261478 BLAKE2B 3ccd44d68980ddb0e394b811af20c213cf89eb8d4374d2c49c9cda5165f222ca849a2db4fe4d521991f15f9cc84ec35bafa91083b9625f2a6729159f490a94c9 SHA512 41b0f5026be7d563e41b54e9ea7199dd466a132d355be0b71a91d41f533d97fbf550eccf2a2ece3d60c5dab5921ebeea3ac4780c18c54b924df52d7423305a22
DIST postgresql-10.20.tar.bz2 19371473 BLAKE2B 24ce3e3dda749375e999206307154e79bf15d20b3cd598ba0b78bf27976241d71e88e6fa4cd459b675bc9a9047e9315321b1535dbb41ed9e558858c2a7e9dd31 SHA512 44cfca541947d58c70593b767d3c2423f20cc6904f3d4cea8f63c1802ccbc569130c4a2a15f1af152285926f6a200e13d59c21584295dafd6f6e74bd38251428
DIST postgresql-10.21.tar.bz2 19409454 BLAKE2B 5e43abaee8156b9eb99360efeb25ba268f93a60ac2c29044d9025c4faa8753d84cb3c0c8cbcd65eb9e0eb094ebf63e0cc1cbd0ef12c0a2faa360754e63ae106a SHA512 1053e15505c0448df491119c9aad1617889b66118628a2155e3ec87e6648b2071a0a54e10d8fbbe00161b2aa86d1a6194d932a8cf5808c626e7972d135bb05c5
DIST postgresql-10.22.tar.bz2 19455874 BLAKE2B 10a8a894ba6e649abcc68abfd829bd30bca04b6e90f987ae5771fe02474517254ea2b48c7c9f2a899309de7b84aeaf13bac025965a9cc44814727ba257a633d7 SHA512 2e1ea75be7696ffbbb947351a8e8e55aaf067f86ad318308499a6a58797f0bf86227ed33e257e261c5c71ebba2f73ba514ef195a2394b91414ce6a0c3ab62532
DIST postgresql-11.14.tar.bz2 20172910 BLAKE2B a033752fc5fc593c96fe63a258b2cc0d4b896548a366e3fefa8afde1f96ab64aab97eb395b10ae10494709963ed924623279f76f66870c4faee435969400c1b7 SHA512 ab71461ee6fb4cdc5b4240f7ecd8af2497ce6780283fde2abf5951ffdb616bd0c8ed22b26fdfca402a346e663ff77c4d17f3284c9d700e6fd6795b2aec97c9be
DIST postgresql-11.15.tar.bz2 20245750 BLAKE2B f6a632606fe4b34b2a44df2c165ccfa6e890b85f4f6048994f781428bbd1de6888a24493fb5d0c231f3f34e6a4e94cfd23078a9afdaf5925d284b4854847d23f SHA512 1eba7bddee1edf034617102c1d61ad0aa1b58927dad63de1d054817966c4c9a1d7d3fa6f6896af3fe5a6880b09a6ec86be298256ee6ecc3705ff2654d3d00c74
DIST postgresql-11.16.tar.bz2 20347100 BLAKE2B 240e86b68ff8833265f10802da2fb847d72e38ac9325fc56bb6864266b2ad98939170038ccdb7044ae16f9fd29e7a9e1d404456d8bc7d53430067d714b9bb563 SHA512 e1b6be0a97e60cdd95cd0ebc756b1de6abf2f33f41f6a80da3dff25483a30146fb6bf750ab787bb5bb4f2a04718946c7429e71f891cbd491001e9f9c2ea8e63c
DIST postgresql-11.17.tar.bz2 20385599 BLAKE2B d145bc0f5e0f277be91bf46868c78c9ce5bb2eebbbd84fbdcdbb1ec115911d124a0a054df783739fb912eeae1322fb7eb58b7b1b8d40a8f81cffe2f24d3dda01 SHA512 35304279c06577eca134581490710db976edeac8cca169d3436fcdce8eebb18159459ea3b5ef403f6a8efe85542726f9960c4ca653da4619e081ce5869866032
DIST postgresql-12.10.tar.bz2 20990621 BLAKE2B a7a56cf75944c558ae9bb9165dfb17b30cc5f7a865961e0a588677e4dd3e53d1fab15a212a21ec12f8e7b669a448d78efa0dfe985fd4902e16485a298c7adc62 SHA512 befedb14320aa033dc55bbb93bbbec4e67d9cfced63be0e4f631c7495a0fbc6fe280bd6d2fb941d7a2e6b2ac570b7f40d8db7f07a192a81bd9cd63c6c244a9c5
DIST postgresql-12.11.tar.bz2 21086745 BLAKE2B 7062d334f3ef3b98f69e709f5de744324c7ce53ea516384902632a454a2ccadfd7bcc0c9ef4d51a685dd7a06e1fdccc292109294517831181c3db30bc2b7be91 SHA512 705e9e1ccf8202062cce61069b5ddb7db5f804dd0736c620640ce5622b9e42fdcbc1417771e77d51aa54beb4562a09b4307f2ff7dec135bd0e31f4941ca36ac8
DIST postgresql-12.12.tar.bz2 21089064 BLAKE2B 7285dcfc8ed6cf2dbbe29d894dbcef53fad18cbeddbfdb3a43893234a1ee75a9bf5d966968a0c481a8ab15bf8a37400bf6eb4b57a83359501b729e70398e3551 SHA512 eeff79279ac11db04fdddeb2c52ba1ec6b549223b862222540e1f659fbfc3617130699c22694b465bde46b1a4a665c01aef70b68b86d80e58a5657efd019407d
DIST postgresql-12.9.tar.bz2 20904260 BLAKE2B fc88d61d369569a3054b889848eaf1405a4f5137cd8c2cf27282115f70853dd4d5d8b4bf0a9fc60c63db936246a0a64077c9bfdb90685d4dfe375558e4519b2b SHA512 11697d8283f5df5a9c74c2406e94d1b6da6df8358ad48f3b773825aab98e8395f9fd4e3fc8b1e6ebad3743c3dadbda8b795d4fe84a447d7913223e136cf2b88f
DIST postgresql-13.5.tar.bz2 21186674 BLAKE2B 3e51d6d67bba09fb134cd71c48349674e0cacfaefee299620482c93f0b09edbfead578deb63083686ab691563b088fc0ea60a6281a0bcf9145689fb3ce1ec0f0 SHA512 c76effbca8ee63be48fa3aeb39c7038221848fe83ca2afc4e0904ba8c6a50b89aa2ad37080d4e3be75e9bdc2d6ca6dfefcda334ef55a5e1a8954bb955ce905e5
DIST postgresql-13.6.tar.bz2 21257213 BLAKE2B f5ea95fd9ffc8846e0aaf5bac03b02afa71e62e796bbe40f68af727a2f3c74eddd98cb68427bcc13b87b6fa00a8e2a7b18dd7749318f0a4a32cfdbf9b0e0a873 SHA512 2852726a3031b8d469f1c38f3019af02fc5afe40ec27b22288a29acefd30c63a98806bce88a214d0c2f9177f547b0b5010ad64e70bcbe2c2f1d97a27ae1984f8
DIST postgresql-13.7.tar.bz2 21364433 BLAKE2B 2d8a505f6de4eb31cae415529eeac750a60abafcf45e7fde29043597b385a8150fac55df659f8c2ad200822e8063d388ed606dff9108d4407f9e26b893fa62f4 SHA512 9254f21519c8d4e926f70082503bb5593c91064a3d2a4ea18ac503dfd9aa94751d6f01ce00fca9fec9b2b7af40caf8d0951b661dd8be4d6aa87c1e35b6fa7a41
DIST postgresql-13.8.tar.bz2 21397381 BLAKE2B eb076382027a175789652a6ae8579d9b9c8856918741e8058456d22f1ef89525cff5fafe863bf615f658bc94b740b00d1268825969e37a7cefed6b5c90f402c5 SHA512 3b39448b291342a5e9b610d410c222aeb85f8acf95632e73e138ae316133af3dadc795a6e706f6447f543cf10df3c786da4f1afa1d91489b50eb77e2d9ed5d84
DIST postgresql-14.1.tar.bz2 21887101 BLAKE2B a496dfd513c52339d1b3cb72773f9611721fd7c5d2a702d6fd71f650a1d41c3d7bf6574eba23671c7f9f11718e007f51f9547949bdc3d7fe1ea2248ebfb8d70b SHA512 4a0bec157d5464bb9e5f5c0eb0efdede55526e03f6f4d660b87d161a47705eb152fa0878960b1581bce42a5ed28a1f457825ea54e8d22e34b5b8eb36473ceefd
DIST postgresql-14.2.tar.bz2 21964841 BLAKE2B 6460533a40064404f18642147b949cf7c85d036c45ede478fb9af8919895ee7b09dc78b89ed08a292226911f07cfc9e46d7f2d42e0aaea546c5e97a291d599b9 SHA512 19aeb6528605dbcf5df84048b2eed8f54b202576134d3fe3900bb8f073179c4258d2581acd745887e7e6fa86ebdb5f7b159ffaa0a645d601efee7c5f7730456b
DIST postgresql-14.4.tar.bz2 22094218 BLAKE2B 05b65083d826ed2f451b31b29b4b247dfd76b3d24ef05f6be128ee9e58d521d506a3ec4ae4839cbb74d8e217dfae81a95bd97894a778ef3c47b907b85b1fb25e SHA512 dd2f80248684e331d2ffb1e26cd2a285df1fb18710807a0c31aedabf917912ce9267f8ca26318e5371d916c6fe476f8a17886d82d3ff86a974e6f24c19a6aafb
DIST postgresql-14.5.tar.bz2 22132996 BLAKE2B 6d303850ef1e8f9f5d66a53275fc814475646c762b9747a4f0401a472ebaf59be06d6e7c08e9c1c5ad5d3b9dbc3bb3c06d58bae137806e1a437c86bcc8cae501 SHA512 3051c5ab729f6a55952c6108098b022517398b1de64f7fefbdd6c806c7e2eb0637d00f3c98a6203c5bee654656528c4ff3530db5a69470e7888864c77900178a
DIST postgresql-15beta2.tar.bz2 23511057 BLAKE2B d1e6d8ce67998d4295587780c2cb75f33b930556e11fd95bbd4d828086f63faed6bbddbb809ebc1fddf0980c83c7cf51e3d37f110d7bb68959dab34f61b5b8c9 SHA512 139bf4f95e2bc8942666009c6680d2b61d8ea2898e9e7eb3a0afb118f0bf6acfac5f21676525cccd82e9ee5c43ad79e07e23a55333e1318426d8b9bc95a4f00d
DIST postgresql-15beta3.tar.bz2 23585136 BLAKE2B cdea196fb62587800f7fceafcbbd781f5636323fc6b205a0e5e0081964f2d08fcb421d0d66f710150dba37f30c2b0e7f7b3119a9a83a0cc573104968b16fc043 SHA512 caf79b889ca1325bcbdce3bbbcb3a0707b8928c8bd7b97f594cfedaedc06826e829a561b2fde73210c1e2596a0201305fa350bb3f12c05783014fc0c8564298a

@ -1,154 +0,0 @@
From d9f7ad54e552262ee0090e88d5abd3e04fcdeac8 Mon Sep 17 00:00:00 2001
From: Thomas Munro <tmunro@postgresql.org>
Date: Wed, 16 Mar 2022 11:35:00 +1300
Subject: [PATCH] Back-patch LLVM 14 API changes.
Since LLVM 14 has stopped changing and is about to be released,
back-patch the following changes from the master branch:
e6a7600202105919bffd62b3dfd941f4a94e082b
807fee1a39de6bb8184082012e643951abb9ad1d
a56e7b66010f330782243de9e25ac2a6596be0e1
Back-patch to 11, where LLVM JIT support came in.
---
src/backend/jit/llvm/Makefile | 6 +++++
src/backend/jit/llvm/llvmjit_error.cpp | 35 +++++++++++++++++++++----
src/backend/jit/llvm/llvmjit_inline.cpp | 12 ++++++++-
3 files changed, 47 insertions(+), 6 deletions(-)
diff --git a/src/backend/jit/llvm/Makefile b/src/backend/jit/llvm/Makefile
index 0268bd46d5..2da122a391 100644
--- a/src/backend/jit/llvm/Makefile
+++ b/src/backend/jit/llvm/Makefile
@@ -22,6 +22,12 @@ endif
PGFILEDESC = "llvmjit - JIT using LLVM"
NAME = llvmjit
+# LLVM 14 produces deprecation warnings. We'll need to make some changes
+# before the relevant functions are removed, but for now silence the warnings.
+ifeq ($(GCC), yes)
+LLVM_CFLAGS += -Wno-deprecated-declarations
+endif
+
# All files in this directory use LLVM.
CFLAGS += $(LLVM_CFLAGS)
CXXFLAGS += $(LLVM_CXXFLAGS)
diff --git a/src/backend/jit/llvm/llvmjit_error.cpp b/src/backend/jit/llvm/llvmjit_error.cpp
index f4720732a3..5ad92f3090 100644
--- a/src/backend/jit/llvm/llvmjit_error.cpp
+++ b/src/backend/jit/llvm/llvmjit_error.cpp
@@ -23,15 +23,22 @@ extern "C"
#include "jit/llvmjit.h"
+#include <new>
static int fatal_new_handler_depth = 0;
static std::new_handler old_new_handler = NULL;
static void fatal_system_new_handler(void);
#if LLVM_VERSION_MAJOR > 4
+static void fatal_llvm_new_handler(void *user_data, const char *reason, bool gen_crash_diag);
+#if LLVM_VERSION_MAJOR < 14
static void fatal_llvm_new_handler(void *user_data, const std::string& reason, bool gen_crash_diag);
#endif
+#endif
+static void fatal_llvm_error_handler(void *user_data, const char *reason, bool gen_crash_diag);
+#if LLVM_VERSION_MAJOR < 14
static void fatal_llvm_error_handler(void *user_data, const std::string& reason, bool gen_crash_diag);
+#endif
/*
@@ -129,23 +136,41 @@ fatal_system_new_handler(void)
#if LLVM_VERSION_MAJOR > 4
static void
fatal_llvm_new_handler(void *user_data,
- const std::string& reason,
+ const char *reason,
bool gen_crash_diag)
{
ereport(FATAL,
(errcode(ERRCODE_OUT_OF_MEMORY),
errmsg("out of memory"),
- errdetail("While in LLVM: %s", reason.c_str())));
+ errdetail("While in LLVM: %s", reason)));
+}
+#if LLVM_VERSION_MAJOR < 14
+static void
+fatal_llvm_new_handler(void *user_data,
+ const std::string& reason,
+ bool gen_crash_diag)
+{
+ fatal_llvm_new_handler(user_data, reason.c_str(), gen_crash_diag);
}
#endif
+#endif
static void
fatal_llvm_error_handler(void *user_data,
- const std::string& reason,
+ const char *reason,
bool gen_crash_diag)
{
ereport(FATAL,
(errcode(ERRCODE_OUT_OF_MEMORY),
- errmsg("fatal llvm error: %s",
- reason.c_str())));
+ errmsg("fatal llvm error: %s", reason)));
}
+
+#if LLVM_VERSION_MAJOR < 14
+static void
+fatal_llvm_error_handler(void *user_data,
+ const std::string& reason,
+ bool gen_crash_diag)
+{
+ fatal_llvm_error_handler(user_data, reason.c_str(), gen_crash_diag);
+}
+#endif
diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
index 6f03595db5..9bb4b672a7 100644
--- a/src/backend/jit/llvm/llvmjit_inline.cpp
+++ b/src/backend/jit/llvm/llvmjit_inline.cpp
@@ -594,7 +594,11 @@ function_inlinable(llvm::Function &F,
if (F.materialize())
elog(FATAL, "failed to materialize metadata");
- if (F.getAttributes().hasFnAttribute(llvm::Attribute::NoInline))
+#if LLVM_VERSION_MAJOR < 14
+#define hasFnAttr hasFnAttribute
+#endif
+
+ if (F.getAttributes().hasFnAttr(llvm::Attribute::NoInline))
{
ilog(DEBUG1, "ineligibile to import %s due to noinline",
F.getName().data());
@@ -871,7 +875,9 @@ create_redirection_function(std::unique_ptr<llvm::Module> &importMod,
llvm::Function *AF;
llvm::BasicBlock *BB;
llvm::CallInst *fwdcall;
+#if LLVM_VERSION_MAJOR < 14
llvm::Attribute inlineAttribute;
+#endif
AF = llvm::Function::Create(F->getFunctionType(),
LinkageTypes::AvailableExternallyLinkage,
@@ -880,9 +886,13 @@ create_redirection_function(std::unique_ptr<llvm::Module> &importMod,
Builder.SetInsertPoint(BB);
fwdcall = Builder.CreateCall(F, &*AF->arg_begin());
+#if LLVM_VERSION_MAJOR < 14
inlineAttribute = llvm::Attribute::get(Context,
llvm::Attribute::AlwaysInline);
fwdcall->addAttribute(~0U, inlineAttribute);
+#else
+ fwdcall->addFnAttr(llvm::Attribute::AlwaysInline);
+#endif
Builder.CreateRet(fwdcall);
return AF;
--
2.30.2

@ -1,149 +0,0 @@
diff -Naruw postgresql-13beta1.orig/contrib/Makefile postgresql-13beta1/contrib/Makefile
--- postgresql-13beta1.orig/contrib/Makefile 2020-05-18 16:09:19.000000000 -0400
+++ postgresql-13beta1/contrib/Makefile 2020-05-22 19:56:42.560113731 -0400
@@ -5,56 +5,9 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- adminpack \
- amcheck \
- auth_delay \
- auto_explain \
- bloom \
- btree_gin \
- btree_gist \
- citext \
- cube \
- dblink \
- dict_int \
- dict_xsyn \
- earthdistance \
- file_fdw \
- fuzzystrmatch \
- hstore \
- intagg \
- intarray \
- isn \
- lo \
- ltree \
oid2name \
- pageinspect \
- passwordcheck \
- pg_buffercache \
- pg_freespacemap \
- pg_prewarm \
- pg_standby \
- pg_stat_statements \
- pg_trgm \
- pgcrypto \
- pgrowlocks \
- pgstattuple \
- pg_visibility \
- postgres_fdw \
- seg \
- spi \
- tablefunc \
- tcn \
- test_decoding \
- tsm_system_rows \
- tsm_system_time \
- unaccent \
vacuumlo
-ifeq ($(with_openssl),yes)
-SUBDIRS += sslinfo
-else
-ALWAYS_SUBDIRS += sslinfo
-endif
ifneq ($(with_uuid),no)
SUBDIRS += uuid-ossp
diff -Naruw postgresql-13beta1.orig/src/backend/Makefile postgresql-13beta1/src/backend/Makefile
--- postgresql-13beta1.orig/src/backend/Makefile 2020-05-18 16:09:19.000000000 -0400
+++ postgresql-13beta1/src/backend/Makefile 2020-05-22 19:58:14.403299909 -0400
@@ -56,7 +56,7 @@
##########################################################################
-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP)
+all: generated-headers
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
@@ -195,23 +195,7 @@
##########################################################################
-install: all installdirs install-bin
-ifeq ($(PORTNAME), cygwin)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
-ifeq ($(PORTNAME), win32)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
- $(MAKE) -C catalog install-data
- $(MAKE) -C tsearch install-data
- $(MAKE) -C utils install-data
- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
+install:
ifeq ($(with_llvm), yes)
install-bin: install-postgres-bitcode
diff -Naruw postgresql-13beta1.orig/src/bin/Makefile postgresql-13beta1/src/bin/Makefile
--- postgresql-13beta1.orig/src/bin/Makefile 2020-05-18 16:09:19.000000000 -0400
+++ postgresql-13beta1/src/bin/Makefile 2020-05-22 19:59:11.399875256 -0400
@@ -14,22 +14,8 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- initdb \
- pg_archivecleanup \
- pg_basebackup \
- pg_checksums \
pg_config \
- pg_controldata \
- pg_ctl \
pg_dump \
- pg_resetwal \
- pg_rewind \
- pg_test_fsync \
- pg_test_timing \
- pg_upgrade \
- pg_verifybackup \
- pg_waldump \
- pgbench \
psql \
scripts
diff -Naruw postgresql-13beta1.orig/src/Makefile postgresql-13beta1/src/Makefile
--- postgresql-13beta1.orig/src/Makefile 2020-05-18 16:09:19.000000000 -0400
+++ postgresql-13beta1/src/Makefile 2020-05-22 19:59:59.656464613 -0400
@@ -15,21 +15,12 @@
SUBDIRS = \
common \
port \
- timezone \
backend \
- backend/utils/mb/conversion_procs \
- backend/snowball \
include \
interfaces \
- backend/replication/libpqwalreceiver \
- backend/replication/pgoutput \
fe_utils \
bin \
- pl \
- makefiles \
- test/regress \
- test/isolation \
- test/perl
+ makefiles
ifeq ($(with_llvm), yes)
SUBDIRS += backend/jit/llvm

@ -1,151 +0,0 @@
diff -Naruw a/contrib/Makefile b/contrib/Makefile
--- a/contrib/Makefile 2021-09-20 17:33:01.000000000 -0400
+++ b/contrib/Makefile 2021-09-23 16:28:52.919265033 -0400
@@ -5,57 +5,9 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- adminpack \
- amcheck \
- auth_delay \
- auto_explain \
- bloom \
- btree_gin \
- btree_gist \
- citext \
- cube \
- dblink \
- dict_int \
- dict_xsyn \
- earthdistance \
- file_fdw \
- fuzzystrmatch \
- hstore \
- intagg \
- intarray \
- isn \
- lo \
- ltree \
oid2name \
- old_snapshot \
- pageinspect \
- passwordcheck \
- pg_buffercache \
- pg_freespacemap \
- pg_prewarm \
- pg_stat_statements \
- pg_surgery \
- pg_trgm \
- pgcrypto \
- pgrowlocks \
- pgstattuple \
- pg_visibility \
- postgres_fdw \
- seg \
- spi \
- tablefunc \
- tcn \
- test_decoding \
- tsm_system_rows \
- tsm_system_time \
- unaccent \
vacuumlo
-ifeq ($(with_ssl),openssl)
-SUBDIRS += sslinfo
-else
-ALWAYS_SUBDIRS += sslinfo
-endif
ifneq ($(with_uuid),no)
SUBDIRS += uuid-ossp
diff -Naruw a/src/backend/Makefile b/src/backend/Makefile
--- a/src/backend/Makefile 2021-09-20 17:33:01.000000000 -0400
+++ b/src/backend/Makefile 2021-09-23 16:30:03.015728022 -0400
@@ -56,7 +56,7 @@
##########################################################################
-all: submake-libpgport submake-catalog-headers submake-utils-headers postgres $(POSTGRES_IMP)
+all: generated-headers
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
@@ -194,23 +194,7 @@
##########################################################################
-install: all installdirs install-bin
-ifeq ($(PORTNAME), cygwin)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
-ifeq ($(PORTNAME), win32)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
- $(MAKE) -C catalog install-data
- $(MAKE) -C tsearch install-data
- $(MAKE) -C utils install-data
- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
+install:
ifeq ($(with_llvm), yes)
install-bin: install-postgres-bitcode
diff -Naruw a/src/bin/Makefile b/src/bin/Makefile
--- a/src/bin/Makefile 2021-09-20 17:33:01.000000000 -0400
+++ b/src/bin/Makefile 2021-09-23 16:30:50.718922745 -0400
@@ -14,23 +14,8 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- initdb \
- pg_amcheck \
- pg_archivecleanup \
- pg_basebackup \
- pg_checksums \
pg_config \
- pg_controldata \
- pg_ctl \
pg_dump \
- pg_resetwal \
- pg_rewind \
- pg_test_fsync \
- pg_test_timing \
- pg_upgrade \
- pg_verifybackup \
- pg_waldump \
- pgbench \
psql \
scripts
diff -Naruw a/src/Makefile b/src/Makefile
--- a/src/Makefile 2021-09-20 17:33:01.000000000 -0400
+++ b/src/Makefile 2021-09-23 16:31:41.842107531 -0400
@@ -15,21 +15,12 @@
SUBDIRS = \
common \
port \
- timezone \
backend \
- backend/utils/mb/conversion_procs \
- backend/snowball \
include \
interfaces \
- backend/replication/libpqwalreceiver \
- backend/replication/pgoutput \
fe_utils \
bin \
- pl \
- makefiles \
- test/regress \
- test/isolation \
- test/perl
+ makefiles
ifeq ($(with_llvm), yes)
SUBDIRS += backend/jit/llvm

@ -1,141 +0,0 @@
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -5,57 +5,9 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- adminpack \
- auth_delay \
- auto_explain \
- bloom \
- btree_gin \
- btree_gist \
- chkpass \
- citext \
- cube \
- dblink \
- dict_int \
- dict_xsyn \
- earthdistance \
- file_fdw \
- fuzzystrmatch \
- hstore \
- intagg \
- intarray \
- isn \
- lo \
- ltree \
oid2name \
- pageinspect \
- passwordcheck \
- pg_buffercache \
- pg_freespacemap \
- pg_prewarm \
- pg_standby \
- pg_stat_statements \
- pg_trgm \
- pgcrypto \
- pgrowlocks \
- pgstattuple \
- pg_visibility \
- postgres_fdw \
- seg \
- spi \
- tablefunc \
- tcn \
- test_decoding \
- tsm_system_rows \
- tsm_system_time \
- tsearch2 \
- unaccent \
vacuumlo
-ifeq ($(with_openssl),yes)
-SUBDIRS += sslinfo
-else
-ALWAYS_SUBDIRS += sslinfo
-endif
ifneq ($(with_uuid),no)
SUBDIRS += uuid-ossp
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -51,7 +51,7 @@
##########################################################################
-all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP)
+all: generated-headers
ifneq ($(PORTNAME), cygwin)
ifneq ($(PORTNAME), win32)
@@ -218,23 +218,7 @@
##########################################################################
-install: all installdirs install-bin
-ifeq ($(PORTNAME), cygwin)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
-ifeq ($(PORTNAME), win32)
-ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
-endif
-endif
- $(MAKE) -C catalog install-data
- $(MAKE) -C tsearch install-data
- $(INSTALL_DATA) $(srcdir)/libpq/pg_hba.conf.sample '$(DESTDIR)$(datadir)/pg_hba.conf.sample'
- $(INSTALL_DATA) $(srcdir)/libpq/pg_ident.conf.sample '$(DESTDIR)$(datadir)/pg_ident.conf.sample'
- $(INSTALL_DATA) $(srcdir)/utils/misc/postgresql.conf.sample '$(DESTDIR)$(datadir)/postgresql.conf.sample'
- $(INSTALL_DATA) $(srcdir)/access/transam/recovery.conf.sample '$(DESTDIR)$(datadir)/recovery.conf.sample'
+install:
install-bin: postgres $(POSTGRES_IMP) installdirs
$(INSTALL_PROGRAM) postgres$(X) '$(DESTDIR)$(bindir)/postgres$(X)'
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -14,19 +14,8 @@
include $(top_builddir)/src/Makefile.global
SUBDIRS = \
- initdb \
- pg_archivecleanup \
- pg_basebackup \
pg_config \
- pg_controldata \
- pg_ctl \
pg_dump \
- pg_resetxlog \
- pg_rewind \
- pg_test_fsync \
- pg_test_timing \
- pg_upgrade \
- pg_xlogdump \
pgbench \
psql \
scripts
--- a/src/Makefile
+++ b/src/Makefile
@@ -15,19 +15,12 @@
SUBDIRS = \
common \
port \
- timezone \
backend \
- backend/utils/mb/conversion_procs \
- backend/snowball \
include \
interfaces \
- backend/replication/libpqwalreceiver \
fe_utils \
bin \
- pl \
- makefiles \
- test/regress \
- test/perl
+ makefiles
# There are too many interdependencies between the subdirectories, so
# don't attempt parallel make here.

@ -1,453 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
inherit flag-o-matic linux-info multilib pam prefix 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
}

@ -1,453 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
inherit flag-o-matic linux-info multilib pam prefix 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
}

@ -1,453 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10,11} )
inherit flag-o-matic linux-info multilib pam prefix 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
}

@ -1,453 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
LLVM_MAX_SLOT=13
inherit flag-o-matic linux-info llvm multilib pam prefix 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-14:=
<sys-devel/clang-14:=
)
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-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
LLVM_MAX_SLOT=13
inherit flag-o-matic linux-info llvm multilib pam prefix 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-14:=
<sys-devel/clang-14:=
)
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-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10,11} )
LLVM_MAX_SLOT=13
inherit flag-o-matic linux-info llvm multilib pam prefix 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-14:=
<sys-devel/clang-14:=
)
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,454 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm multilib pam prefix 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"
use llvm && eapply "${FILESDIR}/postgres-llvm14.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-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10,11} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm multilib pam prefix 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,454 +0,0 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{8,9,10} )
LLVM_MAX_SLOT=14
inherit flag-o-matic linux-info llvm multilib pam prefix 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"
use llvm && eapply "${FILESDIR}/postgres-llvm14.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
}

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

Loading…
Cancel
Save