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

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

CRATES="
	actix-codec@0.5.2
	actix-cors@0.7.1
	actix-http@3.11.1
	actix-macros@0.2.4
	actix-router@0.5.3
	actix-rt@2.11.0
	actix-server@2.6.0
	actix-service@2.0.3
	actix-tls@3.4.0
	actix-utils@3.0.1
	actix-web-codegen@4.3.0
	actix-web@4.11.0
	addr2line@0.25.1
	adler2@2.0.1
	aho-corasick@1.1.3
	alloc-no-stdlib@2.0.4
	alloc-stdlib@0.2.2
	anstream@0.6.21
	anstyle-parse@0.2.7
	anstyle-query@1.1.4
	anstyle-wincon@3.0.10
	anstyle@1.0.13
	anyhow@1.0.100
	atomic-waker@1.1.2
	autocfg@1.5.0
	backtrace@0.3.76
	base64@0.22.1
	bitflags@1.3.2
	bitflags@2.9.4
	block-buffer@0.10.4
	brotli-decompressor@5.0.0
	brotli@8.0.2
	bumpalo@3.19.0
	bytes@1.10.1
	bytestring@1.5.0
	cc@1.2.40
	cfg-if@1.0.3
	cfg_aliases@0.2.1
	clap@4.5.48
	clap_builder@4.5.48
	clap_derive@4.5.47
	clap_lex@0.7.5
	colorchoice@1.0.4
	cookie@0.16.2
	cpufeatures@0.2.17
	crc32fast@1.5.0
	crypto-common@0.1.6
	daemonizr@0.1.6
	deranged@0.5.4
	derive_more-impl@2.0.1
	derive_more@2.0.1
	digest@0.10.7
	dirs-sys@0.5.0
	dirs@6.0.0
	displaydoc@0.2.5
	encoding_rs@0.8.35
	env_filter@0.1.3
	env_logger@0.11.8
	equivalent@1.0.2
	find-msvc-tools@0.1.3
	flate2@1.1.2
	fnv@1.0.7
	foldhash@0.1.5
	form_urlencoded@1.2.2
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-io@0.3.31
	futures-macro@0.3.31
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	generic-array@0.14.7
	getrandom@0.2.16
	getrandom@0.3.3
	gimli@0.32.3
	h2@0.3.27
	hashbrown@0.16.0
	heck@0.5.0
	http-body-util@0.1.3
	http-body@1.0.1
	http@0.2.12
	http@1.3.1
	httparse@1.10.1
	httpdate@1.0.3
	hyper-rustls@0.27.7
	hyper-util@0.1.17
	hyper@1.7.0
	icu_collections@2.0.0
	icu_locale_core@2.0.0
	icu_normalizer@2.0.0
	icu_normalizer_data@2.0.0
	icu_properties@2.0.1
	icu_properties_data@2.0.1
	icu_provider@2.0.0
	idna@1.1.0
	idna_adapter@1.2.1
	impl-more@0.1.9
	indexmap@2.11.4
	io-uring@0.7.10
	ipnet@2.11.0
	iri-string@0.7.8
	is_terminal_polyfill@1.70.1
	itoa@1.0.15
	jiff-static@0.2.15
	jiff@0.2.15
	jobserver@0.1.34
	js-sys@0.3.81
	language-tags@0.3.2
	libc@0.2.176
	libredox@0.1.10
	litemap@0.8.0
	local-channel@0.1.5
	local-waker@0.1.4
	lock_api@0.4.13
	log@0.4.28
	lru-slab@0.1.2
	memchr@2.7.6
	memoffset@0.7.1
	mime@0.3.17
	miniz_oxide@0.8.9
	mio@1.0.4
	nix@0.26.4
	num-conv@0.1.0
	object@0.37.3
	once_cell@1.21.3
	once_cell_polyfill@1.70.1
	option-ext@0.2.0
	parking_lot@0.12.4
	parking_lot_core@0.9.11
	pem@3.0.5
	percent-encoding@2.3.2
	pin-project-lite@0.2.16
	pin-utils@0.1.0
	pkg-config@0.3.32
	portable-atomic-util@0.2.4
	portable-atomic@1.11.1
	potential_utf@0.1.3
	powerfmt@0.2.0
	ppv-lite86@0.2.21
	proc-macro2@1.0.101
	quinn-proto@0.11.12
	quinn-udp@0.5.13
	quinn@0.11.8
	quote@1.0.41
	r-efi@5.3.0
	rand@0.9.2
	rand_chacha@0.9.0
	rand_core@0.9.3
	rcgen@0.14.5
	redox_syscall@0.5.17
	redox_users@0.5.2
	regex-automata@0.4.11
	regex-lite@0.1.7
	regex-syntax@0.8.6
	regex@1.11.3
	reqwest@0.12.23
	ring@0.17.14
	rustc-demangle@0.1.26
	rustc-hash@2.1.1
	rustls-pemfile@2.2.0
	rustls-pki-types@1.12.0
	rustls-webpki@0.103.7
	rustls@0.23.32
	rustversion@1.0.22
	ryu@1.0.20
	scopeguard@1.2.0
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.145
	serde_urlencoded@0.7.1
	sha1@0.10.6
	shlex@1.3.0
	signal-hook-registry@1.4.6
	slab@0.4.11
	smallvec@1.15.1
	socket2@0.5.10
	socket2@0.6.0
	stable_deref_trait@1.2.0
	strsim@0.11.1
	subtle@2.6.1
	syn@2.0.106
	sync_wrapper@1.0.2
	synstructure@0.13.2
	thiserror-impl@2.0.17
	thiserror@2.0.17
	time-core@0.1.6
	time-macros@0.2.24
	time@0.3.44
	tinystr@0.8.1
	tinyvec@1.9.0
	tinyvec_macros@0.1.1
	tokio-macros@2.5.0
	tokio-rustls@0.26.4
	tokio-stream@0.1.17
	tokio-util@0.7.16
	tokio@1.47.1
	tower-http@0.6.6
	tower-layer@0.3.3
	tower-service@0.3.3
	tower@0.5.2
	tracing-attributes@0.1.30
	tracing-core@0.1.34
	tracing@0.1.41
	try-lock@0.2.5
	typenum@1.19.0
	unicode-ident@1.0.19
	unicode-xid@0.2.6
	untrusted@0.9.0
	url@2.5.7
	utf8_iter@1.0.4
	utf8parse@0.2.2
	version_check@0.9.5
	want@0.3.1
	wasi@0.11.1+wasi-snapshot-preview1
	wasi@0.14.7+wasi-0.2.4
	wasip2@1.0.1+wasi-0.2.4
	wasm-bindgen-backend@0.2.104
	wasm-bindgen-futures@0.4.54
	wasm-bindgen-macro-support@0.2.104
	wasm-bindgen-macro@0.2.104
	wasm-bindgen-shared@0.2.104
	wasm-bindgen@0.2.104
	wasm-streams@0.4.2
	web-sys@0.3.81
	web-time@1.1.0
	webpki-roots@1.0.2
	windows-link@0.2.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-sys@0.60.2
	windows-sys@0.61.1
	windows-targets@0.52.6
	windows-targets@0.53.4
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.0
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.0
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.0
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.0
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.0
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.0
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.0
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.0
	wit-bindgen@0.46.0
	writeable@0.6.1
	yasna@0.5.2
	yoke-derive@0.8.0
	yoke@0.8.0
	zerocopy-derive@0.8.27
	zerocopy@0.8.27
	zerofrom-derive@0.1.6
	zerofrom@0.1.6
	zeroize@1.8.2
	zerotrie@0.2.2
	zerovec-derive@0.11.1
	zerovec@0.11.4
	zstd-safe@7.2.4
	zstd-sys@2.0.16+zstd.1.5.7
	zstd@0.13.3
"

inherit cargo

DESCRIPTION="Ollama over LAN - Auto-discover your Ollama server on your local network with hassle-free ease"
HOMEPAGE=""
SRC_URI="
	https://github.com/grouzen/ollana/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"

LICENSE="MIT"
# Dependent crate licenses
LICENSE+=" Apache-2.0 BSD MIT Unicode-3.0"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="
        acct-user/ollana
        acct-group/ollana
        "

RDEPEND="${DEPEND}"

src_install() {
	cargo_src_install

	elog "installing init services"
	newinitd "${FILESDIR}/ollana.initd" "ollana"
	newconfd "${FILESDIR}/ollana.confd" "ollana"
	systemd_dounit "${FILESDIR}/ollana.service"

	# Create log directory
	elog "creating /var/log/ollana directory"
    keepdir /var/log/ollana
    fowners ollana:ollana /var/log/ollana
    fperms 0750 /var/log/ollana
}

pkg_postinst() {
	elog "Logs will be written to /var/log/ollana/ollana.log"
	elog "You can change it by modifying /etc/conf.d/ollana"
}