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

# Autogenerated by pycargoebuild 0.10

EAPI=8

CRATES="
	addr2line@0.20.0
	adler@1.0.2
	aho-corasick@1.0.2
	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
	anyhow@1.0.72
	async-compression@0.4.0
	async-io@1.13.0
	async-lock@2.7.0
	async-trait@0.1.71
	atty@0.2.14
	autocfg@1.1.0
	backtrace@0.3.68
	base64@0.13.1
	base64@0.21.2
	bitflags@1.3.2
	bitflags@2.3.3
	block-buffer@0.10.4
	bumpalo@3.13.0
	bytecount@0.6.3
	byteorder@1.4.3
	bytes@1.4.0
	camino@1.1.4
	cargo-platform@0.1.2
	cargo_metadata@0.14.2
	cc@1.0.79
	cfg-if@1.0.0
	checked_int_cast@1.0.0
	chrono@0.4.26
	clap@4.3.19
	clap_builder@4.3.19
	clap_derive@4.3.12
	clap_lex@0.5.0
	colorchoice@1.0.0
	concurrent-queue@2.2.0
	console@0.15.7
	cookie@0.16.2
	cookie_store@0.16.2
	core-foundation-sys@0.8.4
	core-foundation@0.9.3
	cpufeatures@0.2.9
	crc32fast@1.3.2
	crossbeam-channel@0.5.8
	crossbeam-epoch@0.9.15
	crossbeam-utils@0.8.16
	crossterm@0.25.0
	crossterm_winapi@0.9.1
	crypto-common@0.1.6
	dashmap@5.5.3
	dav-server@0.5.5
	digest@0.10.7
	dirs-sys@0.4.1
	dirs@5.0.1
	either@1.8.1
	encode_unicode@0.3.6
	encoding_rs@0.8.32
	errno-dragonfly@0.1.2
	errno@0.3.1
	error-chain@0.12.4
	event-listener@2.5.3
	fastrand@1.9.0
	filetime@0.2.21
	flate2@1.0.26
	fnv@1.0.7
	foreign-types-shared@0.1.1
	foreign-types@0.3.2
	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-lite@1.13.0
	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.3.20
	hashbrown@0.12.3
	hashbrown@0.14.0
	headers-core@0.2.0
	headers@0.3.8
	heck@0.4.1
	hermit-abi@0.1.19
	hermit-abi@0.3.2
	htmlescape@0.3.1
	http-body@0.4.5
	http@0.2.9
	httparse@1.8.0
	httpdate@1.0.2
	hyper-rustls@0.24.1
	hyper-tls@0.5.0
	hyper@0.14.27
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.57
	idna@0.2.3
	idna@0.3.0
	idna@0.4.0
	indexmap@1.9.3
	indicatif@0.17.5
	instant@0.1.12
	io-lifetimes@1.0.11
	ipnet@2.8.0
	is-terminal@0.4.8
	itoa@1.0.8
	js-sys@0.3.64
	lazy_static@1.4.0
	libc@0.2.147
	linux-raw-sys@0.3.8
	linux-raw-sys@0.4.3
	lock_api@0.4.10
	log@0.4.19
	matchers@0.1.0
	matches@0.1.10
	memchr@2.5.0
	memoffset@0.9.0
	mime@0.3.17
	mime_guess@2.0.4
	miniz_oxide@0.7.1
	mio@0.8.8
	moka@0.11.3
	native-tls@0.2.11
	nu-ansi-term@0.46.0
	num-traits@0.2.15
	num_cpus@1.16.0
	num_threads@0.1.6
	number_prefix@0.4.0
	object@0.31.1
	once_cell@1.18.0
	openssl-macros@0.1.1
	openssl-probe@0.1.5
	openssl-src@111.26.0+1.1.1u
	openssl-sys@0.9.90
	openssl@0.10.55
	option-ext@0.2.0
	overload@0.1.1
	parking@2.1.0
	parking_lot@0.11.2
	parking_lot@0.12.1
	parking_lot_core@0.8.6
	parking_lot_core@0.9.8
	path-slash@0.2.1
	percent-encoding@2.3.0
	pin-project-internal@1.1.2
	pin-project-lite@0.2.10
	pin-project@1.1.2
	pin-utils@0.1.0
	pkg-config@0.3.27
	polling@2.8.0
	portable-atomic@1.3.3
	ppv-lite86@0.2.17
	proc-macro2@1.0.63
	psl-types@2.0.11
	publicsuffix@2.2.3
	pulldown-cmark@0.9.3
	qr2term@0.3.1
	qrcode@0.12.0
	quick-xml@0.23.1
	quote@1.0.29
	rand@0.8.5
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_syscall@0.2.16
	redox_syscall@0.3.5
	redox_users@0.4.3
	regex-automata@0.1.10
	regex-automata@0.3.0
	regex-syntax@0.6.29
	regex-syntax@0.7.3
	regex@1.9.0
	reqwest-middleware@0.2.3
	reqwest-retry@0.2.2
	reqwest@0.11.20
	retry-policies@0.1.2
	ring@0.16.20
	rustc-demangle@0.1.23
	rustc_version@0.4.0
	rustix@0.37.23
	rustix@0.38.3
	rustls-pemfile@1.0.3
	rustls-webpki@0.101.4
	rustls@0.21.7
	ryu@1.0.14
	same-file@1.0.6
	schannel@0.1.22
	scheduled-thread-pool@0.2.7
	scopeguard@1.1.0
	sct@0.7.0
	security-framework-sys@2.9.0
	security-framework@2.9.1
	self_update@0.37.0
	semver@1.0.17
	serde@1.0.168
	serde_derive@1.0.168
	serde_json@1.0.107
	serde_urlencoded@0.7.1
	sha1@0.10.5
	sharded-slab@0.1.4
	signal-hook-mio@0.2.3
	signal-hook-registry@1.4.1
	signal-hook-tokio@0.3.1
	signal-hook@0.3.15
	skeptic@0.13.7
	slab@0.4.8
	smallvec@1.11.0
	socket2@0.4.9
	spin@0.5.2
	strsim@0.10.0
	syn@2.0.23
	tagptr@0.2.0
	tar@0.4.38
	task-local-extensions@0.1.4
	tempfile@3.6.0
	terminal_size@0.2.6
	thiserror-impl@1.0.41
	thiserror@1.0.41
	thread_local@1.1.7
	time-core@0.1.1
	time-macros@0.2.9
	time@0.3.22
	tinyvec@1.6.0
	tinyvec_macros@0.1.1
	tls-listener@0.7.0
	tokio-macros@2.1.0
	tokio-native-tls@0.3.1
	tokio-rustls@0.24.1
	tokio-socks@0.5.1
	tokio-util@0.7.8
	tokio@1.29.1
	tower-service@0.3.2
	tracing-attributes@0.1.26
	tracing-core@0.1.31
	tracing-log@0.1.3
	tracing-subscriber@0.3.17
	tracing@0.1.37
	triomphe@0.1.9
	try-lock@0.2.4
	typenum@1.16.0
	unicase@2.6.0
	unicode-bidi@0.3.13
	unicode-ident@1.0.10
	unicode-normalization@0.1.22
	unicode-width@0.1.10
	untrusted@0.7.1
	url@2.4.0
	urlencoding@2.1.2
	utf8parse@0.2.1
	uuid@1.4.0
	valuable@0.1.0
	vcpkg@0.2.15
	version_check@0.9.4
	waker-fn@1.1.0
	walkdir@2.3.3
	want@0.3.1
	wasi@0.11.0+wasi-snapshot-preview1
	wasm-bindgen-backend@0.2.87
	wasm-bindgen-futures@0.4.37
	wasm-bindgen-macro-support@0.2.87
	wasm-bindgen-macro@0.2.87
	wasm-bindgen-shared@0.2.87
	wasm-bindgen@0.2.87
	wasm-timer@0.2.5
	web-sys@0.3.64
	webpki-roots@0.25.2
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.5
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-sys@0.45.0
	windows-sys@0.48.0
	windows-targets@0.42.2
	windows-targets@0.48.1
	windows@0.48.0
	windows_aarch64_gnullvm@0.42.2
	windows_aarch64_gnullvm@0.48.0
	windows_aarch64_msvc@0.42.2
	windows_aarch64_msvc@0.48.0
	windows_i686_gnu@0.42.2
	windows_i686_gnu@0.48.0
	windows_i686_msvc@0.42.2
	windows_i686_msvc@0.48.0
	windows_x86_64_gnu@0.42.2
	windows_x86_64_gnu@0.48.0
	windows_x86_64_gnullvm@0.42.2
	windows_x86_64_gnullvm@0.48.0
	windows_x86_64_msvc@0.42.2
	windows_x86_64_msvc@0.48.0
	winreg@0.50.0
	xattr@0.2.3
	xml-rs@0.8.15
	xmltree@0.10.3
	zip@0.6.6
"

inherit cargo systemd readme.gentoo-r1

DOC_CONTENTS="After install, please copy
/etc/aliyundrive-webdav/aliyundrive-webdav.env.example
to /etc/aliyundrive-webdav/aliyundrive-webdav.env
to set REFRESH_TOKEN, WEBDAV_AUTH_USER, WEBDAV_AUTH_PASSWORD etc.
You can change ALIYUNDRIVE_WEBDAV_FLAGS to add more flags for aliyundrive-webdav"

DESCRIPTION="WebDAV server for AliyunDrive"
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/messense/aliyundrive-webdav.git"
SRC_URI="
	https://github.com/messense/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}"

# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 ISC MIT MPL-2.0 Unicode-DFS-2016 Unlicense ZLIB"
IUSE="debug"
SLOT="0"
KEYWORDS="~amd64"

QA_FLAGS_IGNORED="usr/bin/${PN}"

src_install()
{
	cargo_src_install
	systemd_dounit "${FILESDIR}/${PN}.service"
	insinto "/etc/${PN}"
	doins "${FILESDIR}/${PN}.env.example"
	readme.gentoo_create_doc
}

pkg_postinst() {
	elog "${DOC_CONTENTS}"
}