# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

CRATES="
	addr2line@0.20.0
	adler@1.0.2
	ahash@0.8.3
	aho-corasick@1.0.2
	allocator-api2@0.2.16
	android-tzdata@0.1.1
	android_system_properties@0.1.5
	anstream@0.3.2
	anstyle-parse@0.2.1
	anstyle-query@1.0.0
	anstyle-wincon@1.0.1
	anstyle@1.0.1
	arc-swap@1.6.0
	async-stream-impl@0.3.5
	async-stream@0.3.5
	async-trait@0.1.71
	atomic-waker@1.1.2
	atomic_enum@0.2.0
	autocfg@1.1.0
	backtrace@0.3.68
	base64@0.21.2
	bb8@0.8.6
	bitflags@1.3.2
	bitflags@2.3.3
	block-buffer@0.10.4
	bumpalo@3.13.0
	bytecount@0.6.8
	byteorder@1.4.3
	bytes@1.4.0
	camino@1.1.9
	cargo-platform@0.1.8
	cargo_metadata@0.14.2
	cc@1.0.79
	cfg-if@1.0.0
	chrono@0.4.26
	clap@4.3.15
	clap_builder@4.3.15
	clap_derive@4.3.12
	clap_lex@0.5.0
	colorchoice@1.0.0
	core-foundation-sys@0.8.4
	cpufeatures@0.2.9
	crossbeam-channel@0.5.13
	crossbeam-utils@0.8.20
	crypto-common@0.1.6
	dashmap@5.5.3
	data-encoding@2.4.0
	digest@0.10.7
	either@1.8.1
	enum-as-inner@0.5.1
	equivalent@1.0.1
	errno-dragonfly@0.1.2
	errno@0.3.1
	error-chain@0.12.4
	exitcode@1.1.2
	fallible-iterator@0.2.0
	fastrand@2.1.1
	fnv@1.0.7
	form_urlencoded@1.2.0
	futures-channel@0.3.28
	futures-core@0.3.28
	futures-executor@0.3.28
	futures-io@0.3.28
	futures-macro@0.3.28
	futures-sink@0.3.28
	futures-task@0.3.28
	futures-util@0.3.28
	futures@0.3.28
	generic-array@0.14.7
	getrandom@0.2.10
	gimli@0.27.3
	glob@0.3.1
	h2@0.4.6
	hashbrown@0.14.0
	heck@0.4.1
	hermit-abi@0.3.2
	hmac@0.12.1
	hostname@0.3.1
	http-body-util@0.1.2
	http-body@1.0.1
	http@1.1.0
	httparse@1.8.0
	httpdate@1.0.2
	hyper-util@0.1.7
	hyper@1.4.1
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.57
	idna@0.2.3
	idna@0.4.0
	indexmap@2.0.0
	ipconfig@0.3.2
	ipnet@2.8.0
	is-terminal@0.4.9
	itertools@0.10.5
	itoa@1.0.9
	jemalloc-sys@0.5.3+5.3.0-patched
	jemallocator@0.5.0
	js-sys@0.3.64
	lazy_static@1.4.0
	libc@0.2.147
	linked-hash-map@0.5.6
	linux-raw-sys@0.4.3
	lock_api@0.4.10
	log@0.4.19
	lru-cache@0.1.2
	lru@0.12.0
	match_cfg@0.1.0
	matchers@0.1.0
	matches@0.1.10
	md-5@0.10.5
	memchr@2.5.0
	memoffset@0.7.1
	mini-moka@0.10.3
	miniz_oxide@0.7.1
	mio@0.8.8
	nix@0.26.2
	nu-ansi-term@0.46.0
	num-traits@0.2.15
	num_cpus@1.16.0
	object@0.31.1
	once_cell@1.20.2
	overload@0.1.1
	parking_lot@0.12.1
	parking_lot_core@0.9.8
	percent-encoding@2.3.0
	phf@0.11.2
	phf_generator@0.11.2
	phf_macros@0.11.2
	phf_shared@0.11.2
	pin-project-internal@1.1.2
	pin-project-lite@0.2.10
	pin-project@1.1.2
	pin-utils@0.1.0
	postgres-protocol@0.6.5
	ppv-lite86@0.2.17
	proc-macro2@1.0.89
	pulldown-cmark@0.9.6
	quick-error@1.2.3
	quote@1.0.37
	rand@0.8.5
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_syscall@0.3.5
	regex-automata@0.1.10
	regex-automata@0.3.3
	regex-syntax@0.6.29
	regex-syntax@0.7.4
	regex@1.9.1
	resolv-conf@0.7.0
	ring@0.16.20
	rustc-demangle@0.1.23
	rustix@0.38.4
	rustls-pemfile@1.0.3
	rustls-webpki@0.100.2
	rustls-webpki@0.101.1
	rustls@0.21.5
	ryu@1.0.15
	same-file@1.0.6
	scc@2.2.4
	scopeguard@1.2.0
	sct@0.7.0
	sdd@3.0.4
	semver@1.0.23
	serde@1.0.214
	serde_derive@1.0.214
	serde_json@1.0.103
	serde_spanned@0.6.3
	serial_test@3.1.1
	serial_test_derive@3.1.1
	sha-1@0.10.1
	sha2@0.10.7
	sharded-slab@0.1.4
	signal-hook-registry@1.4.1
	siphasher@0.3.10
	skeptic@0.13.7
	slab@0.4.8
	smallvec@1.13.2
	socket2@0.4.9
	socket2@0.5.3
	spin@0.5.2
	sqlparser@0.52.0
	sqlparser_derive@0.2.2
	static_assertions@1.1.0
	stringprep@0.1.3
	strsim@0.10.0
	subtle@2.5.0
	syn@1.0.109
	syn@2.0.87
	tagptr@0.2.0
	tempfile@3.8.0
	thiserror-impl@1.0.43
	thiserror@1.0.43
	thread_local@1.1.7
	time@0.1.45
	tinyvec@1.6.0
	tinyvec_macros@0.1.1
	tokio-macros@2.1.0
	tokio-rustls@0.24.1
	tokio-stream@0.1.14
	tokio-test@0.4.2
	tokio-util@0.7.8
	tokio@1.29.1
	toml@0.7.6
	toml_datetime@0.6.3
	toml_edit@0.19.14
	tracing-attributes@0.1.26
	tracing-core@0.1.31
	tracing-log@0.1.3
	tracing-serde@0.1.3
	tracing-subscriber@0.3.17
	tracing@0.1.37
	triomphe@0.1.11
	trust-dns-proto@0.22.0
	trust-dns-resolver@0.22.0
	try-lock@0.2.4
	typenum@1.16.0
	unicase@2.8.0
	unicode-bidi@0.3.13
	unicode-ident@1.0.11
	unicode-normalization@0.1.22
	untrusted@0.7.1
	url@2.4.0
	utf8parse@0.2.1
	valuable@0.1.0
	version_check@0.9.4
	walkdir@2.5.0
	want@0.3.1
	wasi@0.10.0+wasi-snapshot-preview1
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.87
	wasm-bindgen-macro-support@0.2.87
	wasm-bindgen-macro@0.2.87
	wasm-bindgen-shared@0.2.87
	wasm-bindgen@0.2.87
	web-sys@0.3.64
	webpki-roots@0.23.1
	widestring@1.0.2
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.9
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-sys@0.48.0
	windows-targets@0.48.1
	windows@0.48.0
	windows_aarch64_gnullvm@0.48.0
	windows_aarch64_msvc@0.48.0
	windows_i686_gnu@0.48.0
	windows_i686_msvc@0.48.0
	windows_x86_64_gnu@0.48.0
	windows_x86_64_gnullvm@0.48.0
	windows_x86_64_msvc@0.48.0
	winnow@0.5.0
	winreg@0.50.0
"

inherit cargo

_HASH="5b038813eb14f181434ab7b5509e74d9b1fe123b"

DESCRIPTION="PostgreSQL pooler with sharding, load balancing and failover support."
HOMEPAGE="https://github.com/postgresml/pgcat"
SRC_URI="
	https://github.com/postgresml/pgcat/archive/${_HASH}.zip -> ${P}.zip
	${CARGO_CRATE_URIS}
"
DEPEND="acct-user/pgcat"
S="${WORKDIR}/${PN}-${_HASH}"

LICENSE="all-rights-reserved"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD ISC MIT MPL-2.0 Unicode-DFS-2016"
SLOT="0"
KEYWORDS="amd64"

src_install() {
	default
	cargo_src_install
	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
	newinitd "${FILESDIR}/${PN}.initd" "${PN}"

	insinto /etc
	doins pgcat.toml
}