parent
aa48fc3e55
commit
a747f9d473
@ -1,23 +1,23 @@
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA512
|
||||
|
||||
MANIFEST Manifest.files.gz 29292 BLAKE2B 7048b12e05ddeb0ea8d1a3aa201679997bdca3a0a1615eecd676d6f902b3a0ae53132e4d140c5dcebb0db745e8c0df3996dfcb87884f3d437504297c54129df6 SHA512 ba046cf33a89e2b90d780a8e7d1b674165f92b9a97fe3d84dab986b4acb62c74f0d2174a5bc05ffee7334ba65e2f72e4b4240fb44c0e1454d62e77ff32ee2ef8
|
||||
TIMESTAMP 2019-06-20T08:09:00Z
|
||||
MANIFEST Manifest.files.gz 29322 BLAKE2B 04e69d3787568e0d0fb0c603a7f07af0eeab2672ef99dd1179fb670e8f9d2f9a07f1dfc645bf4533126fbe63b9b2f0db1b26706c722cd8cffa2df498ae0396d2 SHA512 168130d0f194acda4758b5926577eef2e67faf5f8028d46025914c6b35f0d5438275f1f774e36b2997918015ababa3488b78f6ad86d1a0fb6732b4a888cdb51f
|
||||
TIMESTAMP 2019-06-21T09:38:54Z
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQKTBAEBCgB9FiEE4dartjv8+0ugL98c7FkO6skYklAFAl0LPxxfFIAAAAAALgAo
|
||||
iQKTBAEBCgB9FiEE4dartjv8+0ugL98c7FkO6skYklAFAl0Mpa5fFIAAAAAALgAo
|
||||
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEUx
|
||||
RDZBQkI2M0JGQ0ZCNEJBMDJGREYxQ0VDNTkwRUVBQzkxODkyNTAACgkQ7FkO6skY
|
||||
klBWwA/+KQShP5RAVK/te9wUDBrPdKGloqr+McQQk3hRl41bwA+H9k/gvsM+0b9+
|
||||
GgE4W+azZSoEjEERzs19LvzPf5Pjj4TgJD7ib3rtW4XbHgmJSeQ5wMHdWFw7RBp5
|
||||
RjupPqGdiZT7Dg2xPIcfJLPSJPe0eKe8TiuORoFtvM8ttM8WabI+odRCB8Cn+58K
|
||||
Ebj46HHKurNe7UPK2D04I+/0inavEl7GB85a7+7+Uuz5/L3O6bu6xE9OA/zomWXQ
|
||||
77dfGE+cgZyWI3T28gCreHPcWZ9wGwHHwD0WrgoJUI8ZUJ11Bj2QQQNqDktHBTGi
|
||||
J7mUOC6wS3gv1jfvIlQlx7glckj3oy4VDzq5tpO+6AymSn4vkcNKrW7dFMSzWyyi
|
||||
VV8cX3FC/45weNYiOjV/D49F2cdr3xq/xZJXWu1lTDUjCJFyAR23jfPHBZ090CGJ
|
||||
wZHSZBKZMySTjyy5J/Eb9/g4skLjXdbdH6jopNsw+HpymRz8eQKdkYjFd87E3tmz
|
||||
Ko6n0DoQ2rSgA1kjhA7SLFO1NQHlZa3BDsjWtCaQob3hAYZEtRm8qIsT/LHzkzwg
|
||||
HgUv4cXesOd0T+Cp2FmyTX6zdmQOSXBC5sbRLlU2x32RIcQqNs1s+WVU3sela5pD
|
||||
QNj+t8wO14NPPiQU+QvRG/ZjlRWkWPrN2mZM6qdlPJuiasEierE=
|
||||
=6pHd
|
||||
klC+/A/9GMkiPzQFuoHRverFJ4vxMwEWgS0MaUmfOK892CtRBxek4rSeFl41TUcc
|
||||
hNBey6S2oATi9GDkdbeGRiXV7d7ThXonKdl/kup8oOfM5XI8UlJtz2UkyCoLzfoT
|
||||
qIEEexClR2Cujaev09d4Waa4kVdLppm7NpKp9wvy/MRHl9NrxDljDgrZxTmPPXWF
|
||||
9fjMcyR3h21JjOEfN0tBjD8MRQ4hFOgv07sL9Gak3lE2iA4SSBG/IlPiAMc6Dsg/
|
||||
J/AZds1hrMpus0PgDnLSH8qBVlHkc2rlj43GPFnijlivlVEZ9KXwDCh/AVgqZXl3
|
||||
fRpdxJh+91SJWIzRZhrqOJ0QLNtYaTdf07aeao+ZAX2WkpPIJ69uU/hbcH3rFH1d
|
||||
DnwqcuaGoOMDZBWqby0nYS0BcsaBugvnVk8G6Yg8KSm4oqlMFWcrEfS5gTVtaqQO
|
||||
LdBZ++vWb/ILIQtknj9ZWwL5clY4EdQcs6XokyzMZYI9bJc7jZLQ2nLuX+taoBMp
|
||||
tNP9yHr9wMsdnanvkOYXoyKRLTKr7qiq00O8VPOa0qWD/c+IJCAOSS5spOqyqzfn
|
||||
ky27mrm8GowuV3Vjl4sKy8D/bqrmnS3ViKtaxXELPuyhpKH7p0nYt/HrOx3mNTcD
|
||||
L7j7pXEhXJGfzOspeO92LfAUVoDGbu1k3AuGsj6ex5aiHJyrlz0=
|
||||
=vXR0
|
||||
-----END PGP SIGNATURE-----
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
DIST hardlink-0.3.2.tar.bz2 15479 BLAKE2B dd6cfc312ed75dc6d9e37b898215ed90efe4734c5974297c9e29a51a69c9b2d4e91d9aa3bca1d42679307eecd95ee46e6f636c211d1ceafef1ea52428761d1ec SHA512 1d027f7b2f1974c950044fa8872dc58101800ca557a4d66406652fb43f64653f7dd39a70f4ac65f5f6bca9116de4ce44aeba2ef1fe446834641ba5c4c5604dff
|
||||
DIST hardlink_0.2.0.tar.gz 12478 BLAKE2B 42918fbacdd230796e59f6ae7968599a90b63cc35876872ef34919377d6489c6c99d06f201a122f5859a283cea2672dbcc207e04c6b5ca0c54ab4e2f4178a970 SHA512 963fe90aa09e2bd548722b5c7f047fbd54fddf37967333e86251d7e5d1c646108ce90d78e7efeb8af6b9169b9a0bc5bc8b744afe1e813390f3e0bd535ce22005
|
||||
EBUILD hardlink-0.2.0.ebuild 985 BLAKE2B 04207e034de33f2cd8b40e9f5a0165362646dea99a6222b202c360bb703fb4e67ddb51aed9b8b0bb15f2ae7f0973c07b820ab597ec573c91dfaa9cc791c978ec SHA512 1043e76c0e975e2cc53003bcbc82b55e24dc9576ca880542464551b550a904b9ec12055ecc7dedd4c68acf2e40e992e9bd975a60b248a3025fb9013feb161d54
|
||||
EBUILD hardlink-0.3.2.ebuild 1077 BLAKE2B 93c641e836b323c8426ab8ad259519e858433062b7b5dad1cbfc9489846318b38e8a9dfc2384f857c45038dcdddd3e0a8b6474f7f5da4fafb37564c5199400a6 SHA512 a1d0b6f96e367fc489a57694e1c8545fbb7c6a1b3bacc98d1db68c6cd3bc6c874bcafb3b7ec0d8fd571959044b02c927c3053c3e78ac454ad3e32545029b869d
|
||||
EBUILD hardlink-0.3.2.ebuild 1076 BLAKE2B 6a0d9ac49371bb12f77899d7994b596ce654ea904f80800ad407260d7a4c97ee01e62e6d1f71e5e1468ee82624207ec2330d48b739c46832eb2bb280ae0873ef SHA512 d96f33ede57e1d190f4993c2928808b13005746bce63272359a3d1af5ee5a4e7c327e5d7caefbfe4023738db19c8898056fbeab036bc57725a27295e7db64ba5
|
||||
MISC metadata.xml 375 BLAKE2B d148dcbae6b75d007f0fdb447b3e0a866df0468da507482ce60fbf4dc8f758053bc4fd9d5179f07915576dc10a96102c797747cb499199f55d22c7a989cc10a2 SHA512 1f14b085ab758738cc521af00de93bd47ca037f6b59fff96352c72e8f4acae7fa2bb5a8aa2df9eb865d992035a9c57c0b976cbe5f6033e4a77250e9101b22b7c
|
||||
|
Binary file not shown.
@ -0,0 +1,101 @@
|
||||
From 58263cbf3106f4c9c9a2252794093014a2f9c01f Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Strogin <stefan.strogin@gmail.com>
|
||||
Date: Thu, 25 Apr 2019 03:48:10 +0300
|
||||
Subject: [PATCH] Fix build for LibreSSL 2.9.x
|
||||
|
||||
asn1_mac.h is removed from LibreSSL 2.9.0, but static_ASN1_*() methods
|
||||
are not defined. Define them.
|
||||
|
||||
Upstream-Status: Pending
|
||||
[Needs to be amended if
|
||||
https://github.com/libressl-portable/openbsd/pull/109 is accepted]
|
||||
Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com>
|
||||
---
|
||||
.../preauth/pkinit/pkinit_crypto_openssl.c | 13 ++++++++----
|
||||
.../preauth/pkinit/pkinit_crypto_openssl.h | 20 ++++++++++++++++++-
|
||||
2 files changed, 28 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
|
||||
index 2064eb7bd..81d5d3cf2 100644
|
||||
--- a/plugins/preauth/pkinit/pkinit_crypto_openssl.c
|
||||
+++ b/plugins/preauth/pkinit/pkinit_crypto_openssl.c
|
||||
@@ -188,14 +188,16 @@ pkinit_pkcs11_code_to_text(int err);
|
||||
(*_x509_pp) = PKCS7_cert_from_signer_info(_p7,_si)
|
||||
#endif
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
|
||||
|
||||
-/* 1.1 standardizes constructor and destructor names, renaming
|
||||
- * EVP_MD_CTX_{create,destroy} and deprecating ASN1_STRING_data. */
|
||||
+/* 1.1 (and LibreSSL 2.7) standardizes constructor and destructor names,
|
||||
+ * renaming EVP_MD_CTX_{create,destroy} and deprecating ASN1_STRING_data. */
|
||||
|
||||
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
|
||||
#define EVP_MD_CTX_new EVP_MD_CTX_create
|
||||
#define EVP_MD_CTX_free EVP_MD_CTX_destroy
|
||||
#define ASN1_STRING_get0_data ASN1_STRING_data
|
||||
+#endif
|
||||
|
||||
/* 1.1 makes many handle types opaque and adds accessors. Add compatibility
|
||||
* versions of the new accessors we use for pre-1.1. */
|
||||
@@ -203,6 +205,7 @@ pkinit_pkcs11_code_to_text(int err);
|
||||
#define OBJ_get0_data(o) ((o)->data)
|
||||
#define OBJ_length(o) ((o)->length)
|
||||
|
||||
+#if !defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER < 0x2070000fL
|
||||
#define DH_set0_pqg compat_dh_set0_pqg
|
||||
static int compat_dh_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
|
||||
{
|
||||
@@ -235,6 +238,7 @@ static void compat_dh_get0_key(const DH *dh, const BIGNUM **pub,
|
||||
if (priv != NULL)
|
||||
*priv = dh->priv_key;
|
||||
}
|
||||
+#endif /* LIBRESSL_VERSION_NUMBER */
|
||||
|
||||
/* Return true if the cert c includes a key usage which doesn't include u.
|
||||
* Define using direct member access for pre-1.1. */
|
||||
@@ -3040,7 +3044,8 @@ cleanup:
|
||||
return retval;
|
||||
}
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) || \
|
||||
+ LIBRESSL_VERSION_NUMBER >= 0x2090000fL
|
||||
|
||||
/*
|
||||
* We need to decode DomainParameters from RFC 3279 section 2.3.3. We would
|
||||
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.h b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.h
|
||||
index 7411348fa..ac91408c4 100644
|
||||
--- a/plugins/preauth/pkinit/pkinit_crypto_openssl.h
|
||||
+++ b/plugins/preauth/pkinit/pkinit_crypto_openssl.h
|
||||
@@ -46,7 +46,25 @@
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/pem.h>
|
||||
|
||||
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
+#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)) || \
|
||||
+ LIBRESSL_VERSION_NUMBER >= 0x2090000fL
|
||||
+
|
||||
+#ifndef static_ASN1_SEQUENCE_END_name
|
||||
+#define static_ASN1_ITEM_start(itname) \
|
||||
+ static const ASN1_ITEM itname##_it = {
|
||||
+#define static_ASN1_SEQUENCE_END_name(stname, tname) \
|
||||
+ ;\
|
||||
+ static_ASN1_ITEM_start(tname) \
|
||||
+ ASN1_ITYPE_SEQUENCE,\
|
||||
+ V_ASN1_SEQUENCE,\
|
||||
+ tname##_seq_tt,\
|
||||
+ sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
|
||||
+ NULL,\
|
||||
+ sizeof(stname),\
|
||||
+ #stname \
|
||||
+ ASN1_ITEM_end(tname)
|
||||
+#endif /* !defined(static_ASN1_SEQUENCE_END_name) */
|
||||
+
|
||||
#include <openssl/asn1t.h>
|
||||
#else
|
||||
#include <openssl/asn1_mac.h>
|
||||
--
|
||||
2.21.0
|
||||
|
@ -0,0 +1,12 @@
|
||||
Bug #448778
|
||||
--- a/build-tools/krb5-config.in 2012-12-18 02:47:04.000000000 +0000
|
||||
+++ b/build-tools/krb5-config.in 2012-12-28 07:13:16.582693363 +0000
|
||||
@@ -217,7 +217,7 @@
|
||||
-e 's#\$(PROG_RPATH)#'$libdir'#' \
|
||||
-e 's#\$(PROG_LIBPATH)#'$libdirarg'#' \
|
||||
-e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \
|
||||
- -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \
|
||||
+ -e 's#\$(LDFLAGS)##' \
|
||||
-e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \
|
||||
-e 's#\$(CFLAGS)##'`
|
||||
|
@ -0,0 +1,165 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{5,6,7} )
|
||||
inherit autotools flag-o-matic multilib-minimal python-any-r1 systemd
|
||||
|
||||
MY_P="${P/mit-}"
|
||||
P_DIR=$(ver_cut 1-2)
|
||||
DESCRIPTION="MIT Kerberos V"
|
||||
HOMEPAGE="https://web.mit.edu/kerberos/www/"
|
||||
SRC_URI="https://web.mit.edu/kerberos/dist/krb5/${P_DIR}/${MY_P}.tar.gz"
|
||||
|
||||
LICENSE="openafs-krb5-a BSD MIT OPENLDAP BSD-2 HPND BSD-4 ISC RSA CC-BY-SA-3.0 || ( BSD-2 GPL-2+ )"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
||||
IUSE="cpu_flags_x86_aes doc +keyutils libressl lmdb nls openldap +pkinit selinux +threads test xinetd"
|
||||
|
||||
# Test suite requires network access
|
||||
RESTRICT="test"
|
||||
|
||||
CDEPEND="
|
||||
!!app-crypt/heimdal
|
||||
>=sys-libs/e2fsprogs-libs-1.42.9[${MULTILIB_USEDEP}]
|
||||
|| (
|
||||
>=dev-libs/libverto-0.2.5[libev,${MULTILIB_USEDEP}]
|
||||
>=dev-libs/libverto-0.2.5[libevent,${MULTILIB_USEDEP}]
|
||||
>=dev-libs/libverto-0.2.5[tevent,${MULTILIB_USEDEP}]
|
||||
)
|
||||
keyutils? ( >=sys-apps/keyutils-1.5.8[${MULTILIB_USEDEP}] )
|
||||
lmdb? ( dev-db/lmdb )
|
||||
nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
|
||||
openldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
|
||||
pkinit? (
|
||||
!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}] )
|
||||
libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] )
|
||||
)
|
||||
xinetd? ( sys-apps/xinetd )
|
||||
"
|
||||
DEPEND="${CDEPEND}
|
||||
${PYTHON_DEPS}
|
||||
virtual/yacc
|
||||
cpu_flags_x86_aes? (
|
||||
amd64? ( dev-lang/yasm )
|
||||
x86? ( dev-lang/yasm )
|
||||
)
|
||||
doc? ( virtual/latex-base )
|
||||
test? (
|
||||
${PYTHON_DEPS}
|
||||
dev-lang/tcl:0
|
||||
dev-util/dejagnu
|
||||
dev-util/cmocka
|
||||
)"
|
||||
RDEPEND="${CDEPEND}
|
||||
selinux? ( sec-policy/selinux-kerberos )"
|
||||
|
||||
S=${WORKDIR}/${MY_P}/src
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-1.12_warn_cflags.patch"
|
||||
"${FILESDIR}/${PN}-config_LDFLAGS-r1.patch"
|
||||
"${FILESDIR}/${PN}-1.16.3-libressl-r1.patch"
|
||||
)
|
||||
|
||||
MULTILIB_CHOST_TOOLS=(
|
||||
/usr/bin/krb5-config
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
# Make sure we always use the system copies.
|
||||
rm -rf util/{et,ss,verto}
|
||||
sed -i 's:^[[:space:]]*util/verto$::' configure.in || die
|
||||
|
||||
eautoreconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# QA
|
||||
append-flags -fno-strict-aliasing
|
||||
append-flags -fno-strict-overflow
|
||||
|
||||
multilib-minimal_src_configure
|
||||
}
|
||||
|
||||
multilib_src_configure() {
|
||||
use keyutils || export ac_cv_header_keyutils_h=no
|
||||
ECONF_SOURCE=${S} \
|
||||
WARN_CFLAGS="set" \
|
||||
econf \
|
||||
$(use_with openldap ldap) \
|
||||
"$(multilib_native_use_with test tcl "${EPREFIX}/usr")" \
|
||||
$(use_enable nls) \
|
||||
$(use_enable pkinit) \
|
||||
$(use_enable threads thread-support) \
|
||||
$(use_with lmdb) \
|
||||
--without-hesiod \
|
||||
--enable-shared \
|
||||
--with-system-et \
|
||||
--with-system-ss \
|
||||
--enable-dns-for-realm \
|
||||
--enable-kdc-lookaside-cache \
|
||||
--with-system-verto \
|
||||
--disable-rpath
|
||||
}
|
||||
|
||||
multilib_src_compile() {
|
||||
emake -j1
|
||||
}
|
||||
|
||||
multilib_src_test() {
|
||||
multilib_is_native_abi && emake -j1 check
|
||||
}
|
||||
|
||||
multilib_src_install() {
|
||||
emake \
|
||||
DESTDIR="${D}" \
|
||||
EXAMPLEDIR="${EPREFIX}/usr/share/doc/${PF}/examples" \
|
||||
install
|
||||
}
|
||||
|
||||
multilib_src_install_all() {
|
||||
# default database dir
|
||||
keepdir /var/lib/krb5kdc
|
||||
|
||||
rmdir "${ED}"/var/lib/{run/krb5kdc,run}
|
||||
|
||||
cd ..
|
||||
dodoc README
|
||||
|
||||
if use doc; then
|
||||
dodoc -r doc/html
|
||||
docinto pdf
|
||||
dodoc doc/pdf/*.pdf
|
||||
fi
|
||||
|
||||
newinitd "${FILESDIR}"/mit-krb5kadmind.initd-r2 mit-krb5kadmind
|
||||
newinitd "${FILESDIR}"/mit-krb5kdc.initd-r2 mit-krb5kdc
|
||||
newinitd "${FILESDIR}"/mit-krb5kpropd.initd-r2 mit-krb5kpropd
|
||||
newconfd "${FILESDIR}"/mit-krb5kadmind.confd mit-krb5kadmind
|
||||
newconfd "${FILESDIR}"/mit-krb5kdc.confd mit-krb5kdc
|
||||
newconfd "${FILESDIR}"/mit-krb5kpropd.confd mit-krb5kpropd
|
||||
|
||||
systemd_newunit "${FILESDIR}"/mit-krb5kadmind.service mit-krb5kadmind.service
|
||||
systemd_newunit "${FILESDIR}"/mit-krb5kdc.service mit-krb5kdc.service
|
||||
systemd_newunit "${FILESDIR}"/mit-krb5kpropd.service mit-krb5kpropd.service
|
||||
systemd_newunit "${FILESDIR}"/mit-krb5kpropd_at.service "mit-krb5kpropd@.service"
|
||||
systemd_newunit "${FILESDIR}"/mit-krb5kpropd.socket mit-krb5kpropd.socket
|
||||
|
||||
insinto /etc
|
||||
newins "${ED}/usr/share/doc/${PF}/examples/krb5.conf" krb5.conf.example
|
||||
insinto /var/lib/krb5kdc
|
||||
newins "${ED}/usr/share/doc/${PF}/examples/kdc.conf" kdc.conf.example
|
||||
|
||||
if use openldap ; then
|
||||
insinto /etc/openldap/schema
|
||||
doins "${S}/plugins/kdb/ldap/libkdb_ldap/kerberos.schema"
|
||||
fi
|
||||
|
||||
if use xinetd ; then
|
||||
insinto /etc/xinetd.d
|
||||
newins "${FILESDIR}/kpropd.xinetd" kpropd
|
||||
fi
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,6 +1,8 @@
|
||||
AUX anki-2.1.0_beta25-web-folder.patch 498 BLAKE2B 5a89ac454e8b4c551c7593bc8d428f9512d1304bd7fd5aa9380a301d92f10ca126a1a319c2ec831d1d5be99c6941c4307a2b674f0a15d2d554b1443fdf053421 SHA512 779806afd6c0eaaac149c89bbe8da2394630aa5a611001307808339f29237b4d7f3db7e1f66241ef67e179a5ab96d64371e1b198044cd9f88389d03a5c9d8478
|
||||
DIST anki-2.1.0_beta25.tgz 4117303 BLAKE2B 0f7021c4da4efa918c285fa6bf85242e52999d0f340d4a882651cf1e2857ac015f6f99967d4a7fee6df92a2b3c4849eb838707b08abd04d534f4d21ce28eb749 SHA512 9ddf984c575df00fe9b7974f24166a0f18d63e904b3d9bd4370de506828a251efed0fb319f06dc23c6852aae46e552994c6633880603a6e746d4d242b9e627f8
|
||||
DIST anki-2.1.0_beta27.tgz 4127906 BLAKE2B b4f83cc30dc3e89f3ca17c03ba8dcfc9a487de43d8ac564d5dc83488e286c302816c8a8140aa764b596404194c5f3727218deec303ef201ccaef38b945d8b32d SHA512 50b4ece1361ecafdfe08dad04e9b622b1e8ba2224bfef7e4660c95f81cb8f525d892170548d741ff53bc19ff4c13863f488a71c31c8328511fea3203d2c345f1
|
||||
DIST anki-2.1.13.tgz 4248906 BLAKE2B 82a2a9a556cbf3596af22a73a2865815561cdd408b249443fc7e144734fdc2b62317120db71475afd7b0d4027f19e53c47437132028ef78b158ec3624f54a33f SHA512 921ef48b16c0c8c83b85523aa0a5b828210b210cd51fa471f57e9aa6777a1aced30c7e24084ef0c2f14c9d846a19091923d13faaff7ed9075860fc23f8ba1cd3
|
||||
EBUILD anki-2.1.0_beta25.ebuild 1881 BLAKE2B ff530eefc984bd972004a51c5b958102e31ace78ce8042b567311e8a79ed65b44ed901c675f58b7a386400a1bb3beee6dffe9ecc598ced33d10afd6fb7ce565c SHA512 8faab45dd5c2def4a01083669569f4389f975ed43359b072b24f62e80f32009de34b6b6c5939998f829d4f90d47eb6be310e589f2410b038f7cf7d40bbdf121a
|
||||
EBUILD anki-2.1.0_beta27.ebuild 1917 BLAKE2B 1b1d8b08965e44ec4dd6c6afa20e5c36f215cfa764fff1c1b950fcf54f7b0daad63bddd8c9f2d416567ab504c1cbe1d12521eea17616da1e53fe5e0a9ef546d7 SHA512 3c8e2f3056028d8de9cb6ad2510c9838fc2450e0b992dfaee69fc40fa60ad8a16eebb30c0ccb573a66a33b506475239482b5bf2598c2b881e2e1a52dadf9d81d
|
||||
EBUILD anki-2.1.13.ebuild 2022 BLAKE2B 1d4b9b646425c55d3d3f9e4562566065c3f2a77e252914ab1f9eb2384dcb3df35b0997cc9f68e72fed217e50976d092a47e306a79f529388b848981347f1de95 SHA512 4ad442b28e2c2cd5d1ecb4ac4c0c8486aaf22592af3ad8ef740eb65af60e79560b9bb42e6074745d9c1dff1c6c6c7552885401d149ee8e29643403fe59c087fd
|
||||
MISC metadata.xml 619 BLAKE2B a41d6e72dccb367627bfc34855a7f2dc657021907f1940c837ea99f134bf30cccb84157c6eea96944fee4e4d5275c329b5721abcabfb31b3a572b86789cd0ed2 SHA512 8b6656964a3c2cee9761b278839f31546a3fe2a4efd500cd015658af3502b548888e939bbeee45ead9c88632ade12c7f0ed33fcf8cdfc6d0ac91de63ac8bb351
|
||||
|
@ -0,0 +1,85 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python3_6 )
|
||||
PYTHON_REQ_USE="sqlite"
|
||||
|
||||
inherit eutils python-single-r1 xdg
|
||||
|
||||
DESCRIPTION="A spaced-repetition memory training program (flash cards)"
|
||||
HOMEPAGE="https://apps.ankiweb.net"
|
||||
SRC_URI="https://apps.ankiweb.net/downloads/current/${P}-source.tgz -> ${P}.tgz"
|
||||
|
||||
S="${WORKDIR}/${P}"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="latex +recording +sound test"
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
dev-python/PyQt5[gui,svg,webengine,widgets,${PYTHON_USEDEP}]
|
||||
>=dev-python/httplib2-0.7.4[${PYTHON_USEDEP}]
|
||||
dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
|
||||
dev-python/decorator[${PYTHON_USEDEP}]
|
||||
dev-python/markdown[${PYTHON_USEDEP}]
|
||||
dev-python/requests[${PYTHON_USEDEP}]
|
||||
dev-python/send2trash[${PYTHON_USEDEP}]
|
||||
recording? ( media-sound/lame )
|
||||
sound? ( media-video/mpv )
|
||||
latex? (
|
||||
app-text/texlive
|
||||
app-text/dvipng
|
||||
)
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
test? ( dev-python/nose[${PYTHON_USEDEP}] )
|
||||
"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${PN}-2.1.0_beta25-web-folder.patch )
|
||||
|
||||
pkg_setup() {
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
sed -i -e "s/updates=True/updates=False/" \
|
||||
aqt/profiles.py || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
:;
|
||||
}
|
||||
|
||||
src_test() {
|
||||
sed -e "s:nose=nosetests$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests\":" \
|
||||
-i tools/tests.sh || die
|
||||
sed -e "s:nose=nosetests3$:nose=\"${EPYTHON} ${EROOT}usr/bin/nosetests3\":" \
|
||||
-i tools/tests.sh || die
|
||||
sed -e "s:which nosetests3:which ${EROOT}usr/bin/nosetests3:" \
|
||||
-i tools/tests.sh || die
|
||||
./tools/tests.sh || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
doicon ${PN}.png
|
||||
domenu ${PN}.desktop
|
||||
doman ${PN}.1
|
||||
|
||||
dodoc README.md README.development
|
||||
python_domodule aqt anki
|
||||
python_newscript runanki anki
|
||||
|
||||
# Localization files go into the anki directory:
|
||||
python_moduleinto anki
|
||||
python_domodule locale
|
||||
|
||||
# not sure if this is correct, but
|
||||
# site-packages/aqt/mediasrv.py wants the directory
|
||||
insinto /usr/share/anki
|
||||
doins -r web
|
||||
}
|
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
DIST skrooge-2.19.1.tar.xz 21111836 BLAKE2B 5a1a7a8212699ce657e33f5b2ab12b305a3c6840dccaeff20fc42796b3587d02a60cd1f2313909b6411e9ad71c4f1bd254349d9a9846c6707a31736507713fef SHA512 4c9addaf56bda0a575c995a2d9229927f6c23ca1931d8ea50ec83afab31149006fd0cc339af79afe0d046c00b5d3dbe4c629e48eac404a31fbe45b3747dcb869
|
||||
EBUILD skrooge-2.19.1.ebuild 2475 BLAKE2B 1f540144c20948024ef8f19fdfeec84d9a1124644dfcefb982f98f977b6cd2228856d56c0ba06b65f2f0d7434b143a6e2d992341ec9a095c633d1706f4acb571 SHA512 530b6edbb410e9b54ffa1f0f43a1ce6b7304565de1118a030a61a3304f5f75cbec359023dd01e073528bc23a5e95e07dce52b132e51b642850cfb80e8f3a54b0
|
||||
EBUILD skrooge-2.19.1.ebuild 2486 BLAKE2B 49fb355d5c5d80145991189cf7861dce26ce103a497bc3e060ec8dbfeefe78abca478b5e3115c4309202e89462ce419bfa8728f47022ba9897d334707a91d30a SHA512 5441630ebcaa1e8474848863586ac2b9913787efae2f7d252abecb425b7528825c699805fe73eda0099cf55e1538a95ab3d258d2ee6e94eaebcae15033d4579e
|
||||
MISC metadata.xml 508 BLAKE2B b55c79406982c895e2c0a3f680944fb561823a3713408f67b4f8de74d03246cd9b52a654d4ec97935d4f7740b9d9f4ebf27d81a9c226dc67d9922500c6e6bde0 SHA512 0b38f9d35783e7fbf2b86b9ead3772416b7080d3df07b801ecd9ef4e5329f7690e6e1b9f817d2fd8947d6735f89cfa57fb516fbcc2b383d5278f27fd89390e97
|
||||
|
Binary file not shown.
Binary file not shown.
@ -1,5 +1,3 @@
|
||||
DIST kbibtex-0.8.2.tar.xz 4065904 BLAKE2B 5b862ef48dc3e0fb2895aa2ad0c1fa8e712c5f63d0a279b33f9d41fca0262bbde1bd00423657e2714dfbacb28657e067760192adfa033f70ac5771a7188ad4cb SHA512 f15e2d1969f79f354881ccb1e41c5d6f1628c4850b3bd177cba0b74b1aab9aa61935f65ef280d242d0ef2ac816ce45b8a2e8a4ff51720a2400ec52bd555f594e
|
||||
DIST kbibtex-0.9.tar.xz 4184288 BLAKE2B 90baf7c4960540566c59b198de307703d0f34ff6f4284933c187625b2e4065739fb16b004408fec5929d4923e7f651091915841c94ef09797419daa737ae39eb SHA512 bdd849094f66feb1bd6d02131580cb5d2e1f8d172a4e36141a48d3fc38375b5f4512078d13d6310f326b5cb7b15364616308eaac6c2c10ef897f8f752e1f6682
|
||||
EBUILD kbibtex-0.8.2.ebuild 1936 BLAKE2B f6fbf95407c366b723175ba60debe6e8642041bcfda2e80da45449a9fd5bedd4b818db854ee87e09ec2625a92a7053d0acfd34ab0539312309effd0819dc1463 SHA512 a7c7fa54c5e372bb4d839477c307f8643f9eabc48c402726d286e81421951a1f1afa778e279945283b8b68054f4152fa6903217d2467790185b768bdbc38c6d6
|
||||
EBUILD kbibtex-0.9.ebuild 1883 BLAKE2B f275ab2f64d52ee8272200346e17c269e1fef3492139d0d9e6fdde78156da7c2f582561155b0bb57ae13567c51bb8daade45cfab61cda8df4848dc0de561d0c8 SHA512 9e46c0fd15bb3110a29cbccf9f52bf70e2c19e19abe2dc3437fff429384a3e136ddbbe5c402887b8da5bc79bdcbe18b39516a7e1cb8e8f1225e5e91ce5d0f258
|
||||
MISC metadata.xml 518 BLAKE2B e10a5e38918c43315c3804c787f80c6df00f7a37da896784a1ee932a90c7f6c15d8a1fc69313314dadaf01461b65e6be78b189226ccae9fda5422950a86edb63 SHA512 be7be6b52a067ed23384344706adaa13cd06667e768a9b5adc2d93b2edeb5feec426dc83395a226219a469bb5fbe99d378b5e1c87ea82e17a05c9751f03e12bb
|
||||
EBUILD kbibtex-0.9.ebuild 1882 BLAKE2B 90b416cddbbc4652a3b0cf29bb11960e800be20b7fd9519e566f26845bfbb5dea2680530d392bfc87a050f16686a39e0d1ce4e4d317b322d2f0693870c4aae3c SHA512 89998954808ef13654240a26b18a8ada4e3bffd20c7ef8b6b4839f3d867d4ab21852ce74118cb0755e689c55b03da5bc44282ccefe1415a28f5cb7d4dfcf89b7
|
||||
MISC metadata.xml 440 BLAKE2B e5121ee173f89412a1bf3339de23a9e13fcec40f52c82129ebd185732759e4ad586b922d31e6470f91e03ba2ce614ba6de75dcb340e0f20d5b799c3476bde23b SHA512 cb2f6751bff9d468dde56635a792813de84b6c383e488ab5764c9656e54a892f5a9b9fd4932d49ec603bae4716f9f0bdd3cbe90b0c796017fceeb6b61196f1ef
|
||||
|
@ -1,80 +0,0 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
KDE_HANDBOOK="optional"
|
||||
KDE_TEST="true"
|
||||
VIRTUALX_REQUIRED="test"
|
||||
inherit kde5
|
||||
|
||||
DESCRIPTION="BibTeX editor to edit bibliographies used with LaTeX"
|
||||
HOMEPAGE="https://userbase.kde.org/KBibTeX"
|
||||
if [[ ${KDE_BUILD_TYPE} != live ]]; then
|
||||
SRC_URI="mirror://kde/stable/KBibTeX/${PV}/${P}.tar.xz"
|
||||
KEYWORDS="amd64 x86"
|
||||
fi
|
||||
|
||||
LICENSE="GPL-2"
|
||||
IUSE="webengine webkit zotero"
|
||||
|
||||
REQUIRED_USE="?? ( webengine webkit )"
|
||||
|
||||
DEPEND="
|
||||
$(add_frameworks_dep kcompletion)
|
||||
$(add_frameworks_dep kconfig)
|
||||
$(add_frameworks_dep kconfigwidgets)
|
||||
$(add_frameworks_dep kcoreaddons)
|
||||
$(add_frameworks_dep kcrash)
|
||||
$(add_frameworks_dep ki18n)
|
||||
$(add_frameworks_dep kiconthemes)
|
||||
$(add_frameworks_dep kio)
|
||||
$(add_frameworks_dep kitemviews)
|
||||
$(add_frameworks_dep kjobwidgets)
|
||||
$(add_frameworks_dep kparts)
|
||||
$(add_frameworks_dep kservice)
|
||||
$(add_frameworks_dep ktextwidgets)
|
||||
$(add_frameworks_dep kwallet)
|
||||
$(add_frameworks_dep kwidgetsaddons)
|
||||
$(add_frameworks_dep kxmlgui)
|
||||
$(add_qt_dep qtdbus)
|
||||
$(add_qt_dep qtgui)
|
||||
$(add_qt_dep qtnetwork)
|
||||
$(add_qt_dep qtwidgets)
|
||||
$(add_qt_dep qtxml)
|
||||
$(add_qt_dep qtxmlpatterns)
|
||||
app-text/poppler[qt5]
|
||||
dev-libs/icu:=
|
||||
virtual/tex-base
|
||||
webengine? ( $(add_qt_dep qtwebengine 'widgets') )
|
||||
webkit? ( $(add_qt_dep qtwebkit) )
|
||||
zotero? (
|
||||
app-crypt/qca[qt5(+)]
|
||||
dev-libs/qoauth:5
|
||||
)
|
||||
"
|
||||
RDEPEND="${DEPEND}
|
||||
!app-text/kbibtex:4
|
||||
dev-tex/bibtex2html
|
||||
x11-misc/shared-mime-info
|
||||
"
|
||||
|
||||
RESTRICT+=" test"
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
$(cmake-utils_use_find_package webengine Qt5WebEngineWidgets)
|
||||
$(cmake-utils_use_find_package webkit Qt5WebKitWidgets)
|
||||
$(cmake-utils_use_find_package zotero Qca-qt5)
|
||||
)
|
||||
|
||||
kde5_src_configure
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
kde5_pkg_postinst
|
||||
|
||||
if ! has_version "kde-apps/okular:${SLOT}" ; then
|
||||
elog "For PDF or PostScript document preview support, please install kde-apps/okular:${SLOT}"
|
||||
fi
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
DIST libmwaw-0.3.14.tar.xz 1276240 BLAKE2B 34a5b118064dcac37834c83b2b5a61303f3e2eb70e41322845ff7661a5494c0b85db0bb07c6bf1f357c2027cab1c515eade58bb6b4fdf845a81d4d079a414b98 SHA512 6893a7a8a72765a66973a94bc7de8b3b6061aa85fd9cca5e73cb2a4024cbe81f0c030df0b6383f24835643259c361efda5527813bb84a1b08d0089d509215888
|
||||
DIST libmwaw-0.3.15.tar.xz 1289744 BLAKE2B 9aed923542e795904761e4969299785906aa65c735541788d91eb41e80420ac6c6df4df5e0cfa156c71d4e100c601e5e984de10c6a5f66eebe6ffb5f0374cc1d SHA512 0b2443fc6bc9da9247f7585743424df440f89317af989018d8b972864bf91e3c5cd78c39094a45d9de8114906b2b2a93f68ddb967af8565e4b499f643d86e682
|
||||
EBUILD libmwaw-0.3.14.ebuild 1015 BLAKE2B eb9a228a21d0bf53be7af47baf26458f1cea0c6a2e4f4bbff499533c9b7a9c226fe401bc112e4009972232ca2cf96846085cb2d9af0d37b62277b5c8e5478cf1 SHA512 58f7477e5af9f99a2248ec8f233cc5c1ec9d679c1f0a6dc4a278beb718140eb762c3c3a16cd43357c779b16b1341c2e843002a2559378022aabf7f92053caf75
|
||||
EBUILD libmwaw-0.3.15.ebuild 1025 BLAKE2B 17b65521eded14318a96cff1732805277042d850826b56b4f53a2b5de13c44e18a62eb22c99bc7bd54da34bdf483b2e8bfe06f929270d0c2d3efa49bfdb31021 SHA512 7c96b598b5d010b85b2fd46c89ac09ab41775673e8fe51f16ecf485d8c9871d6810a040cb8de491f2f0c94fe733992b559337343ca3675160345bb75ec7ce836
|
||||
EBUILD libmwaw-9999.ebuild 1027 BLAKE2B e51984196fe26cf9e7ba8ebe2e6de35c58443d3db82a65ee5d0358ac05f7905227670e05106e89d52ecb264f1e3833fe38917fce36a1fb6a2449228d90409d82 SHA512 9b530edcb03829b26715e09c5b99dc5f08bda876317813bf4589a7366a4bf20c5e2f0604792d103d6f50f2f7c4439a19dc60e362bef8627026508910eabf7837
|
||||
MISC metadata.xml 403 BLAKE2B cbddacc98e4f22e521d739150ee4044b93c297dbd6d220a445192a3d1a6316491d6ed72ada8bd138c287133fcaf1b3d5ce580e68dd3ec071d36abbc1b05b4b6d SHA512 12cebd7bdaff6a793598f40cb11f4ae6681dcb29b18ecb7db92681abf1f6d4ce0281ae292c84106a143c0ff5ff3395e37604b3576c6a479001fc351dba10c7ed
|
||||
|
@ -1,49 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
EGIT_REPO_URI="git://git.code.sf.net/p/libmwaw/libmwaw"
|
||||
[[ ${PV} == 9999 ]] && inherit autotools git-r3
|
||||
|
||||
DESCRIPTION="Library parsing many pre-OSX MAC text formats"
|
||||
HOMEPAGE="https://sourceforge.net/p/libmwaw/wiki/Home/"
|
||||
[[ ${PV} == 9999 ]] || SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0"
|
||||
|
||||
[[ ${PV} == 9999 ]] || \
|
||||
KEYWORDS="amd64 ~arm ~arm64 ~ppc64 x86"
|
||||
|
||||
IUSE="doc static-libs tools"
|
||||
|
||||
RDEPEND="
|
||||
dev-libs/librevenge
|
||||
sys-libs/zlib
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
sys-devel/libtool
|
||||
virtual/pkgconfig
|
||||
doc? ( app-doc/doxygen )
|
||||
"
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
[[ ${PV} == 9999 ]] && eautoreconf
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# zip is hard enabled as the zlib is dep on the rdeps anyway
|
||||
econf \
|
||||
--enable-zip \
|
||||
--disable-werror \
|
||||
$(use_with doc docs) \
|
||||
$(use_enable static-libs static) \
|
||||
$(use_enable tools)
|
||||
}
|
||||
|
||||
src_install() {
|
||||
default
|
||||
find "${D}" -name '*.la' -delete || die
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
AUX writerperfect-0.9.6-gsf-buildfix.patch 428 BLAKE2B e141a4fb1a4515d1359d314dd066fa52edea3f5d69f14e06e08a8eef110a57b164011db311b9c6f0d563d7ca6e921d4082e6a61c6ea1d3a871f6d0dcb8049d71 SHA512 9446e3826173909177c091c752666a540aa5edf26aa0e7546b2e7520d64df5e8f4db578e79e6e86fb261118bcadc8f620bd7eee36d5d335812a00151c5dee5bc
|
||||
DIST writerperfect-0.9.5.tar.xz 302176 BLAKE2B 4ef8fd72f01e3c208a59c520440975f38dcf1edc353134721b7f06d042752adad9c825503f5756a74bede2307f7317c28e054dbcb6c5c1000a606822e97d2c8b SHA512 7467a798da362883101780b598e9a673c10f86f29c01ece1438ea524a0413a00928274f87895f3a8ae26f6784cdcc34e0e84039ca591dc3f75b2e25c53744ccc
|
||||
DIST writerperfect-0.9.6.tar.xz 330360 BLAKE2B da566fb8e1aae3708646b49b695cf26c5b64aeda1ca1df08ced2549ca8718840744ab011cb7567d1e371ac8e7ee6cfef6a67ee9837cf38b570a3794dc4682f81 SHA512 4a86a23ae2caa133066279994255d8ca7ee16f40ad646bd8ff434c7e4e1a29cf23db7e811b8eca1823dcf9e2456b2e8dbacf03bd5bc0377638fc52fc7d4495a5
|
||||
EBUILD writerperfect-0.9.5.ebuild 1761 BLAKE2B ef4e87d22c7ab182cb1f3e9677bbfa12498f2fade4c353bf1ba0093a4c00ae4cb90d2926b99e799e2dc0304e60102f593126cb0da0f3ee2b4746ef43a6fc1e1b SHA512 95591cec04441b34a37e60460eab58ea69641c9876e7074bcdb1dcd25aa1b7fd438dc52c98f61674b151b82eacdc18cc42c6c844390c6f78ccbd299c07b04fd6
|
||||
EBUILD writerperfect-0.9.6.ebuild 1942 BLAKE2B 3839bd4c54dad8cf969f5b00722a72d8161156679a198cdd73da03918619506789242cb5c88998fc5ad70587aff669a4c9e65697cdb5cbcae356690ca64e7edc SHA512 9463cde1539f9aa2485a35e69288941366d5b7d63d7ae348cc3409aad8946a9046ab9fa2e9437a483e967bd94e91de76d7176b4338a062f31ac987aa32791b35
|
||||
MISC metadata.xml 1792 BLAKE2B db2026455dd4d1ecb5b0e91a404dbb68556e48568394c41f6b5f928f7dd635f7607f79a8a90b8ca06524a9a0ec399f863373a94f9e1b767dff36fc63488ea7f7 SHA512 911c9be2bc46655e7452189f29ada72faab7800056c88cea3afd81d9fe11330e554bbf27d61fc23789441a80f211c706204585f08baa0f76f461438ce809e575
|
||||
|
@ -1,65 +0,0 @@
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
inherit flag-o-matic
|
||||
|
||||
DESCRIPTION="Various formats to Open document format converter"
|
||||
HOMEPAGE="http://libwpd.sf.net"
|
||||
SRC_URI="mirror://sourceforge/libwpd/${P}.tar.xz"
|
||||
|
||||
LICENSE="|| ( LGPL-2.1 MPL-2.0 )"
|
||||
SLOT="0"
|
||||
KEYWORDS="amd64 x86 ~x86-linux ~x86-solaris"
|
||||
IUSE="abiword +cdr debug ebook freehand gsf keynote +mspub +mwaw pagemaker +visio +wpd +wpg +wps"
|
||||
|
||||
# FIXME: libepubgen, librvngabw
|
||||
RDEPEND="
|
||||
=app-text/libodfgen-0.1*
|
||||
>=dev-libs/librevenge-0.0.1
|
||||
media-libs/libeot
|
||||
abiword? ( =app-text/libabw-0.1* )
|
||||
cdr? ( =media-libs/libcdr-0.1* )
|
||||
ebook? ( =app-text/libebook-0.1* )
|
||||
freehand? ( =media-libs/libfreehand-0.1* )
|
||||
gsf? ( gnome-extra/libgsf )
|
||||
keynote? ( =app-text/libetonyek-0.1* )
|
||||
mspub? ( =app-text/libmspub-0.1* )
|
||||
mwaw? ( =app-text/libmwaw-0.3* )
|
||||
pagemaker? ( media-libs/libpagemaker )
|
||||
visio? ( =media-libs/libvisio-0.1* )
|
||||
wpd? ( app-text/libwpd:0.10 )
|
||||
wpg? ( =app-text/libwpg-0.3* )
|
||||
wps? ( =app-text/libwps-0.4* )
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
virtual/pkgconfig
|
||||
"
|
||||
|
||||
REQUIRED_USE="
|
||||
|| ( abiword cdr ebook freehand keynote mspub mwaw pagemaker visio wpd wpg wps )
|
||||
"
|
||||
# configure fails if no import library is selected...
|
||||
|
||||
src_configure() {
|
||||
# bug 651620
|
||||
append-cxxflags -std=c++11
|
||||
|
||||
econf \
|
||||
--disable-werror \
|
||||
$(use_enable debug) \
|
||||
$(use_with abiword libabw) \
|
||||
$(use_with cdr libcdr) \
|
||||
$(use_with ebook libebook) \
|
||||
$(use_with freehand libfreehand) \
|
||||
$(use_with gsf libgsf) \
|
||||
$(use_with keynote libetonyek) \
|
||||
$(use_with mspub libmspub) \
|
||||
$(use_with mwaw libmwaw) \
|
||||
$(use_with pagemaker libpagemaker) \
|
||||
$(use_with visio libvisio) \
|
||||
$(use_with wpd libwpd) \
|
||||
$(use_with wpg libwpg) \
|
||||
$(use_with wps libwps)
|
||||
}
|
Binary file not shown.
@ -1,3 +1,5 @@
|
||||
DIST libadalang-tools-2019-20190517-195C4-src.tar.gz 625775 BLAKE2B 2ec69e307576c505d20a43d229b13404966f4442778e5390da327ae71cc065873de4fff03a720949fa6bfb5ce66f405e7d45f7f0c21032a639efcff208323aed SHA512 b7368606847244cbb08ff2111fabfbfc8a9aa7f58e953febc70838006d94711dba1fd75bfb69ed2081a37a2dfaaad46097127870696c882d7cc54de5d7b051a1
|
||||
DIST libadalang-tools-gpl-2018-src.tar.gz 19938182 BLAKE2B 34104f3bc43c165a9b74ba8c0c03ee2f34686bcd06b5ced730f70f654d8b808e129a85566e081830b4f20304c793eefe0af81b56984cf06190302ad2f6a419be SHA512 a1176575944cd88b9da5f4e9f03caa1a4d09358df71e6a91300d0b35c2a843d0ea1a77fbd93e7b7f16cef1b978022ee20991f5c2ff74f7d05878c3de1220f2b5
|
||||
EBUILD libadalang-tools-2018.ebuild 679 BLAKE2B b2869094c925f06b6e8bb44e0aef8d6c4abc258f2f02d1a6b9b8f7633c1c716db9868dcb90bf63d6c5e1dcc6cb7a6bc7168772daf0a940c2796ff02292f0a31d SHA512 97b31e48174392f26a6fe67a9dfb5f8a4c509e99fff2823b3eced0988dc88f2fd06c1f8d595b5ddd6fa8a978864419dd4f5b390823c8030e86f41003fdcbcccc
|
||||
MISC metadata.xml 573 BLAKE2B 9648a05c891ba971ff98b7e3bd8eabb8dd4a13bf505261977af45d683f25b30cdb59becb03ed2a106c0bb82a71b43bb824571190ad746fa4d1c53e64dcca04f6 SHA512 5bbe15c71d9cf2ea97d7ca28f9c3d97288a3c39db6f7b5b532b950de5d9d2036a6d067c7bb3d415edb785dfc20f7e2ce0296db10eaa25ade6e0eeb517f8541fd
|
||||
EBUILD libadalang-tools-2019.ebuild 975 BLAKE2B 46a71a146afbb36fa369ea064ceb3e0bc0b2dc61ce7a7dc824eeaf39136b4bf6663716c281d75ab657bcae3d89b2bcd955f832308776c2e8dfdc695509a46a8e SHA512 b08bbdcd0c740e559a03a0cc00b0485a2be6b3dd7865d0228adc18056d97b67277da76202f6b4bb2b990c05cf34521e047ccb5d57de48c87e22e1c13b7a3f07b
|
||||
MISC metadata.xml 609 BLAKE2B f462c2a06ef2101b1c03ea448ea0770e108f38530cbeedb332974d686c79ead78cad8c15e1e200c7e9e5005364c3bbfe538bf0820d8bfd701d196bae55c3214d SHA512 6d9183c3467e597593bee1926ce664cde3c3cd764aed941387e979721fee4d3a747ef82143222e78344986c8bf051ac97f698c3410fa97755869470365cec8f0
|
||||
|
@ -0,0 +1,37 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit multiprocessing
|
||||
|
||||
MYP=${P}-20190517-195C4
|
||||
DESCRIPTION="Libadalang-based tools: gnatpp, gnatmetric and gnatstub"
|
||||
HOMEPAGE="https://www.adacore.com/community"
|
||||
SRC_URI="http://mirrors.cdn.adacore.com/art/5cdf8f4e31e87a8f1d42509f ->
|
||||
${MYP}-src.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="gnat_2016 gnat_2017 gnat_2018 +gnat_2019"
|
||||
|
||||
RDEPEND=""
|
||||
DEPEND="${RDEPEND}
|
||||
dev-ada/libadalang[gnat_2016(-)?,gnat_2017(-)?,gnat_2018(-)?,gnat_2019(-)?,static-libs]
|
||||
dev-ada/gprbuild[gnat_2016(-)?,gnat_2017(-)?,gnat_2018(-)?,gnat_2019(-)?]"
|
||||
|
||||
S="${WORKDIR}"/${MYP}-src
|
||||
|
||||
src_compile() {
|
||||
gprbuild -v -k -XLIBRARY_TYPE=static -XXMLADA_BUILD=static \
|
||||
-XGNATCOLL_GMP_BUILD=static \
|
||||
-P src/build.gpr -p -j$(makeopts_jobs) || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin bin/gnatpp
|
||||
newbin bin/gnatmetric gnatmetric-tool
|
||||
newbin bin/gnatstub gnatstub-tool
|
||||
einstalldocs
|
||||
}
|
Binary file not shown.
@ -1,5 +1,3 @@
|
||||
DIST gstreamermm-0.10.11.tar.xz 5840552 BLAKE2B 99e9e934b2885ae02256acb5b5f2ba0b63d99b81c41fa2f7fe47b0a3a60a8178f0727c0c0b1609dc10c53d9b00052e3f16b92ffa4b55c820606bf9f37ab667ff SHA512 2ad370f6902dcb4663ea801bdbbf744a98de9e24fc04f27b5044a4a95337168e2bb195761a07ac9c1011f9ed4936287fcc5f4c2b984f0a362b429d05be7d3909
|
||||
DIST gstreamermm-1.10.0.tar.xz 3529640 BLAKE2B 29b99928cd1b21fd295683b4a1ad0a1b0f8ae959237fcbfef7d5a9296a70a140a04fa390fbbcb8d3151d28239f281e72feb30a0466478e38dfb4e172beaf21f1 SHA512 34eeb9eec5958c96acf7c7791eef80138e5d55fea6ddf1bf9ace6b1ec7f052da2abf04d87089e4c9ead51c631ef7afceaf9fceb946ec3d105da522187c69e429
|
||||
EBUILD gstreamermm-0.10.11.ebuild 897 BLAKE2B 286e1de103d7da56c05719142c84706b73bc1e1c5d28b1c06144c8864690040fc17f8c17790cc81883c6c87a7ccc2145df1e16755156174ec93dd0981739f3f6 SHA512 ae96f4cfcc2dcfe0dc00254e97c4b7a57ab3723bacda48127b1ddde11d95881c8b943ba65cc09711a4f5ee4b42d58dd4be99435ebf89a7d875dd0656ababb903
|
||||
EBUILD gstreamermm-1.10.0.ebuild 1435 BLAKE2B 4057bdcc90a1f32dea45e56bb738062f13349ee12f363f25855c0e25b80376377dde2b0364cc1587a67c31015fa7879e8476b55bfbba9772ece29d5dd64dbf4e SHA512 24d365d1ea5012c26f12330882cd7b766d5ab3ee7df4e62362724208f557cd95aa0e586f8b89c197fda99adcc21b705512189a8211026366608a00310a819ca3
|
||||
MISC metadata.xml 375 BLAKE2B 4471ccdfcd754d109f34248adb67c5e8e7d8d5f05d5bc7e7bed67106525e917a9ff1863a09b93ce81f550dc71f4662017e199e006ef24425eb30af7b3987c7b4 SHA512 3b44cf887272a8478662aeb995b97566cd109b3b134941c11f37ab38b648a58f91644f692440e8aafbc154e7acf85bf385771b008b17537848fa670d6fa1a62f
|
||||
|
@ -1,38 +0,0 @@
|
||||
# Copyright 1999-2014 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI="5"
|
||||
GNOME2_LA_PUNT="yes"
|
||||
|
||||
inherit flag-o-matic gnome2
|
||||
|
||||
DESCRIPTION="C++ interface for GStreamer"
|
||||
HOMEPAGE="https://gstreamer.freedesktop.org/bindings/cplusplus.html"
|
||||
|
||||
LICENSE="LGPL-2.1"
|
||||
SLOT="0.10"
|
||||
KEYWORDS="amd64 ~ppc x86"
|
||||
IUSE="test"
|
||||
|
||||
RDEPEND="
|
||||
>=media-libs/gstreamer-0.10.36:0.10
|
||||
>=media-libs/gst-plugins-base-0.10.36:0.10
|
||||
>=dev-cpp/glibmm-2.33.4:2
|
||||
>=dev-cpp/libxmlpp-2.14:2.6
|
||||
>=dev-libs/libsigc++-2:2
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
virtual/pkgconfig
|
||||
test? (
|
||||
media-libs/gst-plugins-good:0.10
|
||||
media-plugins/gst-plugins-vorbis:0.10
|
||||
media-plugins/gst-plugins-x:0.10 )
|
||||
"
|
||||
|
||||
# Installs reference docs into /usr/share/doc/gstreamermm-0.10/
|
||||
# but that's okay, because the rest of dev-cpp/*mm stuff does the same
|
||||
|
||||
src_prepare() {
|
||||
gnome2_src_prepare
|
||||
append-cxxflags -std=c++11 #568254
|
||||
}
|
Binary file not shown.
@ -0,0 +1,995 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI="7"
|
||||
MY_EXTRAS_VER="20190521-1824Z"
|
||||
SUBSLOT="18"
|
||||
|
||||
JAVA_PKG_OPT_USE="jdbc"
|
||||
|
||||
inherit eutils systemd flag-o-matic prefix toolchain-funcs \
|
||||
java-pkg-opt-2 user cmake-utils
|
||||
|
||||
SRC_URI="https://downloads.mariadb.org/interstitial/${P}/source/${P}.tar.gz "
|
||||
|
||||
# Gentoo patches to MySQL
|
||||
if [[ "${MY_EXTRAS_VER}" != "live" && "${MY_EXTRAS_VER}" != "none" ]]; then
|
||||
SRC_URI="${SRC_URI}
|
||||
mirror://gentoo/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
|
||||
https://gitweb.gentoo.org/proj/mysql-extras.git/snapshot/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
|
||||
https://dev.gentoo.org/~grknight/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
|
||||
https://dev.gentoo.org/~robbat2/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2
|
||||
https://dev.gentoo.org/~jmbsvicetto/distfiles/mysql-extras-${MY_EXTRAS_VER}.tar.bz2"
|
||||
fi
|
||||
|
||||
HOMEPAGE="https://mariadb.org/"
|
||||
DESCRIPTION="An enhanced, drop-in replacement for MySQL"
|
||||
LICENSE="GPL-2 LGPL-2.1+"
|
||||
SLOT="0/${SUBSLOT:-0}"
|
||||
IUSE="+backup bindist client-libs cracklib debug extraengine galera innodb-lz4
|
||||
innodb-lzo innodb-snappy jdbc jemalloc kerberos latin1 libressl mroonga
|
||||
numa odbc oqgraph pam +perl profiling rocksdb selinux +server sphinx
|
||||
sst-rsync sst-mariabackup static systemd systemtap tcmalloc
|
||||
test tokudb xml yassl"
|
||||
|
||||
# Tests always fail when libressl is enabled due to hard-coded ciphers in the tests
|
||||
RESTRICT="!bindist? ( bindist ) libressl? ( test )"
|
||||
|
||||
REQUIRED_USE="jdbc? ( extraengine server !static )
|
||||
server? ( tokudb? ( jemalloc !tcmalloc ) )
|
||||
?? ( tcmalloc jemalloc )
|
||||
static? ( yassl !pam )"
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
|
||||
|
||||
# Shorten the path because the socket path length must be shorter than 107 chars
|
||||
# and we will run a mysql server during test phase
|
||||
S="${WORKDIR}/mysql"
|
||||
|
||||
if [[ "${MY_EXTRAS_VER}" == "live" ]] ; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/mysql-extras.git"
|
||||
EGIT_CHECKOUT_DIR="${WORKDIR%/}/mysql-extras"
|
||||
EGIT_CLONE_TYPE=shallow
|
||||
MY_PATCH_DIR="${WORKDIR%/}/mysql-extras"
|
||||
else
|
||||
MY_PATCH_DIR="${WORKDIR%/}/mysql-extras-${MY_EXTRAS_VER}"
|
||||
fi
|
||||
|
||||
PATCHES=(
|
||||
"${MY_PATCH_DIR}"/20015_all_mariadb-pkgconfig-location.patch
|
||||
"${MY_PATCH_DIR}"/20018_all_mariadb-10.4.5-without-clientlibs-tools.patch
|
||||
"${MY_PATCH_DIR}"/20024_all_mariadb-10.2.6-mysql_st-regression.patch
|
||||
"${MY_PATCH_DIR}"/20025_all_mariadb-10.2.6-gssapi-detect.patch
|
||||
"${MY_PATCH_DIR}"/20035_all_mariadb-10.3-atomic-detection.patch
|
||||
)
|
||||
|
||||
# Be warned, *DEPEND are version-dependant
|
||||
# These are used for both runtime and compiletime
|
||||
COMMON_DEPEND="
|
||||
kernel_linux? (
|
||||
sys-process/procps:0=
|
||||
dev-libs/libaio:0=
|
||||
)
|
||||
>=sys-apps/sed-4
|
||||
>=sys-apps/texinfo-4.7-r1
|
||||
jemalloc? ( dev-libs/jemalloc:0= )
|
||||
tcmalloc? ( dev-util/google-perftools:0= )
|
||||
systemtap? ( >=dev-util/systemtap-1.3:0= )
|
||||
>=sys-libs/zlib-1.2.3:0=
|
||||
kerberos? ( virtual/krb5 )
|
||||
yassl? ( net-libs/gnutls:0= )
|
||||
!yassl? (
|
||||
!libressl? ( >=dev-libs/openssl-1.0.0:0= )
|
||||
libressl? ( dev-libs/libressl:0= )
|
||||
)
|
||||
sys-libs/ncurses:0=
|
||||
!bindist? (
|
||||
sys-libs/binutils-libs:0=
|
||||
>=sys-libs/readline-4.1:0=
|
||||
)
|
||||
server? (
|
||||
backup? ( app-arch/libarchive:0= )
|
||||
cracklib? ( sys-libs/cracklib:0= )
|
||||
extraengine? (
|
||||
odbc? ( dev-db/unixODBC:0= )
|
||||
xml? ( dev-libs/libxml2:2= )
|
||||
)
|
||||
innodb-lz4? ( app-arch/lz4 )
|
||||
innodb-lzo? ( dev-libs/lzo )
|
||||
innodb-snappy? ( app-arch/snappy )
|
||||
mroonga? ( app-text/groonga-normalizer-mysql >=app-text/groonga-7.0.4 )
|
||||
numa? ( sys-process/numactl )
|
||||
oqgraph? ( >=dev-libs/boost-1.40.0:0= dev-libs/judy:0= )
|
||||
pam? ( virtual/pam:0= )
|
||||
systemd? ( sys-apps/systemd:= )
|
||||
tokudb? ( app-arch/snappy )
|
||||
)
|
||||
>=dev-libs/libpcre-8.41-r1:3=
|
||||
"
|
||||
BDEPEND="virtual/yacc
|
||||
|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 )
|
||||
"
|
||||
DEPEND="static? ( sys-libs/ncurses[static-libs] )
|
||||
server? ( extraengine? ( jdbc? ( >=virtual/jdk-1.6 ) ) )
|
||||
${COMMON_DEPEND}"
|
||||
RDEPEND="selinux? ( sec-policy/selinux-mysql )
|
||||
!dev-db/mysql !dev-db/mariadb-galera !dev-db/percona-server !dev-db/mysql-cluster
|
||||
server? ( !prefix? ( dev-db/mysql-init-scripts ) )
|
||||
!<virtual/mysql-5.6-r11
|
||||
${COMMON_DEPEND}
|
||||
server? ( galera? (
|
||||
sys-apps/iproute2
|
||||
=sys-cluster/galera-26*
|
||||
sst-rsync? ( sys-process/lsof )
|
||||
sst-mariabackup? ( net-misc/socat[ssl] )
|
||||
) )
|
||||
perl? ( !dev-db/mytop
|
||||
virtual/perl-Getopt-Long
|
||||
dev-perl/TermReadKey
|
||||
virtual/perl-Term-ANSIColor
|
||||
virtual/perl-Time-HiRes )
|
||||
server? ( extraengine? ( jdbc? ( >=virtual/jre-1.6 ) ) )
|
||||
"
|
||||
# For other stuff to bring us in
|
||||
# dev-perl/DBD-mysql is needed by some scripts installed by MySQL
|
||||
PDEPEND="perl? ( >=dev-perl/DBD-mysql-2.9004 )
|
||||
server? ( ~virtual/mysql-5.6[static=] )"
|
||||
|
||||
pkg_setup() {
|
||||
if [[ ${MERGE_TYPE} != binary ]] ; then
|
||||
local GCC_MAJOR_SET=$(gcc-major-version)
|
||||
local GCC_MINOR_SET=$(gcc-minor-version)
|
||||
if use tokudb && [[ ${GCC_MAJOR_SET} -lt 4 || \
|
||||
${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
|
||||
eerror "${PN} with tokudb needs to be built with gcc-4.7 or later."
|
||||
eerror "Please use gcc-config to switch to gcc-4.7 or later version."
|
||||
die
|
||||
fi
|
||||
# Bug 565584. InnoDB now requires atomic functions introduced with gcc-4.7 on
|
||||
# non x86{,_64} arches
|
||||
if ! use amd64 && ! use x86 && [[ ${GCC_MAJOR_SET} -lt 4 || \
|
||||
${GCC_MAJOR_SET} -eq 4 && ${GCC_MINOR_SET} -lt 7 ]] ; then
|
||||
eerror "${PN} needs to be built with gcc-4.7 or later."
|
||||
eerror "Please use gcc-config to switch to gcc-4.7 or later version."
|
||||
die
|
||||
fi
|
||||
fi
|
||||
java-pkg-opt-2_pkg_setup
|
||||
if has test ${FEATURES} && \
|
||||
use server && ! has userpriv ${FEATURES} ; then
|
||||
eerror "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
|
||||
fi
|
||||
|
||||
# This should come after all of the die statements
|
||||
enewgroup mysql 60 || die "problem adding 'mysql' group"
|
||||
enewuser mysql 60 -1 /dev/null mysql || die "problem adding 'mysql' user"
|
||||
}
|
||||
|
||||
pkg_preinst() {
|
||||
java-pkg-opt-2_pkg_preinst
|
||||
|
||||
# Here we need to see if the implementation switched client libraries
|
||||
# We check if this is a new instance of the package and a client library already exists
|
||||
local SHOW_ABI_MESSAGE libpath
|
||||
if [[ -z ${REPLACING_VERSIONS} && -e "${EROOT}usr/$(get_libdir)/libmysqlclient.so" ]] ; then
|
||||
libpath=$(readlink "${EROOT}usr/$(get_libdir)/libmysqlclient.so")
|
||||
elog "Due to ABI changes when switching between different client libraries,"
|
||||
elog "revdep-rebuild must find and rebuild all packages linking to libmysqlclient."
|
||||
elog "Please run: revdep-rebuild --library ${libpath}"
|
||||
ewarn "Failure to run revdep-rebuild may cause issues with other programs or libraries"
|
||||
fi
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Make sure the vars are correctly initialized
|
||||
mysql_init_vars
|
||||
|
||||
# Create log directory securely if it does not exist
|
||||
[[ -d "${ROOT}${MY_LOGDIR}" ]] || install -d -m0750 -o mysql -g mysql "${ROOT}${MY_LOGDIR}"
|
||||
|
||||
if use server ; then
|
||||
if use pam; then
|
||||
einfo
|
||||
elog "This install includes the PAM authentication plugin."
|
||||
elog "To activate and configure the PAM plugin, please read:"
|
||||
elog "https://mariadb.com/kb/en/mariadb/pam-authentication-plugin/"
|
||||
einfo
|
||||
fi
|
||||
|
||||
if [[ -z "${REPLACING_VERSIONS}" ]] ; then
|
||||
einfo
|
||||
elog "You might want to run:"
|
||||
elog "\"emerge --config =${CATEGORY}/${PF}\""
|
||||
elog "if this is a new install."
|
||||
elog
|
||||
elog "If you are switching server implentations, you should run the"
|
||||
elog "mysql_upgrade tool."
|
||||
einfo
|
||||
else
|
||||
einfo
|
||||
elog "If you are upgrading major versions, you should run the"
|
||||
elog "mysql_upgrade tool."
|
||||
einfo
|
||||
fi
|
||||
|
||||
if use galera ; then
|
||||
einfo
|
||||
elog "Be sure to edit the my.cnf file to activate your cluster settings."
|
||||
elog "This should be done after running \"emerge --config =${CATEGORY}/${PF}\""
|
||||
elog "The first time the cluster is activated, you should add"
|
||||
elog "--wsrep-new-cluster to the options in /etc/conf.d/mysql for one node."
|
||||
elog "This option should then be removed for subsequent starts."
|
||||
einfo
|
||||
if [[ -n "${REPLACING_VERSIONS}" ]] ; then
|
||||
local rver
|
||||
for rver in ${REPLACING_VERSIONS} ; do
|
||||
if ver_test "${rver}" -lt "10.4.0" ; then
|
||||
ewarn "Upgrading galera from a previous version requires admin restart of the entire cluster."
|
||||
ewarn "Please refer to https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-104/#galera"
|
||||
ewarn "for more information"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Note about configuration change
|
||||
einfo
|
||||
elog "This version of mariadb reorganizes the configuration from a single my.cnf"
|
||||
elog "to several files in /etc/mysql/${PN}.d."
|
||||
elog "Please backup any changes you made to /etc/mysql/my.cnf"
|
||||
elog "and add them as a new file under /etc/mysql/${PN}.d with a .cnf extension."
|
||||
elog "You may have as many files as needed and they are read alphabetically."
|
||||
elog "Be sure the options have the appropriate section headers, i.e. [mysqld]."
|
||||
einfo
|
||||
}
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
# Grab the patches
|
||||
[[ "${MY_EXTRAS_VER}" == "live" ]] && S="${WORKDIR}/mysql-extras" git-r3_src_unpack
|
||||
|
||||
mv -f "${WORKDIR}/${P/_rc/}" "${S}" || die
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
_disable_plugin() {
|
||||
echo > "${S%/}/plugin/${1}/CMakeLists.txt" || die
|
||||
}
|
||||
_disable_engine() {
|
||||
echo > "${S%/}/storage/${1}/CMakeLists.txt" || die
|
||||
}
|
||||
|
||||
if use jemalloc; then
|
||||
echo "TARGET_LINK_LIBRARIES(mysqld jemalloc)" >> "${S}/sql/CMakeLists.txt"
|
||||
elif use tcmalloc; then
|
||||
echo "TARGET_LINK_LIBRARIES(mysqld tcmalloc)" >> "${S}/sql/CMakeLists.txt"
|
||||
fi
|
||||
|
||||
# Don't build bundled xz-utils for tokudb
|
||||
echo > "${S}/storage/tokudb/PerconaFT/cmake_modules/TokuThirdParty.cmake" || die
|
||||
sed -i -e 's/ build_lzma//' -e 's/ build_snappy//' "${S}/storage/tokudb/PerconaFT/ft/CMakeLists.txt" || die
|
||||
sed -i -e 's/add_dependencies\(tokuportability_static_conv build_jemalloc\)//' "${S}/storage/tokudb/PerconaFT/portability/CMakeLists.txt" || die
|
||||
|
||||
local plugin
|
||||
local server_plugins=( handler_socket auth_socket feedback metadata_lock_info
|
||||
locale_info qc_info server_audit sql_errlog )
|
||||
local test_plugins=( audit_null auth_examples daemon_example fulltext
|
||||
debug_key_management example_key_management versioning )
|
||||
if ! use server; then # These plugins are for the server
|
||||
for plugin in "${server_plugins[@]}" ; do
|
||||
_disable_plugin "${plugin}"
|
||||
done
|
||||
fi
|
||||
|
||||
if ! use test; then # These plugins are only used during testing
|
||||
for plugin in "${test_plugins[@]}" ; do
|
||||
_disable_plugin "${plugin}"
|
||||
done
|
||||
_disable_engine test_sql_discovery
|
||||
fi
|
||||
|
||||
_disable_engine example
|
||||
|
||||
if ! use oqgraph ; then # avoids extra library checks
|
||||
_disable_engine oqgraph
|
||||
fi
|
||||
|
||||
if use mroonga ; then
|
||||
# Remove the bundled groonga
|
||||
# There is no CMake flag, it simply checks for existance
|
||||
rm -r "${S}"/storage/mroonga/vendor/groonga || die "could not remove packaged groonga"
|
||||
else
|
||||
_disable_engine mroonga
|
||||
fi
|
||||
|
||||
cmake-utils_src_prepare
|
||||
java-pkg-opt-2_src_prepare
|
||||
}
|
||||
|
||||
src_configure(){
|
||||
# bug 508724 mariadb cannot use ld.gold
|
||||
tc-ld-disable-gold
|
||||
# Bug #114895, bug #110149
|
||||
filter-flags "-O" "-O[01]"
|
||||
|
||||
append-cxxflags -felide-constructors
|
||||
|
||||
# bug #283926, with GCC4.4, this is required to get correct behavior.
|
||||
append-flags -fno-strict-aliasing
|
||||
|
||||
CMAKE_BUILD_TYPE="RelWithDebInfo"
|
||||
|
||||
# debug hack wrt #497532
|
||||
mycmakeargs=(
|
||||
-DCMAKE_C_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
|
||||
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(usex debug '' '-DNDEBUG')"
|
||||
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
|
||||
-DMYSQL_DATADIR="${EPREFIX}/var/lib/mysql"
|
||||
-DSYSCONFDIR="${EPREFIX}/etc/mysql"
|
||||
-DINSTALL_BINDIR=bin
|
||||
-DINSTALL_DOCDIR=share/doc/${PF}
|
||||
-DINSTALL_DOCREADMEDIR=share/doc/${PF}
|
||||
-DINSTALL_INCLUDEDIR=include/mysql
|
||||
-DINSTALL_INFODIR=share/info
|
||||
-DINSTALL_LIBDIR=$(get_libdir)
|
||||
-DINSTALL_MANDIR=share/man
|
||||
-DINSTALL_MYSQLSHAREDIR=share/mariadb
|
||||
-DINSTALL_PLUGINDIR=$(get_libdir)/mariadb/plugin
|
||||
-DINSTALL_SCRIPTDIR=share/mariadb/scripts
|
||||
-DINSTALL_MYSQLDATADIR="${EPREFIX}/var/lib/mysql"
|
||||
-DINSTALL_SBINDIR=sbin
|
||||
-DINSTALL_SUPPORTFILESDIR="${EPREFIX}/usr/share/mariadb"
|
||||
-DWITH_COMMENT="Gentoo Linux ${PF}"
|
||||
-DWITH_UNIT_TESTS=$(usex test ON OFF)
|
||||
-DWITH_LIBEDIT=0
|
||||
-DWITH_ZLIB=system
|
||||
-DWITHOUT_LIBWRAP=1
|
||||
-DENABLED_LOCAL_INFILE=1
|
||||
-DMYSQL_UNIX_ADDR="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
||||
-DINSTALL_UNIX_ADDRDIR="${EPREFIX}/var/run/mysqld/mysqld.sock"
|
||||
-DWITH_DEFAULT_COMPILER_OPTIONS=0
|
||||
-DWITH_DEFAULT_FEATURE_SET=0
|
||||
-DINSTALL_SYSTEMD_UNITDIR="$(systemd_get_systemunitdir)"
|
||||
# The build forces this to be defined when cross-compiling. We pass it
|
||||
# all the time for simplicity and to make sure it is actually correct.
|
||||
-DSTACK_DIRECTION=$(tc-stack-grows-down && echo -1 || echo 1)
|
||||
-DPKG_CONFIG_EXECUTABLE="${EPREFIX}/usr/bin/$(tc-getPKG_CONFIG)"
|
||||
-DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
|
||||
-DAUTH_GSSAPI_PLUGIN_TYPE=$(usex kerberos DYNAMIC OFF)
|
||||
-DCONC_WITH_EXTERNAL_ZLIB=YES
|
||||
-DWITH_EXTERNAL_ZLIB=YES
|
||||
-DSUFFIX_INSTALL_DIR=""
|
||||
-DWITH_UNITTEST=OFF
|
||||
-DWITHOUT_CLIENTLIBS=YES
|
||||
-DCLIENT_PLUGIN_DIALOG=OFF
|
||||
-DCLIENT_PLUGIN_AUTH_GSSAPI_CLIENT=OFF
|
||||
-DCLIENT_PLUGIN_MYSQL_CLEAR_PASSWORD=STATIC
|
||||
-DCLIENT_PLUGIN_CACHING_SHA2_PASSWORD=OFF
|
||||
)
|
||||
if use test ; then
|
||||
mycmakeargs+=( -DINSTALL_MYSQLTESTDIR=share/mariadb/mysql-test )
|
||||
else
|
||||
mycmakeargs+=( -DINSTALL_MYSQLTESTDIR='' )
|
||||
fi
|
||||
|
||||
if ! use yassl ; then
|
||||
mycmakeargs+=( -DWITH_SSL=system -DCLIENT_PLUGIN_SHA256_PASSWORD=STATIC )
|
||||
else
|
||||
mycmakeargs+=( -DWITH_SSL=bundled )
|
||||
fi
|
||||
|
||||
# bfd.h is only used starting with 10.1 and can be controlled by NOT_FOR_DISTRIBUTION
|
||||
mycmakeargs+=(
|
||||
-DWITH_READLINE=$(usex bindist 1 0)
|
||||
-DNOT_FOR_DISTRIBUTION=$(usex bindist 0 1)
|
||||
-DENABLE_DTRACE=$(usex systemtap)
|
||||
)
|
||||
|
||||
if use server ; then
|
||||
|
||||
# Federated{,X} must be treated special otherwise they will not be built as plugins
|
||||
if ! use extraengine ; then
|
||||
mycmakeargs+=(
|
||||
-DPLUGIN_FEDERATED=NO
|
||||
-DPLUGIN_FEDERATEDX=NO )
|
||||
fi
|
||||
|
||||
mycmakeargs+=(
|
||||
-DWITH_PCRE=system
|
||||
-DPLUGIN_OQGRAPH=$(usex oqgraph DYNAMIC NO)
|
||||
-DPLUGIN_SPHINX=$(usex sphinx YES NO)
|
||||
-DPLUGIN_TOKUDB=$(usex tokudb YES NO)
|
||||
-DPLUGIN_AUTH_PAM=$(usex pam YES NO)
|
||||
-DPLUGIN_CRACKLIB_PASSWORD_CHECK=$(usex cracklib YES NO)
|
||||
-DPLUGIN_CASSANDRA=NO
|
||||
-DPLUGIN_SEQUENCE=$(usex extraengine YES NO)
|
||||
-DPLUGIN_SPIDER=$(usex extraengine YES NO)
|
||||
-DPLUGIN_CONNECT=$(usex extraengine YES NO)
|
||||
-DCONNECT_WITH_MYSQL=1
|
||||
-DCONNECT_WITH_LIBXML2=$(usex xml)
|
||||
-DCONNECT_WITH_ODBC=$(usex odbc)
|
||||
-DCONNECT_WITH_JDBC=$(usex jdbc)
|
||||
# Build failure and autodep wrt bug 639144
|
||||
-DCONNECT_WITH_MONGO=OFF
|
||||
-DWITH_WSREP=$(usex galera)
|
||||
-DWITH_INNODB_LZ4=$(usex innodb-lz4 ON OFF)
|
||||
-DWITH_INNODB_LZO=$(usex innodb-lzo ON OFF)
|
||||
-DWITH_INNODB_SNAPPY=$(usex innodb-snappy ON OFF)
|
||||
-DPLUGIN_MROONGA=$(usex mroonga DYNAMIC NO)
|
||||
-DPLUGIN_AUTH_GSSAPI=$(usex kerberos DYNAMIC NO)
|
||||
-DWITH_MARIABACKUP=$(usex backup ON OFF)
|
||||
-DWITH_LIBARCHIVE=$(usex backup ON OFF)
|
||||
-DINSTALL_SQLBENCHDIR=""
|
||||
-DPLUGIN_ROCKSDB=$(usex rocksdb DYNAMIC NO)
|
||||
# systemd is only linked to for server notification
|
||||
-DWITH_SYSTEMD=$(usex systemd yes no)
|
||||
-DWITH_NUMA=$(usex numa ON OFF)
|
||||
)
|
||||
|
||||
# Workaround for MDEV-14524
|
||||
use tokudb && mycmakeargs+=( -DTOKUDB_OK=1 )
|
||||
|
||||
if use test ; then
|
||||
# This is needed for the new client lib which tests a real, open server
|
||||
mycmakeargs+=( -DSKIP_TESTS=ON )
|
||||
fi
|
||||
|
||||
if [[ ( -n ${MYSQL_DEFAULT_CHARSET} ) && ( -n ${MYSQL_DEFAULT_COLLATION} ) ]]; then
|
||||
ewarn "You are using a custom charset of ${MYSQL_DEFAULT_CHARSET}"
|
||||
ewarn "and a collation of ${MYSQL_DEFAULT_COLLATION}."
|
||||
ewarn "You MUST file bugs without these variables set."
|
||||
|
||||
mycmakeargs+=(
|
||||
-DDEFAULT_CHARSET=${MYSQL_DEFAULT_CHARSET}
|
||||
-DDEFAULT_COLLATION=${MYSQL_DEFAULT_COLLATION}
|
||||
)
|
||||
|
||||
elif ! use latin1 ; then
|
||||
mycmakeargs+=(
|
||||
-DDEFAULT_CHARSET=utf8
|
||||
-DDEFAULT_COLLATION=utf8_general_ci
|
||||
)
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DDEFAULT_CHARSET=latin1
|
||||
-DDEFAULT_COLLATION=latin1_swedish_ci
|
||||
)
|
||||
fi
|
||||
mycmakeargs+=(
|
||||
-DEXTRA_CHARSETS=all
|
||||
-DMYSQL_USER=mysql
|
||||
-DDISABLE_SHARED=$(usex static YES NO)
|
||||
-DWITH_DEBUG=$(usex debug)
|
||||
-DWITH_EMBEDDED_SERVER=OFF
|
||||
-DWITH_PROFILING=$(usex profiling)
|
||||
)
|
||||
|
||||
if use static; then
|
||||
mycmakeargs+=( -DWITH_PIC=1 )
|
||||
fi
|
||||
|
||||
if use jemalloc || use tcmalloc ; then
|
||||
mycmakeargs+=( -DWITH_SAFEMALLOC=OFF )
|
||||
fi
|
||||
|
||||
# Storage engines
|
||||
mycmakeargs+=(
|
||||
-DWITH_ARCHIVE_STORAGE_ENGINE=1
|
||||
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
|
||||
-DWITH_CSV_STORAGE_ENGINE=1
|
||||
-DWITH_HEAP_STORAGE_ENGINE=1
|
||||
-DWITH_INNOBASE_STORAGE_ENGINE=1
|
||||
-DWITH_MYISAMMRG_STORAGE_ENGINE=1
|
||||
-DWITH_MYISAM_STORAGE_ENGINE=1
|
||||
-DWITH_PARTITION_STORAGE_ENGINE=1
|
||||
)
|
||||
|
||||
else
|
||||
mycmakeargs+=(
|
||||
-DWITHOUT_SERVER=1
|
||||
-DWITH_EMBEDDED_SERVER=OFF
|
||||
-DEXTRA_CHARSETS=none
|
||||
-DINSTALL_SQLBENCHDIR=
|
||||
-DWITH_SYSTEMD=no
|
||||
)
|
||||
fi
|
||||
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-utils_src_compile
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
|
||||
# Remove an unnecessary, private config header which will never match between ABIs and is not meant to be used
|
||||
if [[ -f "${ED}/usr/include/mysql/server/private/config.h" ]] ; then
|
||||
rm "${ED}/usr/include/mysql/server/private/config.h" || die
|
||||
fi
|
||||
|
||||
# Make sure the vars are correctly initialized
|
||||
mysql_init_vars
|
||||
|
||||
# Convenience links
|
||||
einfo "Making Convenience links for mysqlcheck multi-call binary"
|
||||
dosym "mysqlcheck" "/usr/bin/mysqlanalyze"
|
||||
dosym "mysqlcheck" "/usr/bin/mysqlrepair"
|
||||
dosym "mysqlcheck" "/usr/bin/mysqloptimize"
|
||||
|
||||
# INSTALL_LAYOUT=STANDALONE causes cmake to create a /usr/data dir
|
||||
if [[ -d "${ED}/usr/data" ]] ; then
|
||||
rm -Rf "${ED}/usr/data" || die
|
||||
fi
|
||||
|
||||
# Unless they explicitly specific USE=test, then do not install the
|
||||
# testsuite. It DOES have a use to be installed, esp. when you want to do a
|
||||
# validation of your database configuration after tuning it.
|
||||
if ! use test ; then
|
||||
rm -rf "${D}/${MY_SHAREDSTATEDIR}/mysql-test"
|
||||
fi
|
||||
|
||||
# Configuration stuff
|
||||
einfo "Building default configuration ..."
|
||||
insinto "${MY_SYSCONFDIR#${EPREFIX}}"
|
||||
[[ -f "${S}/scripts/mysqlaccess.conf" ]] && doins "${S}"/scripts/mysqlaccess.conf
|
||||
cp "${FILESDIR}/my.cnf-10.2" "${TMPDIR}/my.cnf" || die
|
||||
eprefixify "${TMPDIR}/my.cnf"
|
||||
doins "${TMPDIR}/my.cnf"
|
||||
insinto "${MY_SYSCONFDIR#${EPREFIX}}/mariadb.d"
|
||||
cp "${FILESDIR}/my.cnf.distro-client" "${TMPDIR}/50-distro-client.cnf" || die
|
||||
eprefixify "${TMPDIR}/50-distro-client.cnf"
|
||||
doins "${TMPDIR}/50-distro-client.cnf"
|
||||
|
||||
if use server ; then
|
||||
mycnf_src="my.cnf.distro-server"
|
||||
sed -e "s!@DATADIR@!${MY_DATADIR}!g" \
|
||||
"${FILESDIR}/${mycnf_src}" \
|
||||
> "${TMPDIR}/my.cnf.ok" || die
|
||||
if use prefix ; then
|
||||
sed -i -r -e '/^user[[:space:]]*=[[:space:]]*mysql$/d' \
|
||||
"${TMPDIR}/my.cnf.ok" || die
|
||||
fi
|
||||
if use latin1 ; then
|
||||
sed -i \
|
||||
-e "/character-set/s|utf8|latin1|g" \
|
||||
"${TMPDIR}/my.cnf.ok" || die
|
||||
fi
|
||||
eprefixify "${TMPDIR}/my.cnf.ok"
|
||||
newins "${TMPDIR}/my.cnf.ok" 50-distro-server.cnf
|
||||
|
||||
einfo "Including support files and sample configurations"
|
||||
docinto "support-files"
|
||||
local script
|
||||
for script in \
|
||||
"${S}"/support-files/magic
|
||||
do
|
||||
[[ -f "$script" ]] && dodoc "${script}"
|
||||
done
|
||||
|
||||
docinto "scripts"
|
||||
for script in "${S}"/scripts/mysql* ; do
|
||||
[[ ( -f "$script" ) && ( "${script%.sh}" == "${script}" ) ]] && dodoc "${script}"
|
||||
done
|
||||
# Manually install supporting files that conflict with other packages
|
||||
# but are needed for galera and initial installation
|
||||
exeinto /usr/libexec/mariadb
|
||||
doexe "${BUILD_DIR}/extra/my_print_defaults" "${BUILD_DIR}/extra/perror"
|
||||
fi
|
||||
|
||||
# Remove mytop if perl is not selected
|
||||
if [[ -e "${ED}/usr/bin/mytop" ]] && ! use perl ; then
|
||||
rm -f "${ED}/usr/bin/mytop" || die
|
||||
fi
|
||||
|
||||
# Fix a dangling symlink when galera is not built
|
||||
if [[ -L "${ED}/usr/bin/wsrep_sst_rsync_wan" ]] && ! use galera ; then
|
||||
rm "${ED}/usr/bin/wsrep_sst_rsync_wan" || die
|
||||
fi
|
||||
|
||||
# Remove broken SST scripts that are incompatible
|
||||
local scriptremove
|
||||
for scriptremove in wsrep_sst_xtrabackup wsrep_sst_xtrabackup-v2 ; do
|
||||
if [[ -e "${ED}/usr/bin/${scriptremove}" ]] ; then
|
||||
rm "${ED}/usr/bin/${scriptremove}" || die
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Official test instructions:
|
||||
# USE='extraengine perl server' \
|
||||
# FEATURES='test userpriv -usersandbox' \
|
||||
# ebuild mariadb-X.X.XX.ebuild \
|
||||
# digest clean package
|
||||
src_test() {
|
||||
|
||||
_disable_test() {
|
||||
local rawtestname reason
|
||||
rawtestname="${1}" ; shift
|
||||
reason="${@}"
|
||||
ewarn "test '${rawtestname}' disabled: '${reason}'"
|
||||
echo ${rawtestname} : ${reason} >> "${T}/disabled.def"
|
||||
}
|
||||
|
||||
local TESTDIR="${BUILD_DIR}/mysql-test"
|
||||
local retstatus_unit
|
||||
local retstatus_tests
|
||||
|
||||
if ! use server ; then
|
||||
einfo "Skipping server tests due to minimal build."
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Bug #213475 - MySQL _will_ object strenously if your machine is named
|
||||
# localhost. Also causes weird failures.
|
||||
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
|
||||
|
||||
if [[ $UID -eq 0 ]]; then
|
||||
die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root."
|
||||
fi
|
||||
has usersandbox $FEATURES && ewarn "Some tests may fail with FEATURES=usersandbox"
|
||||
|
||||
einfo ">>> Test phase [test]: ${CATEGORY}/${PF}"
|
||||
|
||||
# Run CTest (test-units)
|
||||
cmake-utils_src_test
|
||||
retstatus_unit=$?
|
||||
|
||||
# Ensure that parallel runs don't die
|
||||
export MTR_BUILD_THREAD="$((${RANDOM} % 100))"
|
||||
# Enable parallel testing, auto will try to detect number of cores
|
||||
# You may set this by hand.
|
||||
# The default maximum is 8 unless MTR_MAX_PARALLEL is increased
|
||||
export MTR_PARALLEL="${MTR_PARALLEL:-auto}"
|
||||
|
||||
# create directories because mysqladmin might run out of order
|
||||
mkdir -p "${T}"/var-tests{,/log} || die
|
||||
|
||||
# Run mysql tests
|
||||
pushd "${TESTDIR}" > /dev/null || die
|
||||
|
||||
touch "${T}/disabled.def"
|
||||
# These are failing in MariaDB 10.0 for now and are believed to be
|
||||
# false positives:
|
||||
#
|
||||
# main.mysql_client_test, main.mysql_client_test_nonblock
|
||||
# main.mysql_client_test_comp:
|
||||
# segfaults at random under Portage only, suspect resource limits.
|
||||
|
||||
local t
|
||||
for t in plugins.cracklib_password_check plugins.two_password_validations ; do
|
||||
_disable_test "$t" "False positive due to varying policies"
|
||||
done
|
||||
|
||||
for t in main.mysql_client_test main.mysql_client_test_nonblock \
|
||||
main.mysql_client_test_comp rpl.rpl_extra_col_master_myisam ; do
|
||||
_disable_test "$t" "False positives in Gentoo"
|
||||
done
|
||||
|
||||
_disable_test main.plugin_auth "Needs client libraries built"
|
||||
|
||||
_disable_test main.func_time "Dependent on time test was written"
|
||||
|
||||
_disable_test compat/oracle.plugin "Needs example plugin which Gentoo disables"
|
||||
|
||||
# run mysql-test tests
|
||||
perl mysql-test-run.pl --force --vardir="${T}/var-tests" --reorder --skip-test=tokudb --skip-test-list="${T}/disabled.def"
|
||||
retstatus_tests=$?
|
||||
|
||||
popd > /dev/null || die
|
||||
|
||||
# Cleanup is important for these testcases.
|
||||
pkill -9 -f "${S}/ndb" 2>/dev/null
|
||||
pkill -9 -f "${S}/sql" 2>/dev/null
|
||||
|
||||
local failures=""
|
||||
[[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit"
|
||||
[[ $retstatus_tests -eq 0 ]] || failures="${failures} tests"
|
||||
|
||||
[[ -z "$failures" ]] || die "Test failures: $failures"
|
||||
einfo "Tests successfully completed"
|
||||
}
|
||||
|
||||
mysql_init_vars() {
|
||||
MY_SHAREDSTATEDIR=${MY_SHAREDSTATEDIR="${EPREFIX}/usr/share/mariadb"}
|
||||
MY_SYSCONFDIR=${MY_SYSCONFDIR="${EPREFIX}/etc/mysql"}
|
||||
MY_LOCALSTATEDIR=${MY_LOCALSTATEDIR="${EPREFIX}/var/lib/mysql"}
|
||||
MY_LOGDIR=${MY_LOGDIR="${EPREFIX}/var/log/mysql"}
|
||||
|
||||
if [[ -z "${MY_DATADIR}" ]] ; then
|
||||
MY_DATADIR=""
|
||||
if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then
|
||||
MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
|
||||
| sed -ne '/datadir/s|^--datadir=||p' \
|
||||
| tail -n1`
|
||||
if [[ -z "${MY_DATADIR}" ]] ; then
|
||||
MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \
|
||||
| sed -e 's/.*=\s*//' \
|
||||
| tail -n1`
|
||||
fi
|
||||
fi
|
||||
if [[ -z "${MY_DATADIR}" ]] ; then
|
||||
MY_DATADIR="${MY_LOCALSTATEDIR}"
|
||||
einfo "Using default MY_DATADIR"
|
||||
fi
|
||||
elog "MySQL MY_DATADIR is ${MY_DATADIR}"
|
||||
|
||||
if [[ -z "${PREVIOUS_DATADIR}" ]] ; then
|
||||
if [[ -e "${MY_DATADIR}" ]] ; then
|
||||
# If you get this and you're wondering about it, see bug #207636
|
||||
elog "MySQL datadir found in ${MY_DATADIR}"
|
||||
elog "A new one will not be created."
|
||||
PREVIOUS_DATADIR="yes"
|
||||
else
|
||||
PREVIOUS_DATADIR="no"
|
||||
fi
|
||||
export PREVIOUS_DATADIR
|
||||
fi
|
||||
else
|
||||
if [[ ${EBUILD_PHASE} == "config" ]]; then
|
||||
local new_MY_DATADIR
|
||||
new_MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \
|
||||
| sed -ne '/datadir/s|^--datadir=||p' \
|
||||
| tail -n1`
|
||||
|
||||
if [[ ( -n "${new_MY_DATADIR}" ) && ( "${new_MY_DATADIR}" != "${MY_DATADIR}" ) ]]; then
|
||||
ewarn "MySQL MY_DATADIR has changed"
|
||||
ewarn "from ${MY_DATADIR}"
|
||||
ewarn "to ${new_MY_DATADIR}"
|
||||
MY_DATADIR="${new_MY_DATADIR}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
export MY_SHAREDSTATEDIR MY_SYSCONFDIR
|
||||
export MY_LOCALSTATEDIR MY_LOGDIR
|
||||
export MY_DATADIR
|
||||
}
|
||||
|
||||
pkg_config() {
|
||||
_getoptval() {
|
||||
local mypd="${EROOT}"usr/libexec/mariadb/my_print_defaults
|
||||
local section="$1"
|
||||
local flag="--${2}="
|
||||
local extra_options="${3}"
|
||||
"${mypd}" $extra_options $section | sed -n "/^${flag}/s,${flag},,gp"
|
||||
}
|
||||
local old_MY_DATADIR="${MY_DATADIR}"
|
||||
local old_HOME="${HOME}"
|
||||
# my_print_defaults needs to read stuff in $HOME/.my.cnf
|
||||
export HOME=${EPREFIX}/root
|
||||
|
||||
# Make sure the vars are correctly initialized
|
||||
mysql_init_vars
|
||||
|
||||
[[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR"
|
||||
if [[ ! -x "${EROOT}/usr/sbin/mysqld" ]] ; then
|
||||
die "Minimal builds do NOT include the MySQL server"
|
||||
fi
|
||||
|
||||
if [[ ( -n "${MY_DATADIR}" ) && ( "${MY_DATADIR}" != "${old_MY_DATADIR}" ) ]]; then
|
||||
local MY_DATADIR_s="${ROOT}/${MY_DATADIR}"
|
||||
MY_DATADIR_s="${MY_DATADIR_s%%/}"
|
||||
local old_MY_DATADIR_s="${ROOT}/${old_MY_DATADIR}"
|
||||
old_MY_DATADIR_s="${old_MY_DATADIR_s%%/}"
|
||||
|
||||
if [[ ( -d "${old_MY_DATADIR_s}" ) && ( "${old_MY_DATADIR_s}" != / ) ]]; then
|
||||
if [[ -d "${MY_DATADIR_s}" ]]; then
|
||||
ewarn "Both ${old_MY_DATADIR_s} and ${MY_DATADIR_s} exist"
|
||||
ewarn "Attempting to use ${MY_DATADIR_s} and preserving ${old_MY_DATADIR_s}"
|
||||
else
|
||||
elog "Moving MY_DATADIR from ${old_MY_DATADIR_s} to ${MY_DATADIR_s}"
|
||||
mv --strip-trailing-slashes -T "${old_MY_DATADIR_s}" "${MY_DATADIR_s}" \
|
||||
|| die "Moving MY_DATADIR failed"
|
||||
fi
|
||||
else
|
||||
ewarn "Previous MY_DATADIR (${old_MY_DATADIR_s}) does not exist"
|
||||
if [[ -d "${MY_DATADIR_s}" ]]; then
|
||||
ewarn "Attempting to use ${MY_DATADIR_s}"
|
||||
else
|
||||
eerror "New MY_DATADIR (${MY_DATADIR_s}) does not exist"
|
||||
die "Configuration Failed! Please reinstall ${CATEGORY}/${PN}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
local pwd1="a"
|
||||
local pwd2="b"
|
||||
local maxtry=15
|
||||
|
||||
if [ -z "${MYSQL_ROOT_PASSWORD}" ]; then
|
||||
local tmp_mysqld_password_source=
|
||||
|
||||
for tmp_mysqld_password_source in mysql client; do
|
||||
einfo "Trying to get password for mysql 'root' user from '${tmp_mysqld_password_source}' section ..."
|
||||
MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password)"
|
||||
if [[ -n "${MYSQL_ROOT_PASSWORD}" ]]; then
|
||||
if [[ ${MYSQL_ROOT_PASSWORD} == *$'\n'* ]]; then
|
||||
ewarn "Ignoring password from '${tmp_mysqld_password_source}' section due to newline character (do you have multiple password options set?)!"
|
||||
MYSQL_ROOT_PASSWORD=
|
||||
continue
|
||||
fi
|
||||
|
||||
einfo "Found password in '${tmp_mysqld_password_source}' section!"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Sometimes --show is required to display passwords in some implementations of my_print_defaults
|
||||
if [[ "${MYSQL_ROOT_PASSWORD}" == '*****' ]]; then
|
||||
MYSQL_ROOT_PASSWORD="$(_getoptval "${tmp_mysqld_password_source}" password --show)"
|
||||
fi
|
||||
|
||||
unset tmp_mysqld_password_source
|
||||
fi
|
||||
MYSQL_TMPDIR="$(_getoptval mysqld tmpdir | tail -n1)"
|
||||
# These are dir+prefix
|
||||
MYSQL_RELAY_LOG="$(_getoptval mysqld relay-log | tail -n1)"
|
||||
MYSQL_RELAY_LOG=${MYSQL_RELAY_LOG%/*}
|
||||
MYSQL_LOG_BIN="$(_getoptval mysqld log-bin | tail -n1)"
|
||||
MYSQL_LOG_BIN=${MYSQL_LOG_BIN%/*}
|
||||
|
||||
if [[ ! -d "${ROOT}/$MYSQL_TMPDIR" ]]; then
|
||||
einfo "Creating MySQL tmpdir $MYSQL_TMPDIR"
|
||||
install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_TMPDIR"
|
||||
fi
|
||||
if [[ ! -d "${ROOT}/$MYSQL_LOG_BIN" ]]; then
|
||||
einfo "Creating MySQL log-bin directory $MYSQL_LOG_BIN"
|
||||
install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_LOG_BIN"
|
||||
fi
|
||||
if [[ ! -d "${EROOT}/$MYSQL_RELAY_LOG" ]]; then
|
||||
einfo "Creating MySQL relay-log directory $MYSQL_RELAY_LOG"
|
||||
install -d -m 770 -o mysql -g mysql "${EROOT}/$MYSQL_RELAY_LOG"
|
||||
fi
|
||||
|
||||
if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then
|
||||
ewarn "You have already a MySQL database in place."
|
||||
ewarn "(${ROOT}/${MY_DATADIR}/*)"
|
||||
ewarn "Please rename or delete it if you wish to replace it."
|
||||
die "MySQL database already exists!"
|
||||
fi
|
||||
|
||||
# Bug #213475 - MySQL _will_ object strenously if your machine is named
|
||||
# localhost. Also causes weird failures.
|
||||
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost"
|
||||
|
||||
if [[ -z "${MYSQL_ROOT_PASSWORD}" ]]; then
|
||||
|
||||
einfo "Please provide a password for the mysql 'root'@'localhost' user now"
|
||||
einfo "or through the ${HOME}/.my.cnf file."
|
||||
ewarn "Avoid [\"'\\_%] characters in the password"
|
||||
einfo "Not entering a password defaults to UNIX authentication"
|
||||
read -rsp " >" pwd1 ; echo
|
||||
|
||||
if [[ -n "${pwd1}" ]] ; then
|
||||
|
||||
einfo "Retype the password"
|
||||
read -rsp " >" pwd2 ; echo
|
||||
|
||||
if [[ "x$pwd1" != "x$pwd2" ]] ; then
|
||||
die "Passwords are not the same"
|
||||
fi
|
||||
MYSQL_ROOT_PASSWORD="${pwd1}"
|
||||
fi
|
||||
unset pwd1 pwd2
|
||||
fi
|
||||
|
||||
local options
|
||||
local sqltmp="$(emktemp)"
|
||||
|
||||
# Fix bug 446200. Don't reference host my.cnf, needs to come first,
|
||||
# see https://bugs.mysql.com/bug.php?id=31312
|
||||
use prefix && options="${options} '--defaults-file=${MY_SYSCONFDIR}/my.cnf'"
|
||||
|
||||
# Figure out which options we need to disable to do the setup
|
||||
local helpfile="${TMPDIR}/mysqld-help"
|
||||
"${EROOT}/usr/sbin/mysqld" --verbose --help >"${helpfile}" 2>/dev/null
|
||||
for opt in grant-tables host-cache name-resolve networking slave-start \
|
||||
federated ssl log-bin relay-log slow-query-log external-locking \
|
||||
log-slave-updates \
|
||||
; do
|
||||
optexp="--(skip-)?${opt}" optfull="--loose-skip-${opt}"
|
||||
egrep -sq -- "${optexp}" "${helpfile}" && options="${options} ${optfull}"
|
||||
done
|
||||
|
||||
einfo "Creating the mysql database and setting proper permissions on it ..."
|
||||
|
||||
# Now that /var/run is a tmpfs mount point, we need to ensure it exists before using it
|
||||
PID_DIR="${EROOT}/var/run/mysqld"
|
||||
if [[ ! -d "${PID_DIR}" ]]; then
|
||||
install -d -m 755 -o mysql -g mysql "${PID_DIR}" || die "Could not create pid directory"
|
||||
fi
|
||||
|
||||
if [[ ! -d "${MY_DATADIR}" ]]; then
|
||||
install -d -m 750 -o mysql -g mysql "${MY_DATADIR}" || die "Could not create data directory"
|
||||
fi
|
||||
|
||||
pushd "${TMPDIR}" &>/dev/null || die
|
||||
|
||||
# Filling timezones, see
|
||||
# https://dev.mysql.com/doc/mysql/en/time-zone-support.html
|
||||
"${EROOT}/usr/bin/mysql_tzinfo_to_sql" "${EROOT}/usr/share/zoneinfo" > "${sqltmp}" 2>/dev/null
|
||||
|
||||
local cmd=( "${EROOT}usr/share/mariadb/scripts/mysql_install_db" )
|
||||
[[ -f "${cmd}" ]] || cmd=( "${EROOT}usr/bin/mysql_install_db" )
|
||||
cmd+=( "--basedir=${EPREFIX}/usr" ${options} "--datadir=${ROOT}/${MY_DATADIR}" "--tmpdir=${ROOT}/${MYSQL_TMPDIR}" )
|
||||
einfo "Command: ${cmd[*]}"
|
||||
su -s /bin/sh -c "${cmd[*]}" mysql \
|
||||
>"${TMPDIR}"/mysql_install_db.log 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
grep -B5 -A999 -i "ERROR" "${TMPDIR}"/mysql_install_db.log 1>&2
|
||||
die "Failed to initialize mysqld. Please review ${EPREFIX}/var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log"
|
||||
fi
|
||||
popd &>/dev/null || die
|
||||
[[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \
|
||||
|| die "MySQL databases not installed"
|
||||
|
||||
if [[ -z ${sqltmp} && -z ${MYSQL_ROOT_PASSWORD} ]] ; then
|
||||
einfo "Done"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
use prefix || options="${options} --user=mysql"
|
||||
|
||||
local socket="${EROOT}/var/run/mysqld/mysqld${RANDOM}.sock"
|
||||
local pidfile="${EROOT}/var/run/mysqld/mysqld${RANDOM}.pid"
|
||||
local mysqld="${EROOT}/usr/sbin/mysqld \
|
||||
${options} \
|
||||
--log-warnings=0 \
|
||||
--basedir=${EROOT}/usr \
|
||||
--datadir=${ROOT}/${MY_DATADIR} \
|
||||
--max_allowed_packet=8M \
|
||||
--net_buffer_length=16K \
|
||||
--socket=${socket} \
|
||||
--pid-file=${pidfile} \
|
||||
--tmpdir=${ROOT}/${MYSQL_TMPDIR}"
|
||||
#einfo "About to start mysqld: ${mysqld}"
|
||||
ebegin "Starting mysqld"
|
||||
einfo "Command ${mysqld}"
|
||||
${mysqld} &
|
||||
rc=$?
|
||||
while ! [[ -S "${socket}" || "${maxtry}" -lt 1 ]] ; do
|
||||
maxtry=$((${maxtry}-1))
|
||||
echo -n "."
|
||||
sleep 1
|
||||
done
|
||||
eend $rc
|
||||
|
||||
[[ -S "${socket}" ]] ||
|
||||
die "Completely failed to start up mysqld with: ${mysqld}"
|
||||
|
||||
if [[ -n "${MYSQL_ROOT_PASSWORD}" ]] ; then
|
||||
ebegin "Setting root password"
|
||||
# Do this from memory, as we don't want clear text passwords in temp files
|
||||
local sql="SET PASSWORD FOR 'root'@'localhost' = PASSWORD('${MYSQL_ROOT_PASSWORD}')"
|
||||
"${EROOT}/usr/bin/mysql" \
|
||||
"--socket=${socket}" \
|
||||
-hlocalhost \
|
||||
-e "${sql}"
|
||||
unset sql
|
||||
eend $?
|
||||
fi
|
||||
|
||||
if [[ -n "${sqltmp}" ]] ; then
|
||||
ebegin "Loading \"zoneinfo\", this step may require a few seconds"
|
||||
"${EROOT}/usr/bin/mysql" \
|
||||
"--socket=${socket}" \
|
||||
-hlocalhost \
|
||||
-uroot \
|
||||
--password="${MYSQL_ROOT_PASSWORD}" \
|
||||
mysql < "${sqltmp}"
|
||||
rc=$?
|
||||
eend $?
|
||||
[[ $rc -ne 0 ]] && ewarn "Failed to load zoneinfo!"
|
||||
fi
|
||||
|
||||
# Stop the server and cleanup
|
||||
einfo "Stopping the server ..."
|
||||
kill $(< "${pidfile}" )
|
||||
rm -f "${sqltmp}"
|
||||
wait %1
|
||||
einfo "Done"
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
DIST pgbadger-10.0.tar.gz 775322 BLAKE2B 072a3b4c2d2d109734fdbf68ff466e34065a852948ae7961e8ba6a40a6881a98653258ee7b483c2a3c9d2d8238370fd842c9b525a0dd11baf1fbf98a0d322406 SHA512 dd1633f1186069a9d59d271cbf0913cf80bcfa88af8236a194f7580c96c84a3513ca0658628069b38ef43a9c9ca7c5573afb2b35e2b1b6d3526f240c2c673bff
|
||||
DIST pgbadger-10.3.tar.gz 1645573 BLAKE2B 583ad35f416b6d989996ae48500dcee5734bc4867095abe1eb49be971c6190cf68dd4e127a47163c8ee49400cdf2fcee14645c98f4853b6f66c2bef0db0b83e4 SHA512 f8aac47d92ddb92292c572c47d6d32f1aa673b972b2488eede7fbe0b55feddc6ce0cb1b58994e83b93a5f84fcb5b871c7c080863d17554810cc1c1b8c1e1609a
|
||||
EBUILD pgbadger-10.0.ebuild 432 BLAKE2B 42ab8eb5952d04d2ab5ed39ab016c9849821f3e814173a3b7310cd4eeb7f9a1865de5fc332ffa05b7c51c1891881e01157f8011840a4c9478fc3a35e54741b07 SHA512 dd2a897d1741130a35049959bfe636bd522d96fd19ccb447e44f77bcc5ae3b854ab02bee64065992cb3ed4327de3d3f21aa74cb8422f430f4f947f2653a566b4
|
||||
EBUILD pgbadger-10.3.ebuild 455 BLAKE2B 3c335bdb99af786159c5291af9aaa48791b9ce7005d43a998457eb899cfcc7eaca8a97d165c20c864614b03b59b6638aea2fb04f41c3b18bc06135def2fe362c SHA512 7a6fa03a5f344974c9b6ade8e7c3336fbf71ec8b09f55501ab8143419bba8039c06ca7bb2004327deda7e9c6fcf28c7aa712ed16724b396a122028a633f098fb
|
||||
MISC metadata.xml 413 BLAKE2B 9b4f24620b42d2cf5befbaed7d52ed2e03d4619ebb547d36e207a900fe481a825a5be0a6fac073d7b278076ced053ae9a3c4b5d05597e5fb4d7ea66c1bff7988 SHA512 6bf32dc50ecd2d51d450413500b00773177109ab3ad26d74b458ec902973fa38542dbc65e65fbbe103b4be63589f61c2b9a6ab6ea5492b1954142afc5c2f8f93
|
||||
|
@ -0,0 +1,24 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
inherit perl-module
|
||||
|
||||
DESCRIPTION="pgBadger is a PostgreSQL log analyzer."
|
||||
HOMEPAGE="https://pgbadger.darold.net/"
|
||||
SRC_URI="https://github.com/darold/pgbadger/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
|
||||
DEPEND="
|
||||
dev-perl/JSON-XS
|
||||
dev-perl/Text-CSV_XS
|
||||
"
|
||||
RDEPEND="${DEPEND}"
|
||||
|
||||
src_test() {
|
||||
prove || die
|
||||
}
|
@ -0,0 +1,466 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
|
||||
zh_TW"
|
||||
|
||||
inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
|
||||
systemd user
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||
|
||||
SLOT=$(ver_cut 1)
|
||||
|
||||
MY_PV=${PV/_/}
|
||||
S="${WORKDIR}/${PN}-${MY_PV}"
|
||||
|
||||
SRC_URI="mirror://postgresql/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 libressl 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
|
||||
sys-apps/less
|
||||
virtual/libintl
|
||||
icu? ( dev-libs/icu:= )
|
||||
kerberos? ( virtual/krb5 )
|
||||
ldap? ( net-nds/openldap )
|
||||
pam? ( virtual/pam )
|
||||
perl? ( >=dev-lang/perl-5.8:= )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
readline? ( sys-libs/readline:0= )
|
||||
server? ( systemd? ( sys-apps/systemd ) )
|
||||
ssl? (
|
||||
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
)
|
||||
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-apps/sandbox-2.0
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
nls? ( sys-devel/gettext )
|
||||
xml? ( virtual/pkgconfig )
|
||||
"
|
||||
|
||||
RDEPEND="${CDEPEND}
|
||||
!dev-db/postgresql-docs:${SLOT}
|
||||
!dev-db/postgresql-base:${SLOT}
|
||||
!dev-db/postgresql-server:${SLOT}
|
||||
selinux? ( sec-policy/selinux-postgresql )
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
|
||||
|
||||
enewgroup postgres 70
|
||||
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
|
||||
|
||||
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
|
||||
|
||||
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}" \
|
||||
--docdir="${PO}/usr/share/doc/${PF}" \
|
||||
--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 nls "'$(l10n_get_locales)'")
|
||||
}
|
||||
|
||||
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
|
||||
systemd_newtmpfilesd "${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 && systemd_tmpfiles_create ${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
|
||||
}
|
@ -0,0 +1,468 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
|
||||
zh_TW"
|
||||
|
||||
inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
|
||||
systemd user
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
||||
|
||||
SLOT=$(ver_cut 1)
|
||||
|
||||
MY_PV=${PV/_/}
|
||||
S="${WORKDIR}/${PN}-${MY_PV}"
|
||||
|
||||
SRC_URI="mirror://postgresql/source/v${SLOT}/postgresql-${MY_PV}.tar.bz2"
|
||||
|
||||
LICENSE="POSTGRESQL GPL-2"
|
||||
DESCRIPTION="PostgreSQL RDBMS"
|
||||
HOMEPAGE="http://www.postgresql.org/"
|
||||
|
||||
IUSE="debug doc icu kerberos kernel_linux ldap libressl llvm nls pam
|
||||
perl python +readline selinux +server systemd ssl static-libs tcl
|
||||
threads uuid xml zlib"
|
||||
|
||||
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
|
||||
|
||||
CDEPEND="
|
||||
>=app-eselect/eselect-postgresql-2.0
|
||||
sys-apps/less
|
||||
virtual/libintl
|
||||
icu? ( dev-libs/icu:= )
|
||||
kerberos? ( virtual/krb5 )
|
||||
ldap? ( net-nds/openldap )
|
||||
llvm? (
|
||||
sys-devel/llvm:=
|
||||
sys-devel/clang:=
|
||||
)
|
||||
pam? ( virtual/pam )
|
||||
perl? ( >=dev-lang/perl-5.8:= )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
readline? ( sys-libs/readline:0= )
|
||||
server? ( systemd? ( sys-apps/systemd ) )
|
||||
ssl? (
|
||||
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
)
|
||||
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-apps/sandbox-2.0
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
nls? ( sys-devel/gettext )
|
||||
xml? ( virtual/pkgconfig )
|
||||
"
|
||||
|
||||
RDEPEND="${CDEPEND}
|
||||
!dev-db/postgresql-docs:${SLOT}
|
||||
!dev-db/postgresql-base:${SLOT}
|
||||
!dev-db/postgresql-server:${SLOT}
|
||||
selinux? ( sec-policy/selinux-postgresql )
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
|
||||
|
||||
enewgroup postgres 70
|
||||
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
|
||||
|
||||
use python && python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
# Set proper run directory
|
||||
sed "s|\(PGSOCKET_DIR\s\+\)\"/tmp\"|\1\"${EPREFIX}/run/postgresql\"|" \
|
||||
-i src/include/pg_config_manual.h || die
|
||||
|
||||
# Rely on $PATH being in the proper order so that the correct
|
||||
# install program is used for modules utilizing PGXS in both
|
||||
# hardened and non-hardened environments. (Bug #528786)
|
||||
sed 's/@install_bin@/install -c/' -i src/Makefile.global.in || die
|
||||
|
||||
use server || eapply "${FILESDIR}/${PN}-11_beta1-no-server.patch"
|
||||
|
||||
if use pam ; then
|
||||
sed "s/\(#define PGSQL_PAM_SERVICE \"postgresql\)/\1-${SLOT}/" \
|
||||
-i src/backend/libpq/auth.c || \
|
||||
die 'PGSQL_PAM_SERVICE rename failed.'
|
||||
fi
|
||||
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
case ${CHOST} in
|
||||
*-darwin*|*-solaris*)
|
||||
use nls && append-libs intl
|
||||
;;
|
||||
esac
|
||||
|
||||
export LDFLAGS_SL="${LDFLAGS}"
|
||||
export LDFLAGS_EX="${LDFLAGS}"
|
||||
|
||||
local PO="${EPREFIX%/}"
|
||||
|
||||
local i uuid_config=""
|
||||
if use uuid; then
|
||||
for i in ${UTIL_LINUX_LIBC[@]}; do
|
||||
use ${i} && uuid_config="--with-uuid=e2fs"
|
||||
done
|
||||
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}" \
|
||||
--docdir="${PO}/usr/share/doc/${PF}" \
|
||||
--includedir="${PO}/usr/include/postgresql-${SLOT}" \
|
||||
--mandir="${PO}/usr/share/postgresql-${SLOT}/man" \
|
||||
--sysconfdir="${PO}/etc/postgresql-${SLOT}" \
|
||||
--with-system-tzdata="${PO}/usr/share/zoneinfo" \
|
||||
$(use_enable !alpha spinlocks) \
|
||||
$(use_enable debug) \
|
||||
$(use_enable threads thread-safety) \
|
||||
$(use_with icu) \
|
||||
$(use_with kerberos gssapi) \
|
||||
$(use_with ldap) \
|
||||
$(use_with llvm) \
|
||||
$(use_with pam) \
|
||||
$(use_with perl) \
|
||||
$(use_with python) \
|
||||
$(use_with readline) \
|
||||
$(use_with ssl openssl) \
|
||||
$(usex server "$(use_with systemd)" '--without-systemd') \
|
||||
$(use_with tcl) \
|
||||
${uuid_config} \
|
||||
$(use_with xml libxml) \
|
||||
$(use_with xml libxslt) \
|
||||
$(use_with zlib) \
|
||||
$(use_enable nls nls "'$(l10n_get_locales)'")
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake
|
||||
emake -C contrib
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake DESTDIR="${D}" install
|
||||
emake DESTDIR="${D}" install -C contrib
|
||||
|
||||
dodoc README HISTORY
|
||||
|
||||
# man pages are already built, but if we have the target make them,
|
||||
# they'll be generated from source before being installed so we
|
||||
# manually install man pages.
|
||||
# We use ${SLOT} instead of doman for postgresql.eselect
|
||||
insinto /usr/share/postgresql-${SLOT}/man/
|
||||
doins -r doc/src/sgml/man{1,3,7}
|
||||
if ! use server; then
|
||||
# Remove man pages for non-existent binaries
|
||||
serverman=(
|
||||
initdb
|
||||
pg_{archivecleanup,controldata,ctl,resetwal,rewind,standby}
|
||||
pg_{test_{fsync,timing},upgrade,waldump}
|
||||
post{gres,master}
|
||||
)
|
||||
for m in ${serverman[@]} ; do
|
||||
rm "${ED}/usr/share/postgresql-${SLOT}/man/man1/${m}.1"
|
||||
done
|
||||
fi
|
||||
docompress /usr/share/postgresql-${SLOT}/man/man{1,3,7}
|
||||
|
||||
# Create slot specific man pages
|
||||
local bn f mansec slotted_name
|
||||
for mansec in 1 3 7 ; do
|
||||
local rel_manpath="../../postgresql-${SLOT}/man/man${mansec}"
|
||||
|
||||
mkdir -p "${ED}"/usr/share/man/man${mansec} || die "making man dir"
|
||||
pushd "${ED}"/usr/share/man/man${mansec} > /dev/null || die "pushd failed"
|
||||
|
||||
for f in "${ED}/usr/share/postgresql-${SLOT}/man/man${mansec}"/* ; do
|
||||
bn=$(basename "${f}")
|
||||
slotted_name=${bn%.${mansec}}${SLOT}.${mansec}
|
||||
case ${bn} in
|
||||
TABLE.7|WITH.7)
|
||||
echo ".so ${rel_manpath}/SELECT.7" > ${slotted_name}
|
||||
;;
|
||||
*)
|
||||
echo ".so ${rel_manpath}/${bn}" > ${slotted_name}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
insinto /etc/postgresql-${SLOT}
|
||||
newins src/bin/psql/psqlrc.sample psqlrc
|
||||
|
||||
# Don't delete libpg{port,common}.a (Bug #571046). They're always
|
||||
# needed by extensions utilizing PGXS.
|
||||
use static-libs || \
|
||||
find "${ED}" -name '*.a' ! -name libpgport.a ! -name libpgcommon.a \
|
||||
-delete
|
||||
|
||||
# Make slot specific links to programs
|
||||
local f bn
|
||||
for f in $(find "${ED}/usr/$(get_libdir)/postgresql-${SLOT}/bin" \
|
||||
-mindepth 1 -maxdepth 1)
|
||||
do
|
||||
bn=$(basename "${f}")
|
||||
dosym "../$(get_libdir)/postgresql-${SLOT}/bin/${bn}" \
|
||||
"/usr/bin/${bn}${SLOT/.}"
|
||||
done
|
||||
|
||||
if use doc ; then
|
||||
docinto html
|
||||
dodoc doc/src/sgml/html/*
|
||||
fi
|
||||
|
||||
if use server; then
|
||||
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
|
||||
"${FILESDIR}/${PN}.confd-9.3" | newconfd - ${PN}-${SLOT}
|
||||
|
||||
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
|
||||
"${FILESDIR}/${PN}.init-9.3-r1" | newinitd - ${PN}-${SLOT}
|
||||
|
||||
if use systemd; then
|
||||
sed -e "s|@SLOT@|${SLOT}|g" -e "s|@LIBDIR@|$(get_libdir)|g" \
|
||||
"${FILESDIR}/${PN}.service-9.6-r1" | \
|
||||
systemd_newunit - ${PN}-${SLOT}.service
|
||||
newbin "${FILESDIR}"/${PN}-check-db-dir ${PN}-${SLOT}-check-db-dir
|
||||
systemd_newtmpfilesd "${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 && systemd_tmpfiles_create ${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 "http://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 " http://www.postgresql.org/docs/${SLOT}/static/creating-cluster.html"
|
||||
einfo " http://www.postgresql.org/docs/${SLOT}/static/app-initdb.html"
|
||||
einfo
|
||||
einfo "PG_INITDB_OPTS is currently set to:"
|
||||
if [[ -z "${PG_INITDB_OPTS}" ]] ; then
|
||||
einfo " (none)"
|
||||
else
|
||||
einfo " ${PG_INITDB_OPTS}"
|
||||
fi
|
||||
einfo
|
||||
einfo "Configuration files will be installed to:"
|
||||
einfo " ${PGDATA}"
|
||||
einfo
|
||||
einfo "The database cluster will be created in:"
|
||||
einfo " ${DATA_DIR}"
|
||||
einfo
|
||||
|
||||
ebegin "Continuing initialization in 5 seconds (Control-C to cancel)"
|
||||
sleep 5
|
||||
eend 0
|
||||
|
||||
if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then
|
||||
eerror "The given directory, '${DATA_DIR}', is not empty."
|
||||
eerror "Modify DATA_DIR to point to an empty directory."
|
||||
die "${DATA_DIR} is not empty."
|
||||
fi
|
||||
|
||||
einfo "Creating the data directory ..."
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
mkdir -p "$(dirname ${DATA_DIR%/})" || die "Couldn't parent dirs"
|
||||
mkdir -m 0700 "${DATA_DIR%/}" || die "Couldn't make DATA_DIR"
|
||||
chown -h postgres:postgres "${DATA_DIR%/}" || die "Couldn't chown"
|
||||
fi
|
||||
|
||||
einfo "Initializing the database ..."
|
||||
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
su postgres -c "${EROOT%/}/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -D \"${DATA_DIR}\" ${PG_INITDB_OPTS}"
|
||||
else
|
||||
"${EROOT%/}"/usr/$(get_libdir)/postgresql-${SLOT}/bin/initdb -U postgres -D "${DATA_DIR}" ${PG_INITDB_OPTS}
|
||||
fi
|
||||
|
||||
if [[ "${DATA_DIR%/}" != "${PGDATA%/}" ]] ; then
|
||||
mv "${DATA_DIR%/}"/{pg_{hba,ident},postgresql}.conf "${PGDATA}"
|
||||
ln -s "${PGDATA%/}"/{pg_{hba,ident},postgresql}.conf "${DATA_DIR%/}"
|
||||
fi
|
||||
|
||||
# unix_socket_directory has no effect in postgresql.conf as it's
|
||||
# overridden in the initscript
|
||||
sed '/^#unix_socket_directories/,+1d' -i "${PGDATA%/}"/postgresql.conf
|
||||
|
||||
cat <<- EOF >> "${PGDATA%/}"/postgresql.conf
|
||||
# This is here because of https://bugs.gentoo.org/show_bug.cgi?id=518522
|
||||
# On the off-chance that you might need to work with UTF-8 encoded
|
||||
# characters in PL/Perl
|
||||
plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
|
||||
EOF
|
||||
|
||||
einfo "The autovacuum function, which was in contrib, has been moved to the main"
|
||||
einfo "PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled"
|
||||
einfo "by default. You can disable it in the cluster's:"
|
||||
einfo " ${PGDATA%/}/postgresql.conf"
|
||||
einfo
|
||||
if ! use systemd; then
|
||||
einfo "The PostgreSQL server, by default, will log events to:"
|
||||
einfo " ${DATA_DIR%/}/postmaster.log"
|
||||
einfo
|
||||
fi
|
||||
if use prefix ; then
|
||||
einfo "The location of the configuration files have moved to:"
|
||||
einfo " ${PGDATA}"
|
||||
einfo "To start the server:"
|
||||
einfo " pg_ctl start -D ${DATA_DIR} -o '-D ${PGDATA} --data-directory=${DATA_DIR}'"
|
||||
einfo "To stop:"
|
||||
einfo " pg_ctl stop -D ${DATA_DIR}"
|
||||
einfo
|
||||
einfo "Or move the configuration files back:"
|
||||
einfo "mv ${PGDATA}*.conf ${DATA_DIR}"
|
||||
elif use systemd; then
|
||||
einfo "You should use the 'postgresql-${SLOT}.service' unit to run PostgreSQL"
|
||||
einfo "instead of 'pg_ctl'."
|
||||
else
|
||||
einfo "You should use the '${EROOT%/}/etc/init.d/postgresql-${SLOT}' script to run PostgreSQL"
|
||||
einfo "instead of 'pg_ctl'."
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
if use server && [[ ${UID} -ne 0 ]] ; then
|
||||
emake check
|
||||
|
||||
einfo "If you think other tests besides the regression tests are necessary, please"
|
||||
einfo "submit a bug including a patch for this ebuild to enable them."
|
||||
else
|
||||
use server || \
|
||||
ewarn 'Tests cannot be run without the "server" use flag enabled.'
|
||||
[[ ${UID} -eq 0 ]] || \
|
||||
ewarn 'Tests cannot be run as root. Enable "userpriv" in FEATURES.'
|
||||
|
||||
ewarn 'Skipping.'
|
||||
fi
|
||||
}
|
@ -0,0 +1,480 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
|
||||
zh_TW"
|
||||
|
||||
inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
|
||||
systemd user
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||
|
||||
SLOT=$(ver_cut 1-2)
|
||||
|
||||
SRC_URI="mirror://postgresql/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 libressl 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
|
||||
sys-apps/less
|
||||
virtual/libintl
|
||||
kerberos? ( virtual/krb5 )
|
||||
ldap? ( net-nds/openldap )
|
||||
pam? ( virtual/pam )
|
||||
perl? ( >=dev-lang/perl-5.8:= )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
readline? ( sys-libs/readline:0= )
|
||||
ssl? (
|
||||
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
)
|
||||
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-apps/sandbox-2.0
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
nls? ( sys-devel/gettext )
|
||||
xml? ( virtual/pkgconfig )
|
||||
"
|
||||
|
||||
RDEPEND="${CDEPEND}
|
||||
!dev-db/postgresql-docs:${SLOT}
|
||||
!dev-db/postgresql-base:${SLOT}
|
||||
!dev-db/postgresql-server:${SLOT}
|
||||
selinux? ( sec-policy/selinux-postgresql )
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
|
||||
|
||||
enewgroup postgres 70
|
||||
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
|
||||
|
||||
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.4.10-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}" \
|
||||
--docdir="${PO}/usr/share/doc/${PF}" \
|
||||
--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 !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 nls "'$(l10n_get_locales)'")
|
||||
}
|
||||
|
||||
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
|
||||
systemd_newtmpfilesd "${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 && systemd_tmpfiles_create ${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
|
||||
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
|
||||
}
|
@ -0,0 +1,486 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
|
||||
zh_TW"
|
||||
|
||||
inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
|
||||
systemd user
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x86-solaris"
|
||||
|
||||
SLOT=$(ver_cut 1-2)
|
||||
|
||||
SRC_URI="mirror://postgresql/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 libressl 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
|
||||
sys-apps/less
|
||||
virtual/libintl
|
||||
kerberos? ( virtual/krb5 )
|
||||
ldap? ( net-nds/openldap )
|
||||
pam? ( virtual/pam )
|
||||
perl? ( >=dev-lang/perl-5.8:= )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
readline? ( sys-libs/readline:0= )
|
||||
ssl? (
|
||||
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
)
|
||||
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-apps/sandbox-2.0
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
nls? ( sys-devel/gettext )
|
||||
xml? ( virtual/pkgconfig )
|
||||
"
|
||||
|
||||
RDEPEND="${CDEPEND}
|
||||
!dev-db/postgresql-docs:${SLOT}
|
||||
!dev-db/postgresql-base:${SLOT}
|
||||
!dev-db/postgresql-server:${SLOT}
|
||||
selinux? ( sec-policy/selinux-postgresql )
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
|
||||
|
||||
enewgroup postgres 70
|
||||
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
|
||||
|
||||
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}" \
|
||||
--docdir="${PO}/usr/share/doc/${PF}" \
|
||||
--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 nls "'$(l10n_get_locales)'")
|
||||
}
|
||||
|
||||
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
|
||||
systemd_newtmpfilesd "${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 && systemd_tmpfiles_create ${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
|
||||
}
|
@ -0,0 +1,491 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
|
||||
|
||||
PLOCALES="af cs de en es fa fr hr hu it ko nb pl pt_BR ro ru sk sl sv tr zh_CN
|
||||
zh_TW"
|
||||
|
||||
inherit flag-o-matic l10n linux-info multilib pam prefix python-single-r1 \
|
||||
systemd user
|
||||
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
|
||||
|
||||
SLOT=$(ver_cut 1-2)
|
||||
|
||||
MY_PV=${PV/_/}
|
||||
S="${WORKDIR}/${PN}-${MY_PV}"
|
||||
|
||||
SRC_URI="mirror://postgresql/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 libressl 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
|
||||
sys-apps/less
|
||||
virtual/libintl
|
||||
kerberos? ( virtual/krb5 )
|
||||
ldap? ( net-nds/openldap )
|
||||
pam? ( virtual/pam )
|
||||
perl? ( >=dev-lang/perl-5.8:= )
|
||||
python? ( ${PYTHON_DEPS} )
|
||||
readline? ( sys-libs/readline:0= )
|
||||
ssl? (
|
||||
!libressl? ( >=dev-libs/openssl-0.9.6-r1:0= )
|
||||
libressl? ( dev-libs/libressl:= )
|
||||
)
|
||||
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-apps/sandbox-2.0
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
nls? ( sys-devel/gettext )
|
||||
xml? ( virtual/pkgconfig )
|
||||
"
|
||||
|
||||
RDEPEND="${CDEPEND}
|
||||
!dev-db/postgresql-docs:${SLOT}
|
||||
!dev-db/postgresql-base:${SLOT}
|
||||
!dev-db/postgresql-server:${SLOT}
|
||||
selinux? ( sec-policy/selinux-postgresql )
|
||||
"
|
||||
|
||||
pkg_setup() {
|
||||
use server && CONFIG_CHECK="~SYSVIPC" linux-info_pkg_setup
|
||||
|
||||
enewgroup postgres 70
|
||||
enewuser postgres 70 /bin/sh /var/lib/postgresql postgres
|
||||
|
||||
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}" \
|
||||
--docdir="${PO}/usr/share/doc/${PF}" \
|
||||
--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 nls "'$(l10n_get_locales)'")
|
||||
}
|
||||
|
||||
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
|
||||
systemd_newtmpfilesd "${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 && systemd_tmpfiles_create ${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
|
||||
}
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,45 @@
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI="7"
|
||||
|
||||
RESTRICT="test" # needs some pointy sticks. Seriously.
|
||||
PYTHON_COMPAT=(python{2_7,3_5,3_6})
|
||||
|
||||
inherit distutils-r1 eutils
|
||||
DESCRIPTION="A LISP dialect running in python"
|
||||
HOMEPAGE="http://hylang.org/"
|
||||
SRC_URI="https://github.com/hylang/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="test doc"
|
||||
|
||||
RDEPEND=">=dev-python/astor-0.7.1[${PYTHON_USEDEP}]
|
||||
>=dev-python/clint-0.4[${PYTHON_USEDEP}]
|
||||
dev-python/flake8[${PYTHON_USEDEP}]
|
||||
>=dev-python/funcparserlib-0.3.6[${PYTHON_USEDEP}]
|
||||
>=dev-python/rply-0.7.6[${PYTHON_USEDEP}]
|
||||
"
|
||||
DEPEND="${RDEPEND}
|
||||
doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
|
||||
test? (
|
||||
dev-python/nose[${PYTHON_USEDEP}]
|
||||
dev-python/sphinx[${PYTHON_USEDEP}]
|
||||
)"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${PN}-0.15.0-do-not-install-get_version.py.patch )
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
use doc && HTML_DOCS=( docs/_build/html/. )
|
||||
}
|
||||
|
||||
python_compile_all() {
|
||||
use doc && emake docs
|
||||
}
|
||||
|
||||
python_test() {
|
||||
nosetests -vv || die "Tests failed under ${EPYTHON}"
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue