From f4fc10428424904caf2035cffc442195cb088b2c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 28 Jul 2021 10:27:13 +0100 Subject: gentoo resync : 28.07.2021 --- dev-db/Manifest.gz | Bin 17428 -> 17432 bytes dev-db/freetds/Manifest | 2 +- dev-db/freetds/freetds-1.2.18.ebuild | 2 +- dev-db/mongodb/Manifest | 2 +- dev-db/mongodb/mongodb-4.4.4.ebuild | 4 +- dev-db/postgresql/Manifest | 6 +- dev-db/postgresql/postgresql-10.17-r1.ebuild | 458 ++++++++++++++++++++++++ dev-db/postgresql/postgresql-10.17.ebuild | 458 ------------------------ dev-db/postgresql/postgresql-9.5.25-r1.ebuild | 474 +++++++++++++++++++++++++ dev-db/postgresql/postgresql-9.5.25.ebuild | 473 ------------------------- dev-db/postgresql/postgresql-9.6.22-r1.ebuild | 478 ++++++++++++++++++++++++++ dev-db/postgresql/postgresql-9.6.22.ebuild | 478 -------------------------- dev-db/redis/Manifest | 8 +- dev-db/redis/redis-5.0.13.ebuild | 2 +- dev-db/redis/redis-6.0.15.ebuild | 2 +- dev-db/redis/redis-6.2.4.ebuild | 2 +- dev-db/redis/redis-6.2.5.ebuild | 2 +- dev-db/timescaledb/Manifest | 2 + dev-db/timescaledb/timescaledb-2.3.1.ebuild | 67 ++++ 19 files changed, 1495 insertions(+), 1425 deletions(-) create mode 100644 dev-db/postgresql/postgresql-10.17-r1.ebuild delete mode 100644 dev-db/postgresql/postgresql-10.17.ebuild create mode 100644 dev-db/postgresql/postgresql-9.5.25-r1.ebuild delete mode 100644 dev-db/postgresql/postgresql-9.5.25.ebuild create mode 100644 dev-db/postgresql/postgresql-9.6.22-r1.ebuild delete mode 100644 dev-db/postgresql/postgresql-9.6.22.ebuild create mode 100644 dev-db/timescaledb/timescaledb-2.3.1.ebuild (limited to 'dev-db') diff --git a/dev-db/Manifest.gz b/dev-db/Manifest.gz index 31dcab8eaf9f..1b16593e8fc4 100644 Binary files a/dev-db/Manifest.gz and b/dev-db/Manifest.gz differ diff --git a/dev-db/freetds/Manifest b/dev-db/freetds/Manifest index 80c957242d33..74675f2310cd 100644 --- a/dev-db/freetds/Manifest +++ b/dev-db/freetds/Manifest @@ -1,3 +1,3 @@ DIST freetds-dev.1.2.18.tar.gz 3406990 BLAKE2B f0134ee0a322cb9e7a7fefbf9e85c60b826318b546febde78e53d5ec22dc2c8e269b7e830da6d84267d16a2dc2cf367a54354765017a40e07af2c3c6be54676e SHA512 315f40ba0d97281f852ec99fac457ec4b2a30879a2384bfa2d7c680aad6c056b6ae23fc192c18db4fba75caff552ef86de7bbfc5d7b608ea5a12531bf9eadc4c -EBUILD freetds-1.2.18.ebuild 1625 BLAKE2B 0f2e83255054643737d7021e29308dece9ff46a4547ffbd4fcdc26f72ab2004e27933a36fd6885a195f6111dcd27aa1a8fba6ce1f8452938ee736d0c3bd4f3bf SHA512 abc829cd14841936fe471efb82367b1047e8fd418f0ea5e83b3d41befef7c6f1a2ef37464f8576dafd175f1a3815dd4fc463734ef0c9a938de844a8b3d4a3c4e +EBUILD freetds-1.2.18.ebuild 1632 BLAKE2B fb9bcb35818ae19259f742a6a38dbdba496460b93db963b486497374445649f1816e9b02adb151bee960172b90c9d42401f707bd9b111df70a24a50510fd741c SHA512 928fc6c6c24263fc65defa8b907a8401bb6d241cfc30913e0fb888d6b42a107d89e9d399eaeaa44cdacd91fd62c3e70bc1f1911f83e5a5ab542d07b0803da8b0 MISC metadata.xml 251 BLAKE2B 632781bc9fafff55239abb98f5b98cd2dfb01f5f8949dec160ef1007a7cfd513ff9f630157acb90efa4d03183cf9fecd5965d79a46ceea694961ff120dc3486c SHA512 8b481bb37df703c67035739c99511a846fa86d497f4d2bb7a8b86a9409cabcfce2b4c0011828c9e42077234ac1ab4af96c2f0c01dd6e7e65ac93b6f75c0779a1 diff --git a/dev-db/freetds/freetds-1.2.18.ebuild b/dev-db/freetds/freetds-1.2.18.ebuild index b865247ced52..50ee8acd8d37 100644 --- a/dev-db/freetds/freetds-1.2.18.ebuild +++ b/dev-db/freetds/freetds-1.2.18.ebuild @@ -13,7 +13,7 @@ SRC_URI="ftp://ftp.freetds.org/pub/${PN}/current/${MY_PN}.${PV}.tar.gz" LICENSE="GPL-2" SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~ppc-macos" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~ppc-macos" IUSE="debug gnutls iconv kerberos mssql iodbc odbc ssl static-libs" # iODBC and unixODBC are mutually-exclusive choices for diff --git a/dev-db/mongodb/Manifest b/dev-db/mongodb/Manifest index 6f22b6b52183..ab81c1afdaea 100644 --- a/dev-db/mongodb/Manifest +++ b/dev-db/mongodb/Manifest @@ -22,5 +22,5 @@ EBUILD mongodb-4.2.11.ebuild 4726 BLAKE2B 96668733887275f32dd52ef11fb0dbee680b77 EBUILD mongodb-4.2.12.ebuild 4727 BLAKE2B ed78acf75ea3960ff6ba13c816e1a5e8b73696d083b45f596c4d31954467726d9e6096ce7f30b5a80a60dcd9b6ee99972cf83ed23fced789b9e4d8d29c9845a1 SHA512 6e8b9e847ffc3605d8a895c9b8701623159a3ede97cb45a1dc429e401c2cb3582e009333b4552d31e2246f1ff4d8a2dffe89d2eb54e4d99fe1315b6603c508b0 EBUILD mongodb-4.4.1.ebuild 4856 BLAKE2B 86aa185d44eea9397c191fe48a72d707e5b24bda578080524abc84ade90ebd6cca161f520263cf86b34e39c72ee57a4f96864876d3cf872d7e7c1e94208c7607 SHA512 698c382d279ca85f9d9bd8e1c03af4989967dbb1ca13f4fe90d1f73004b54f07736cafe46dc8bd34a43177131e7d150cde60ffbc6f5f7c36c1b1ed53999eaa90 EBUILD mongodb-4.4.2.ebuild 4811 BLAKE2B f94d67a464ac8b2337a9a7a98a6016380d6205a2a9f5584075b85731e97bfd19125b361d21dd74c659ee4015010460162b81e5630cadc7b0b0b71e8709b331f9 SHA512 5471a98f97268856cf99a6e80ae1c916c35f962b191ac0602a16f56074a7560c6b48f6c5a551fcbecd56b1503d161b9854c950146dcb1633756eae5bf2467380 -EBUILD mongodb-4.4.4.ebuild 4811 BLAKE2B f94d67a464ac8b2337a9a7a98a6016380d6205a2a9f5584075b85731e97bfd19125b361d21dd74c659ee4015010460162b81e5630cadc7b0b0b71e8709b331f9 SHA512 5471a98f97268856cf99a6e80ae1c916c35f962b191ac0602a16f56074a7560c6b48f6c5a551fcbecd56b1503d161b9854c950146dcb1633756eae5bf2467380 +EBUILD mongodb-4.4.4.ebuild 4818 BLAKE2B 139a4f6c196058bb13ba154fa98ed4a9890be26a9747ba7b14aceaaf58761d36a34a745fe3a5c77fcbb0856c0ff2f55c71d44c8cdd9b08f894906eb0442e2c70 SHA512 8c371b107f92c294d790c6de5222200017c461a098fda3a4cfcc473595e7dfc0527de4d1b4fb02365bc5dc5cb38f52c14df5affc399b2fb7bb7b4b39d8a0fb07 MISC metadata.xml 824 BLAKE2B d7e131d6292b092deb2001bbd6f3d6f6a908f57a064f36f64429696849633ae5ff8dee36604e9952a90ef160b834c56f91d085be7c67a6f9a973c83875bf426c SHA512 cc3555829b1587640259c30c8ede022846ad60993d064ba43d16b28ef5b4a46e5b1fad6818826d4668f0738d27a43f29c5ec769fd647076828e275b5d325e748 diff --git a/dev-db/mongodb/mongodb-4.4.4.ebuild b/dev-db/mongodb/mongodb-4.4.4.ebuild index c3ffcfa93d4c..0640079cfd65 100644 --- a/dev-db/mongodb/mongodb-4.4.4.ebuild +++ b/dev-db/mongodb/mongodb-4.4.4.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( python3_{7..9} ) +PYTHON_COMPAT=( python3_{8..9} ) SCONS_MIN_VERSION="3.3.1" CHECKREQS_DISK_BUILD="2400M" @@ -20,7 +20,7 @@ SRC_URI="https://fastdl.mongodb.org/src/${MY_P}.tar.gz" LICENSE="Apache-2.0 SSPL-1" SLOT="0" -KEYWORDS="~amd64 ~arm64" +KEYWORDS="~amd64 ~arm64 -riscv" IUSE="debug kerberos lto ssl test +tools" RESTRICT="!test? ( test )" diff --git a/dev-db/postgresql/Manifest b/dev-db/postgresql/Manifest index 8d04640cd8ce..5b21109b5f25 100644 --- a/dev-db/postgresql/Manifest +++ b/dev-db/postgresql/Manifest @@ -19,12 +19,12 @@ DIST postgresql-13.3.tar.bz2 21119109 BLAKE2B 395a3dc5cde8f579a3c35ea70346bdc630 DIST postgresql-14beta2.tar.bz2 22555641 BLAKE2B 50d928c26d679789cda82b074150b78707adb8204fcc02392a027d8b71a61a2dc80042d9f9b68eee9a36f7991178e5e24f72ba1a931d16fc5d8e81097e2874f2 SHA512 fdda7b4ea178a1c0990952da2caf07186deb2047b292c49549881e34d2e7ebb09014f914632ef3342ab7184614d47320d280cceb6bd85a93f79dfcfa68137eff DIST postgresql-9.5.25.tar.bz2 17923796 BLAKE2B 432e035e78dacddddfd46fd4d04775b61e2e4db9e61945fa5f7e1c3c5ea3516a5e327489b4e57313b0d6ba4f2e20f52a164f96db01aa22b755ff625039f262eb SHA512 621b36d767d2c7eb2e942cb7b26ca7491450fcfd9606114849f7336b4d8a0bc0196badb44da4918e748145d21b6f72ccf1255a1309dff2427da8b39b63fca427 DIST postgresql-9.6.22.tar.bz2 19003741 BLAKE2B adff6e81ec4b289bd5c51fa44adb38d7cc3936e2e5545ff23fccb0f3f1fe1c881ed70f9a0a5d366319f876eb01a9f675b66c9374b8b41615220f45a70450ad6d SHA512 371f85f2d02a8a3b888396440149e9b432f91e106a7feb8a163b275a0586843683124281a0965abf3c1215cb68e2002976913f88c75e35e52ac5f78d4145fd7b -EBUILD postgresql-10.17.ebuild 13643 BLAKE2B 06e48fa619942bbf5c9e83202988f410939bb67f08ae29b96508551103a335ad1667fad29e90144e27e0544bde1a408b64e6ef967b479fb72660a7dbd6f6aa29 SHA512 6ddfdb2b1822e1096980093432791ece0138703f6ba102f703bc1f969c5193ae312462b45f5cd0f08deeb92c4ef6d149574733ba8fa63dfe6cdf191d76285d19 +EBUILD postgresql-10.17-r1.ebuild 13643 BLAKE2B 06e48fa619942bbf5c9e83202988f410939bb67f08ae29b96508551103a335ad1667fad29e90144e27e0544bde1a408b64e6ef967b479fb72660a7dbd6f6aa29 SHA512 6ddfdb2b1822e1096980093432791ece0138703f6ba102f703bc1f969c5193ae312462b45f5cd0f08deeb92c4ef6d149574733ba8fa63dfe6cdf191d76285d19 EBUILD postgresql-11.12.ebuild 13593 BLAKE2B 9d4eaf3b84f0b5317fce6a35489a376a2e0ccd24d8096970bf24438b33dc1c0aaca22b032d5255b008b44950fdff7b5bed46e1a105e12c1c0502cd2da17a6780 SHA512 4fed5ba0d16e373c19f52a1ab8e3a8fa6cc24590f6ac914e4930dd1ed7cca1048449ad572f92a816b35f7455071dca717c480c14a334763f7cdf1a0ed1139bab EBUILD postgresql-12.7.ebuild 13565 BLAKE2B b4a8005b07b3cf5844bb46635216539d6740bffacdfed3512e10c44dc63099411d402e54f3e11732c96181381cd84e386ba700ad63800a1795a443e9e13e4261 SHA512 e557e572f9282bedde4f334c66f4f58b0fe83e8e2c5a57605037893eac904c617a6481469c5eab3ea684b4d3f4823ec28d46d6e5a6077f40cb9a1174aafc1df3 EBUILD postgresql-13.3.ebuild 13960 BLAKE2B 87f1ce94709b84bb3aad8453202bff71b8b12a840432b4fdbf5a5428d2f26cde45ccc848322e28151386c40d22847a20b7209947974ead5d5b214aae533285b3 SHA512 793c3715bfb970b295da084075fa5dbf9b417766ee4f00ce872c3840468755101b942fd8a70046d4d54df464d382c1ddb47974afdce53171d5fbad5d423f6ccb EBUILD postgresql-14_beta2.ebuild 13830 BLAKE2B 52800e0af8bb24919d5f21ea065d4d4171b6ec12167dbbcf7ce7b4ee7b0b482cfb863956172cf39ea51a8ae6fa9d5ce9b27fca5a1844bc8d016d37cdb9e71d06 SHA512 a7d1150f5e673f1c8703fc112ccff0bbd155d3b79858b38cfc116f51cb88f0de2a3a347015fe92d8a43abddcd3cf041d984ba53149cad9d261130a3c4af09631 -EBUILD postgresql-9.5.25.ebuild 14291 BLAKE2B ef54a42706bc54622d43ace0d706c3fa483222e5ec861eb049eb13923ee88d344348c8398368b423d48157499d6cc9155d2f998f95e1a20d2aa7e0d956c76973 SHA512 2f17849ccc88f02cb0cb8b9e170b1b5df0878b495947322129e1be8374b34edfeace8ba278387f330068f282c43fa145c685b2075f8ca1a9e544fd0ce1803b9c -EBUILD postgresql-9.6.22.ebuild 14514 BLAKE2B d541ed3a385106c4ece340c3e6f59ec20aebab37c6dd2714955100ad381561cc29b51e32238a0eaeafc333b951965e4226913914b28d1390a5309a53db407c74 SHA512 bb62fd48fdb4d960694585f668f06b0c55ce97123ebeeb04b68c8a33befe092c7a7abfc1e12e6f0c519786f1dda4ae78c7cfb1b2e640ce839b4b1cbab2d57ba0 +EBUILD postgresql-9.5.25-r1.ebuild 14310 BLAKE2B f4a850ba573b2e6196a5eac4f5cbd2f08ce632d0f5fc4c3bcd666cf5d290baf22c764d39c65c51ba0dbf19ab3e4b604295d78841ddd140304037d248adae05e0 SHA512 38bb5974d82318af4fc0da054c44b450384e707c71ce42cf9270ca06865f186e3d843bbb48191631da8c85bdb745cdd7a2142a4481e4d367d8afc3722a124844 +EBUILD postgresql-9.6.22-r1.ebuild 14514 BLAKE2B d541ed3a385106c4ece340c3e6f59ec20aebab37c6dd2714955100ad381561cc29b51e32238a0eaeafc333b951965e4226913914b28d1390a5309a53db407c74 SHA512 bb62fd48fdb4d960694585f668f06b0c55ce97123ebeeb04b68c8a33befe092c7a7abfc1e12e6f0c519786f1dda4ae78c7cfb1b2e640ce839b4b1cbab2d57ba0 EBUILD postgresql-9999.ebuild 14177 BLAKE2B 78b9c2382fe99bcbd76183c729d47977bd042ee11b4a04df6708c99d30b37eec3aa3d8d9324df1fa29cd1d82b90e8522e3d55e2396f09f0a63b69c9c1bd60131 SHA512 821d3b47016f4adcff0df8a33dd2dd97f710b503925bb256f16fa09d206c1a9a1882c5c4f3998db89b897fb516924528aafc94d20eccf8622221a6544d23c63d MISC metadata.xml 715 BLAKE2B 71b868113676bdbb1996ecc8e3727b0cc16a559c5906e6459a41c330bcb5a5f4b3f4b5c4473a81905713c2f0735f185cd14612c69108b6bb602a7d8a92d6f3ce SHA512 4148c9c11ffaea5d30cd18befb06af914147d41eec4a8f905127f0abc5317ca370a745e0fd51b03c4583efde927fe9c1b3333853e80c2aa3e7677de65cd5d1ba diff --git a/dev-db/postgresql/postgresql-10.17-r1.ebuild b/dev-db/postgresql/postgresql-10.17-r1.ebuild new file mode 100644 index 000000000000..7723abe23530 --- /dev/null +++ b/dev-db/postgresql/postgresql-10.17-r1.ebuild @@ -0,0 +1,458 @@ +# Copyright 1999-2021 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 kernel_linux 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/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,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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 \ + "${FILESDIR}"/postgresql-10.0-icu68-2.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 + for i in ${BSD_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=bsd" + 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 +} diff --git a/dev-db/postgresql/postgresql-10.17.ebuild b/dev-db/postgresql/postgresql-10.17.ebuild deleted file mode 100644 index 7723abe23530..000000000000 --- a/dev-db/postgresql/postgresql-10.17.ebuild +++ /dev/null @@ -1,458 +0,0 @@ -# Copyright 1999-2021 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 kernel_linux 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/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,uclibc,musl} ) -BSD_LIBC=( elibc_{Free,Net,Open}BSD ) - -nest_usedep() { - local front back - while [[ ${#} -gt 1 ]]; do - front+="${1}? ( " - back+=" )" - shift - done - echo "${front}${1}${back}" -} - -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" -CDEPEND+=" -uuid? ( - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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 \ - "${FILESDIR}"/postgresql-10.0-icu68-2.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 - for i in ${BSD_LIBC[@]}; do - use ${i} && uuid_config="--with-uuid=bsd" - 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 -} diff --git a/dev-db/postgresql/postgresql-9.5.25-r1.ebuild b/dev-db/postgresql/postgresql-9.5.25-r1.ebuild new file mode 100644 index 000000000000..f5f6c1cb0823 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.5.25-r1.ebuild @@ -0,0 +1,474 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9} ) + +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-2) + +SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2" + +LICENSE="POSTGRESQL GPL-2" +DESCRIPTION="PostgreSQL RDBMS" +HOMEPAGE="https://www.postgresql.org/" + +IUSE="debug doc kerberos kernel_linux ldap nls pam perl + pg-legacytimestamp 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 +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= ) +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,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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}-9.5.5-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 + + 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 + for i in ${BSD_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=bsd" + 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 !pg-legacytimestamp integer-datetimes) \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(use_with kerberos gssapi) \ + $(use_with ldap) \ + $(use_with pam) \ + $(use_with perl) \ + $(use_with python) \ + $(use_with readline) \ + $(use_with ssl openssl) \ + $(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 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; 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 + + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + # Temporarily tack on tmp to workaround a file collision + # issue. This is only necessary for 9.7 and earlier. 10 never + # had this issue. + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}tmp" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + 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.2" | \ + systemd_newunit - ${PN}-${SLOT}.service + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + 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_preinst() { + # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., + # /usr/bin/psql96). They may have been created by the + # postgresql.eselect module, but they're handled within this ebuild + # now. It's alright if we momentarily delete /usr/bin/psql as it + # will be recreated by the eselect module in pkg_ppostinst(). This + # is only necessary for 9.7 and earlier. 10 and later were never + # handled in this manner. + local canonicalise + if type -p realpath > /dev/null; then + canonicalise=realpath + elif type -p readlink > /dev/null; then + canonicalise='readlink -f' + else + # can't die, subshell + die "No readlink nor realpath found, cannot canonicalise" + fi + + local l + # First remove any symlinks in /usr/bin that may have been created + # by the old eselect + for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do + if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then + rm "${l}" || ewarn "Couldn't remove ${l}" + fi + done + + # Then move the symlinks created by the ebuild to their proper place. + for l in "${ED}"/usr/bin/*tmp ; do + mv "${l}" "${l%tmp}" \ + || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" + done +} + +pkg_postinst() { + use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf + postgresql-config update + + if use alpha && use server ; then + ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." + ewarn "As a result, performance will be extremely degraded." + fi + + 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}" + 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 + einfo "The PostgreSQL server, by default, will log events to:" + einfo " ${DATA_DIR%/}/postmaster.log" + einfo + 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}" + 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 +} diff --git a/dev-db/postgresql/postgresql-9.5.25.ebuild b/dev-db/postgresql/postgresql-9.5.25.ebuild deleted file mode 100644 index adbf87e5ed06..000000000000 --- a/dev-db/postgresql/postgresql-9.5.25.ebuild +++ /dev/null @@ -1,473 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) - -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-2) - -SRC_URI="https://ftp.postgresql.org/pub/source/v${PV}/postgresql-${PV}.tar.bz2" - -LICENSE="POSTGRESQL GPL-2" -DESCRIPTION="PostgreSQL RDBMS" -HOMEPAGE="https://www.postgresql.org/" - -IUSE="debug doc kerberos kernel_linux ldap nls pam perl - pg-legacytimestamp 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 -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= ) -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,uclibc,musl} ) -BSD_LIBC=( elibc_{Free,Net,Open}BSD ) - -nest_usedep() { - local front back - while [[ ${#} -gt 1 ]]; do - front+="${1}? ( " - back+=" )" - shift - done - echo "${front}${1}${back}" -} - -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" -CDEPEND+=" -uuid? ( - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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}-9.5.5-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 - - 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 - for i in ${BSD_LIBC[@]}; do - use ${i} && uuid_config="--with-uuid=bsd" - 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 !pg-legacytimestamp integer-datetimes) \ - $(use_enable debug) \ - $(use_enable threads thread-safety) \ - $(use_with kerberos gssapi) \ - $(use_with ldap) \ - $(use_with pam) \ - $(use_with perl) \ - $(use_with python) \ - $(use_with readline) \ - $(use_with ssl openssl) \ - $(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 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; 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 - - local f bn - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ - -mindepth 1 -maxdepth 1) - do - bn=$(basename "${f}") - # Temporarily tack on tmp to workaround a file collision - # issue. This is only necessary for 9.7 and earlier. 10 never - # had this issue. - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ - "/usr/bin/${bn}${SLOT/.}tmp" - done - - if use doc ; then - docinto html - dodoc doc/src/sgml/html/* - - docinto sgml - dodoc doc/src/sgml/*.{sgml,dsl} - 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.2" | \ - systemd_newunit - ${PN}-${SLOT}.service - newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf - fi - - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir - - 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_preinst() { - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., - # /usr/bin/psql96). They may have been created by the - # postgresql.eselect module, but they're handled within this ebuild - # now. It's alright if we momentarily delete /usr/bin/psql as it - # will be recreated by the eselect module in pkg_ppostinst(). This - # is only necessary for 9.7 and earlier. 10 and later were never - # handled in this manner. - local canonicalise - if type -p realpath > /dev/null; then - canonicalise=realpath - elif type -p readlink > /dev/null; then - canonicalise='readlink -f' - else - # can't die, subshell - die "No readlink nor realpath found, cannot canonicalise" - fi - - local l - # First remove any symlinks in /usr/bin that may have been created - # by the old eselect - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then - rm "${l}" || ewarn "Couldn't remove ${l}" - fi - done - - # Then move the symlinks created by the ebuild to their proper place. - for l in "${ED}"/usr/bin/*tmp ; do - mv "${l}" "${l%tmp}" \ - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" - done -} - -pkg_postinst() { - use server && use systemd && tmpfiles_process ${PN}-${SLOT}.conf - postgresql-config update - - if use alpha && use server ; then - ewarn "PostgreSQL 9.5+ no longer has native spinlock support on Alpha platforms." - ewarn "As a result, performance will be extremely degraded." - fi - - 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}" - 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 - einfo "The PostgreSQL server, by default, will log events to:" - einfo " ${DATA_DIR%/}/postmaster.log" - einfo - 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}" - 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 -} diff --git a/dev-db/postgresql/postgresql-9.6.22-r1.ebuild b/dev-db/postgresql/postgresql-9.6.22-r1.ebuild new file mode 100644 index 000000000000..6ef13fcda3a7 --- /dev/null +++ b/dev-db/postgresql/postgresql-9.6.22-r1.ebuild @@ -0,0 +1,478 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9} ) + +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 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +SLOT=$(ver_cut 1-2) + +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 kerberos kernel_linux ldap nls pam perl + pg-legacytimestamp 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 +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= ) +ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) +server? ( systemd? ( sys-apps/systemd ) ) +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,uclibc,musl} ) +BSD_LIBC=( elibc_{Free,Net,Open}BSD ) + +nest_usedep() { + local front back + while [[ ${#} -gt 1 ]]; do + front+="${1}? ( " + back+=" )" + shift + done + echo "${front}${1}${back}" +} + +IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" +CDEPEND+=" +uuid? ( + ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} + $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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}-${SLOT}.3-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 + + 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 + for i in ${BSD_LIBC[@]}; do + use ${i} && uuid_config="--with-uuid=bsd" + 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 !pg-legacytimestamp integer-datetimes) \ + $(use_enable debug) \ + $(use_enable threads thread-safety) \ + $(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 + for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; 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 + + local f bn + for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ + -mindepth 1 -maxdepth 1) + do + bn=$(basename "${f}") + # Temporarily tack on tmp to workaround a file collision + # issue. This is only necessary for 9.7 and earlier. 10 never + # had this issue. + dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ + "/usr/bin/${bn}${SLOT/.}tmp" + done + + if use doc ; then + docinto html + dodoc doc/src/sgml/html/* + + docinto sgml + dodoc doc/src/sgml/*.{sgml,dsl} + 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 + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf + fi + + newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir + + 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_preinst() { + # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., + # /usr/bin/psql96). They may have been created by the + # postgresql.eselect module, but they're handled within this ebuild + # now. It's alright if we momentarily delete /usr/bin/psql as it + # will be recreated by the eselect module in pkg_ppostinst(). This + # is only necessary for 9.7 and earlier. 10 and later were never + # handled in this manner. + local canonicalise + if type -p realpath > /dev/null; then + canonicalise=realpath + elif type -p readlink > /dev/null; then + canonicalise='readlink -f' + else + # can't die, subshell + die "No readlink nor realpath found, cannot canonicalise" + fi + + local l + # First remove any symlinks in /usr/bin that may have been created + # by the old eselect + for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do + if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then + rm "${l}" || ewarn "Couldn't remove ${l}" + fi + done + + # Then move the symlinks created by the ebuild to their proper place. + for l in "${ED}"/usr/bin/*tmp ; do + mv "${l}" "${l%tmp}" \ + || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" + done +} + +pkg_postinst() { + 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}" + 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 +} diff --git a/dev-db/postgresql/postgresql-9.6.22.ebuild b/dev-db/postgresql/postgresql-9.6.22.ebuild deleted file mode 100644 index 6ef13fcda3a7..000000000000 --- a/dev-db/postgresql/postgresql-9.6.22.ebuild +++ /dev/null @@ -1,478 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7,8,9} ) - -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 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" - -SLOT=$(ver_cut 1-2) - -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 kerberos kernel_linux ldap nls pam perl - pg-legacytimestamp 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 -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= ) -ssl? ( >=dev-libs/openssl-0.9.6-r1:0= ) -server? ( systemd? ( sys-apps/systemd ) ) -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,uclibc,musl} ) -BSD_LIBC=( elibc_{Free,Net,Open}BSD ) - -nest_usedep() { - local front back - while [[ ${#} -gt 1 ]]; do - front+="${1}? ( " - back+=" )" - shift - done - echo "${front}${1}${back}" -} - -IUSE+=" ${UTIL_LINUX_LIBC[@]} ${BSD_LIBC[@]}" -CDEPEND+=" -uuid? ( - ${UTIL_LINUX_LIBC[@]/%/? ( sys-apps/util-linux )} - $(nest_usedep ${UTIL_LINUX_LIBC[@]/#/!} ${BSD_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}-${SLOT}.3-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 - - 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 - for i in ${BSD_LIBC[@]}; do - use ${i} && uuid_config="--with-uuid=bsd" - 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 !pg-legacytimestamp integer-datetimes) \ - $(use_enable debug) \ - $(use_enable threads thread-safety) \ - $(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 - for m in {initdb,pg_{controldata,ctl,resetxlog},post{gres,master}}; 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 - - local f bn - for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \ - -mindepth 1 -maxdepth 1) - do - bn=$(basename "${f}") - # Temporarily tack on tmp to workaround a file collision - # issue. This is only necessary for 9.7 and earlier. 10 never - # had this issue. - dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \ - "/usr/bin/${bn}${SLOT/.}tmp" - done - - if use doc ; then - docinto html - dodoc doc/src/sgml/html/* - - docinto sgml - dodoc doc/src/sgml/*.{sgml,dsl} - 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 - newtmpfiles "${FILESDIR}"/${PN}.tmpfiles ${PN}-${SLOT}.conf - fi - - newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir - - 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_preinst() { - # Find all of the slot-specific symlinks, if any, in /usr/bin (e.g., - # /usr/bin/psql96). They may have been created by the - # postgresql.eselect module, but they're handled within this ebuild - # now. It's alright if we momentarily delete /usr/bin/psql as it - # will be recreated by the eselect module in pkg_ppostinst(). This - # is only necessary for 9.7 and earlier. 10 and later were never - # handled in this manner. - local canonicalise - if type -p realpath > /dev/null; then - canonicalise=realpath - elif type -p readlink > /dev/null; then - canonicalise='readlink -f' - else - # can't die, subshell - die "No readlink nor realpath found, cannot canonicalise" - fi - - local l - # First remove any symlinks in /usr/bin that may have been created - # by the old eselect - for l in $(find "${ROOT}/usr/bin" -mindepth 1 -maxdepth 1 -type l) ; do - if [[ $(${canonicalise} "${l}") == *postgresql-${SLOT}* ]] ; then - rm "${l}" || ewarn "Couldn't remove ${l}" - fi - done - - # Then move the symlinks created by the ebuild to their proper place. - for l in "${ED}"/usr/bin/*tmp ; do - mv "${l}" "${l%tmp}" \ - || ewarn "Couldn't rename $(basename ${l}) to $(basename ${l%tmp})" - done -} - -pkg_postinst() { - 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}" - 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 -} diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest index c81b505630e7..6edc683adf21 100644 --- a/dev-db/redis/Manifest +++ b/dev-db/redis/Manifest @@ -28,9 +28,9 @@ DIST redis-6.0.15.tar.gz 2282471 BLAKE2B b7f37a76d2a16e0f84f51a737e2c23ebc27750e DIST redis-6.2.4.tar.gz 2457940 BLAKE2B 3e89e404a624db6f739fdab72b8b7f7f92b6e96b01e33c63b6f5fa2f80fc72d8b8eaca4ecb7c57cdaf127956ba1a580ec851012b57426ebe7bb4cba890e1dcae SHA512 22db5b64de20a4823fd219b559c05f329e37fc86ce32099c64655dc50e60228706c99bffeae8d7080d8689910879318ec6621388bde23bf1486aefb881f33cb0 DIST redis-6.2.5.tar.gz 2465302 BLAKE2B 51cc672ab432bb87560151521289d04e8fefb8e4df820f58a9b742131a0f1960c0019dec42a601bad827ec2a172375b88b6cf32a19aef42964e18f5a7a911c40 SHA512 8c54451032cbb627ec2827251556cba2010e56544baca7ea117b5afd2c2add484acbedd3baf21bdb8fd10672602cf52294a4e26b135c1406d7a723c048275e3a EBUILD redis-5.0.12.ebuild 4616 BLAKE2B 230589c77919661022e95fa36143379c8e61d3cef8e4704d69762064eb04ddcf82a581bc9c32ff43c5443fc94ca65e24ccc7041340658c7cbb7f3b844b981d3e SHA512 ba4274c7cff7f2bf2340faec2ff53d8b8b1294797f4f361d23c059353d1ef60367a1353ae55970fd7a98d0532462914696988edfe4f610e47a5fab7b1ecb0fd8 -EBUILD redis-5.0.13.ebuild 4621 BLAKE2B a6bd0109941f6df30e7fd908daca8e0901ad71841b1603a6463ed3b3c77309a4a90275db321b0d8555604602e0ac72778e3b8c9a1222cef2783f777943adc76d SHA512 1e7d8b69968ae3fc5021c4662204669f903e382d035ec67225430dcec2c5514076f43506c65e47e5e5e3b70d4ce926709b368e80fae8ce1828b95fd0e345a29b +EBUILD redis-5.0.13.ebuild 4616 BLAKE2B 230589c77919661022e95fa36143379c8e61d3cef8e4704d69762064eb04ddcf82a581bc9c32ff43c5443fc94ca65e24ccc7041340658c7cbb7f3b844b981d3e SHA512 ba4274c7cff7f2bf2340faec2ff53d8b8b1294797f4f361d23c059353d1ef60367a1353ae55970fd7a98d0532462914696988edfe4f610e47a5fab7b1ecb0fd8 EBUILD redis-6.0.14.ebuild 5092 BLAKE2B 82f39c67cfef273c174c0c7cd144e23a93833c2b00f6143e22ea7e3f3e7fe4f044a4f25f00cc72c7a6f72d934e5c4aaa66742ac7172737afa94cf15bc7188690 SHA512 dcb6983cf72b12b28d6dbef8041afd56789f7bd8d3373edd76bc0f09bb277ff78450ff8081e3a007eef0913944950bbe618856cf18c5e84915dc7245a0d80ceb -EBUILD redis-6.0.15.ebuild 5097 BLAKE2B d7ebdd03f4b9e92424f524e1f3341a9f6791f525e6444d4f19d98e2a91cdb91186aad75a1b0ddf7979829681868dbddfc07192a1b742bbdb9d50afed58bc6da2 SHA512 28b8cf8bc92582bbd8a59b3ad17b1917bb357bce4de00e4a9dbafbe42cf15531926739eee1431890fd7bf4e407dcf2514d676791cbf0ccc37b140c66cd2ef3c9 -EBUILD redis-6.2.4.ebuild 5092 BLAKE2B d169b930309b4058ab34550942d2ab564a8a3328f681b6e63fa6a9981d6b6003be3bf6640566039a22aa978839d8551ef828be3059dbaea0f4b742c2e48a778a SHA512 1b2cda1a385156a4d91aeed981a7f135f8c18f2baac45c150ef0906048bb66e4031805b24e8790f8b24681ee093a56d9d5bce7817ff52af2b9c581ef029b8b4b -EBUILD redis-6.2.5.ebuild 5096 BLAKE2B d288768078f5375ef5d794d52fa844bd68117eb8db5fef96c39bf162f8932d187079864bc292dd8238c450042b1e3b44ee28ef3bd2d7382c73b6f8d94cf58148 SHA512 6e723fd118b2ea49e04874207cb599a6e021de2ae3a79fe87d969d3ecd5e224e3d6deda9c765a90e46b8f93e7c6b58e08218fc7a917386a2ba4f05df8088f65c +EBUILD redis-6.0.15.ebuild 5092 BLAKE2B 82f39c67cfef273c174c0c7cd144e23a93833c2b00f6143e22ea7e3f3e7fe4f044a4f25f00cc72c7a6f72d934e5c4aaa66742ac7172737afa94cf15bc7188690 SHA512 dcb6983cf72b12b28d6dbef8041afd56789f7bd8d3373edd76bc0f09bb277ff78450ff8081e3a007eef0913944950bbe618856cf18c5e84915dc7245a0d80ceb +EBUILD redis-6.2.4.ebuild 5091 BLAKE2B 4dc608e1a85408fcf537f082a3bfd3f689f0e29a33272cd87d60a925ee6693f599de989ea94871b707f4d0540b950990777a5209e53cea4eb36f9b8d6b0b841d SHA512 c5cbaf77c6af52e8a557858cd323f2224f5e547ffc9af38032dbfd1f309fb0b948101cb87966ad155ac8087e54aa8841462fcdfecbfdc60562d3f250bfff4baa +EBUILD redis-6.2.5.ebuild 5098 BLAKE2B afae58d112a2f1df3417cdaf302baa035a584ebaee8cfdc628db502cac405045f9d3aff93127c8e25132cad3df7e50312a6528a52aaacf138728ff74f703a0d3 SHA512 7d127b8f751069a72db39c16d565063e20e0a152b49ced93a2954f0ffdf80e0e40a199915a8c18f557eada4d5b3c0d611ed48c3e4185fe50262d769e9d5e805f MISC metadata.xml 364 BLAKE2B a997b9ef18f8efdcd191d4344898a373d3987cc8630d7d699af0666dac13261a06717e72320034fab170209ab2cc90db122e1a3756fa9ff9149fe7b7796328c3 SHA512 2d6a303748fd5cf5a3a12b382e0944046a7d200f19041a343603068a764f806fd748945c9d5ec2d0f4001f151bc66c1127a461abeefd7eb85a92d2238b74d521 diff --git a/dev-db/redis/redis-5.0.13.ebuild b/dev-db/redis/redis-5.0.13.ebuild index c003fb7c0982..fb5159d282a5 100644 --- a/dev-db/redis/redis-5.0.13.ebuild +++ b/dev-db/redis/redis-5.0.13.ebuild @@ -10,7 +10,7 @@ HOMEPAGE="https://redis.io" SRC_URI="http://download.redis.io/releases/${P}.tar.gz" LICENSE="BSD" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris" IUSE="+jemalloc tcmalloc luajit test" RESTRICT="!test? ( test )" SLOT="0" diff --git a/dev-db/redis/redis-6.0.15.ebuild b/dev-db/redis/redis-6.0.15.ebuild index 7a68f4a64853..d871156cf342 100644 --- a/dev-db/redis/redis-6.0.15.ebuild +++ b/dev-db/redis/redis-6.0.15.ebuild @@ -18,7 +18,7 @@ HOMEPAGE="https://redis.io" SRC_URI="https://download.redis.io/releases/${P}.tar.gz" LICENSE="BSD" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" IUSE="+jemalloc ssl systemd tcmalloc test" RESTRICT="!test? ( test )" SLOT="0" diff --git a/dev-db/redis/redis-6.2.4.ebuild b/dev-db/redis/redis-6.2.4.ebuild index 3402d1614c7d..2546d4424d2b 100644 --- a/dev-db/redis/redis-6.2.4.ebuild +++ b/dev-db/redis/redis-6.2.4.ebuild @@ -18,7 +18,7 @@ HOMEPAGE="https://redis.io" SRC_URI="https://download.redis.io/releases/${P}.tar.gz" LICENSE="BSD" -KEYWORDS="amd64 arm ~arm64 ~hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" IUSE="+jemalloc ssl systemd tcmalloc test" RESTRICT="!test? ( test )" SLOT="0" diff --git a/dev-db/redis/redis-6.2.5.ebuild b/dev-db/redis/redis-6.2.5.ebuild index 7b9596a684a8..a140e3a10280 100644 --- a/dev-db/redis/redis-6.2.5.ebuild +++ b/dev-db/redis/redis-6.2.5.ebuild @@ -18,7 +18,7 @@ HOMEPAGE="https://redis.io" SRC_URI="https://download.redis.io/releases/${P}.tar.gz" LICENSE="BSD" -KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" +KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" IUSE="+jemalloc ssl systemd tcmalloc test" RESTRICT="!test? ( test )" SLOT="0" diff --git a/dev-db/timescaledb/Manifest b/dev-db/timescaledb/Manifest index b2c41e66f1d7..5547d43f74ef 100644 --- a/dev-db/timescaledb/Manifest +++ b/dev-db/timescaledb/Manifest @@ -3,9 +3,11 @@ DIST timescaledb-2.0.2.tar.gz 2237429 BLAKE2B 58c5e68daf5a3c1fade48b2ce8f625496e DIST timescaledb-2.1.0.tar.gz 2527250 BLAKE2B 6f257c4b1afc0869c8e309f9b3080dbcdda4b50debc1a5b3848b9d6e59744ff52902b475aca0bc8820aa2edebe9847d62e500a8cd19f7ab8050d9586d95d3a66 SHA512 53fddb9fe4c4ab51ebc020e90eea5b032b41259d3bd45e8a03a86451acd7f8864b5a6ecba1b82b7c78e230f62cfddf1da75ff27e6629ad5fe8178839ac411ce4 DIST timescaledb-2.1.1.tar.gz 2534361 BLAKE2B d0aa5b231cbc9a75bb65eae395ffc0063a94bd3d9c47fe2b1f80bdf59c7624c83e3d4343f3d4ea402654627b8396936614f105fc7d01612f3ea03124471b44a3 SHA512 53bd8f9006741af834cc2598efe95b94e6ebf00df770ac3a4e0a087af83c8ba5ac2b1f421fd108e6609fde6bea725f05e2d590c3f341030a0f31edb6a3cf6cd5 DIST timescaledb-2.2.1.tar.gz 2637225 BLAKE2B 4ab37bb5c45a3f7550c2694c8757fff3e8dafe122aa9aea1e31d33931367b6b6bf8aa190444cd9472c3ba0aed087fa68d007ce52de24c78add3a53038a1d24ef SHA512 5dae0ed0b71309598bfc9605e838f2d8b4179ccf7098396315153c4044c7bdaaa411fd11ee70ca7807afde4b609faab281dcb1aa2f8d65330ca95e13fbe24582 +DIST timescaledb-2.3.1.tar.gz 2699256 BLAKE2B 5949245d4a2bf52558b3f646d3723b0571745226fcc0de236c21ad7f32316eaeb0780aa94f8ccacd420cd0b0e47c8e048172b9f9355cf01797398b7f2fc85a6a SHA512 431f716ecd98504ce8e5b85e6fd10bf87ed39aac0244b7e968383537caae965ece09f016fed8ea010f5d42b392aed2d75b012deafd807d107f3dc75cbde287ec EBUILD timescaledb-2.0.1-r2.ebuild 1395 BLAKE2B 617efa50243741f6b6d561d1d3af2742edd1a0867dbb6255823dbe06f5e7c9cdf816d8dd233ab086b1c26dfe60249df80efc609aa3466714319ffdf6ad918cd4 SHA512 16577d3c60d150126693a73825cdda0bfd93d6cb2edf9a66473c524147744c3be0c717152668eef0d6158937f840eacc27ba5974b73f32794261a4b0292dca5b EBUILD timescaledb-2.0.2-r1.ebuild 1395 BLAKE2B 617efa50243741f6b6d561d1d3af2742edd1a0867dbb6255823dbe06f5e7c9cdf816d8dd233ab086b1c26dfe60249df80efc609aa3466714319ffdf6ad918cd4 SHA512 16577d3c60d150126693a73825cdda0bfd93d6cb2edf9a66473c524147744c3be0c717152668eef0d6158937f840eacc27ba5974b73f32794261a4b0292dca5b EBUILD timescaledb-2.1.0-r1.ebuild 1398 BLAKE2B a97e063bc73af8d2062acff17b7e6019d65d23241dc00cc6a4bc2d2322e2e16f1b2890f4779ea350aed86a5e3ab871b53cfb5cd04443377a635d4a1cf9d2ddf9 SHA512 599c54854e0f0e4c83740f4af9f316bf1c3ddab3b142030aee242cc13843fca061c6a947bec5cea84885e0388a23e6efefffab75c2ffa10c8b98a7cbaf323a8d EBUILD timescaledb-2.1.1-r1.ebuild 1398 BLAKE2B a97e063bc73af8d2062acff17b7e6019d65d23241dc00cc6a4bc2d2322e2e16f1b2890f4779ea350aed86a5e3ab871b53cfb5cd04443377a635d4a1cf9d2ddf9 SHA512 599c54854e0f0e4c83740f4af9f316bf1c3ddab3b142030aee242cc13843fca061c6a947bec5cea84885e0388a23e6efefffab75c2ffa10c8b98a7cbaf323a8d EBUILD timescaledb-2.2.1-r1.ebuild 1432 BLAKE2B cac2105c56b96160662c395e5690d7474a776200ed33fc7c05f0e305d8db22cb0dd1e2bdc1709410d825c960aa9cb3e278f633e78fc75a57983396ac4df3523f SHA512 154b0556d5abb8a6a4cbe82383689b98e81b8c93626b0a197cee7d0b1876407829366145dd2ec18a8f373d26fcdc5f20470ed492182cb5cfcafa2cad269f9e9d +EBUILD timescaledb-2.3.1.ebuild 1432 BLAKE2B cac2105c56b96160662c395e5690d7474a776200ed33fc7c05f0e305d8db22cb0dd1e2bdc1709410d825c960aa9cb3e278f633e78fc75a57983396ac4df3523f SHA512 154b0556d5abb8a6a4cbe82383689b98e81b8c93626b0a197cee7d0b1876407829366145dd2ec18a8f373d26fcdc5f20470ed492182cb5cfcafa2cad269f9e9d MISC metadata.xml 423 BLAKE2B a3a3492702b7cb6926726e2bc423baa3f9cedd29dd4c22d40d3e3b04e2513bd0a98cd003fcec34f6df4e0e01e653ecc550f38c8869f170bd8fbc08897ccd025c SHA512 cf01e5ba26d38251ef1fabdbf01f3190a077ba000b36682cc49c93b1f5149d1812e3e3a1dc659fa6e9acc39bcfc0dba2effd6588ef50e8d7834b4c68d7016801 diff --git a/dev-db/timescaledb/timescaledb-2.3.1.ebuild b/dev-db/timescaledb/timescaledb-2.3.1.ebuild new file mode 100644 index 000000000000..eba5dbffb770 --- /dev/null +++ b/dev-db/timescaledb/timescaledb-2.3.1.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +POSTGRES_COMPAT=( 11 12 13 ) + +inherit postgres-multi cmake + +DESCRIPTION="Open-source time-series SQL database" +HOMEPAGE="https://www.timescale.com/" +SRC_URI="https://github.com/timescale/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +IUSE="proprietary-extensions" +LICENSE="POSTGRESQL Apache-2.0 proprietary-extensions? ( timescale )" + +KEYWORDS="~amd64" + +SLOT=0 + +RESTRICT="test" + +DEPEND="${POSTGRES_DEP} + dev-libs/openssl:=" +RDEPEND="${DEPEND}" + +CMAKE_IN_SOURCE_BUILD=yes +CMAKE_BUILD_TYPE="RelWithDebInfo" +BUILD_DIR=${WORKDIR}/${P} + +src_prepare() { + postgres-multi_src_prepare + postgres-multi_foreach cmake_src_prepare +} + +timescale_configure() { + local CMAKE_USE_DIR=$BUILD_DIR + local mycmakeargs=( "-DPG_CONFIG=/usr/bin/pg_config${MULTIBUILD_VARIANT}" "-DREGRESS_CHECKS=OFF" ) + + # licensing is tied to features, this useflag disables the non-apache2 licensed bits + if ! use proprietary-extensions ; then + mycmakeargs+=("-DAPACHE_ONLY=ON") + fi + cmake_src_configure +} + +src_configure() { + postgres-multi_foreach timescale_configure +} + +timescale_src_compile() { + local CMAKE_USE_DIR=$BUILD_DIR + cmake_src_compile +} + +src_compile() { + postgres-multi_foreach timescale_src_compile +} + +timescale_src_install() { + local CMAKE_USE_DIR=$BUILD_DIR + cmake_src_install +} + +src_install() { + postgres-multi_foreach timescale_src_install +} -- cgit v1.2.3