PORTNAME=	miniserve
DISTVERSIONPREFIX=	v
DISTVERSION=	0.24.0
PORTREVISION=	4
CATEGORIES=	www

MAINTAINER=	mikael@FreeBSD.org
COMMENT=	Ad-hoc HTTP server for file sharing
WWW=		https://github.com/svenstaro/miniserve

LICENSE=	APACHE20 BSD3CLAUSE CC0-1.0 ISCL MIT MPL20 UNLICENSE
LICENSE_COMB=	multi
LICENSE_FILE_MIT=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	zstd>0:archivers/zstd
LIB_DEPENDS=	libonig.so:devel/oniguruma

USES=		cargo ssl:build
USE_GITHUB=	yes
GH_ACCOUNT=	svenstaro

CARGO_CRATES=	actix-codec-0.5.1 \
		actix-files-0.6.2 \
		actix-http-3.3.1 \
		actix-macros-0.2.3 \
		actix-multipart-0.5.0 \
		actix-router-0.5.1 \
		actix-rt-2.8.0 \
		actix-server-2.2.0 \
		actix-service-2.0.2 \
		actix-tls-3.0.3 \
		actix-utils-3.0.1 \
		actix-web-4.3.1 \
		actix-web-codegen-4.2.0 \
		actix-web-httpauth-0.8.0 \
		addr2line-0.20.0 \
		adler-1.0.2 \
		adler32-1.2.0 \
		ahash-0.7.6 \
		ahash-0.8.3 \
		aho-corasick-0.7.20 \
		aho-corasick-1.0.2 \
		alloc-no-stdlib-2.0.4 \
		alloc-stdlib-0.2.2 \
		alphanumeric-sort-1.5.1 \
		android-tzdata-0.1.1 \
		android_system_properties-0.1.5 \
		anstream-0.3.2 \
		anstyle-1.0.1 \
		anstyle-parse-0.2.1 \
		anstyle-query-1.0.0 \
		anstyle-wincon-1.0.1 \
		anyhow-1.0.71 \
		askama_escape-0.10.3 \
		assert_cmd-2.0.11 \
		assert_fs-1.0.13 \
		autocfg-1.1.0 \
		backtrace-0.3.68 \
		base64-0.13.1 \
		base64-0.21.2 \
		bit-set-0.5.3 \
		bit-vec-0.6.3 \
		bitflags-1.3.2 \
		bitflags-2.3.3 \
		block-buffer-0.10.4 \
		brotli-3.3.4 \
		brotli-decompressor-2.3.4 \
		bstr-1.6.0 \
		bumpalo-3.13.0 \
		byteorder-1.4.3 \
		bytes-1.4.0 \
		bytesize-1.2.0 \
		bytestring-1.3.0 \
		cc-1.0.79 \
		cfg-if-1.0.0 \
		chrono-0.4.26 \
		chrono-humanize-0.2.2 \
		clap-4.3.11 \
		clap_builder-4.3.11 \
		clap_complete-4.3.2 \
		clap_derive-4.3.2 \
		clap_lex-0.5.0 \
		clap_mangen-0.2.12 \
		codemap-0.1.3 \
		colorchoice-1.0.0 \
		colored-2.0.4 \
		comrak-0.18.0 \
		convert_case-0.4.0 \
		core-foundation-sys-0.8.4 \
		cpufeatures-0.2.9 \
		crc32fast-1.3.2 \
		crossbeam-utils-0.8.16 \
		crypto-common-0.1.6 \
		ctor-0.1.26 \
		derive_more-0.99.17 \
		deunicode-0.4.3 \
		diff-0.1.13 \
		difflib-0.4.0 \
		digest-0.10.7 \
		doc-comment-0.3.3 \
		either-1.8.1 \
		encoding_rs-0.8.32 \
		entities-1.0.1 \
		errno-0.3.1 \
		errno-dragonfly-0.1.2 \
		fake-tty-0.3.1 \
		fast_qr-0.9.0 \
		fastrand-1.9.0 \
		filetime-0.2.21 \
		flate2-1.0.26 \
		float-cmp-0.9.0 \
		fnv-1.0.7 \
		form_urlencoded-1.2.0 \
		futf-0.1.5 \
		futures-0.3.28 \
		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-timer-3.0.2 \
		futures-util-0.3.28 \
		generic-array-0.14.7 \
		getrandom-0.2.10 \
		gimli-0.27.3 \
		glob-0.3.1 \
		globset-0.4.10 \
		globwalk-0.8.1 \
		grass-0.12.4 \
		grass_compiler-0.12.4 \
		h2-0.3.20 \
		hashbrown-0.11.2 \
		hashbrown-0.12.3 \
		heck-0.4.1 \
		hermit-abi-0.3.2 \
		hex-0.4.3 \
		html5ever-0.26.0 \
		http-0.2.9 \
		http-body-0.4.5 \
		http-range-0.1.5 \
		httparse-1.8.0 \
		httpdate-1.0.2 \
		hyper-0.14.27 \
		hyper-rustls-0.24.1 \
		iana-time-zone-0.1.57 \
		iana-time-zone-haiku-0.1.2 \
		idna-0.4.0 \
		if-addrs-0.10.1 \
		ignore-0.4.20 \
		indexmap-1.9.3 \
		instant-0.1.12 \
		io-lifetimes-1.0.11 \
		ipnet-2.8.0 \
		is-terminal-0.4.8 \
		itertools-0.10.5 \
		itoa-1.0.8 \
		jobserver-0.1.26 \
		js-sys-0.3.64 \
		language-tags-0.3.2 \
		lasso-0.6.0 \
		lazy_static-1.4.0 \
		libc-0.2.147 \
		libflate-1.4.0 \
		libflate_lz77-1.2.0 \
		linux-raw-sys-0.3.8 \
		linux-raw-sys-0.4.3 \
		local-channel-0.1.3 \
		local-waker-0.1.3 \
		lock_api-0.4.10 \
		log-0.4.19 \
		mac-0.1.1 \
		markup5ever-0.11.0 \
		markup5ever_rcdom-0.2.0 \
		maud-0.25.0 \
		maud_macros-0.25.0 \
		memchr-2.5.0 \
		mime-0.3.17 \
		mime_guess-2.0.4 \
		miniz_oxide-0.7.1 \
		mio-0.8.8 \
		nanoid-0.4.0 \
		new_debug_unreachable-1.0.4 \
		normalize-line-endings-0.3.0 \
		num-traits-0.2.15 \
		num_cpus-1.16.0 \
		num_threads-0.1.6 \
		object-0.31.1 \
		once_cell-1.18.0 \
		output_vt100-0.1.3 \
		parking_lot-0.12.1 \
		parking_lot_core-0.9.8 \
		paste-1.0.13 \
		percent-encoding-2.3.0 \
		phf-0.10.1 \
		phf_codegen-0.10.0 \
		phf_generator-0.10.0 \
		phf_macros-0.10.0 \
		phf_shared-0.10.0 \
		pin-project-lite-0.2.10 \
		pin-utils-0.1.0 \
		pkg-config-0.3.27 \
		port_check-0.1.5 \
		ppv-lite86-0.2.17 \
		precomputed-hash-0.1.1 \
		predicates-3.0.3 \
		predicates-core-1.0.6 \
		predicates-tree-1.0.9 \
		pretty_assertions-1.3.0 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro-hack-0.5.20+deprecated \
		proc-macro2-1.0.63 \
		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 \
		regex-1.9.0 \
		regex-automata-0.3.0 \
		regex-syntax-0.7.3 \
		relative-path-1.8.0 \
		reqwest-0.11.18 \
		ring-0.16.20 \
		rle-decode-fast-1.0.3 \
		roff-0.2.1 \
		rstest-0.18.1 \
		rstest_macros-0.18.1 \
		rustc-demangle-0.1.23 \
		rustc_version-0.4.0 \
		rustix-0.37.23 \
		rustix-0.38.3 \
		rustls-0.20.8 \
		rustls-0.21.3 \
		rustls-pemfile-1.0.3 \
		rustls-webpki-0.101.0 \
		rustversion-1.0.13 \
		ryu-1.0.14 \
		same-file-1.0.6 \
		scopeguard-1.1.0 \
		sct-0.7.0 \
		select-0.6.0 \
		semver-1.0.17 \
		serde-1.0.166 \
		serde_derive-1.0.166 \
		serde_json-1.0.100 \
		serde_urlencoded-0.7.1 \
		sha1-0.10.5 \
		sha2-0.10.7 \
		signal-hook-registry-1.4.1 \
		simplelog-0.12.1 \
		siphasher-0.3.10 \
		slab-0.4.8 \
		slug-0.1.4 \
		smallvec-1.10.0 \
		socket2-0.4.9 \
		socket2-0.5.3 \
		spin-0.5.2 \
		string_cache-0.8.7 \
		string_cache_codegen-0.5.2 \
		strsim-0.10.0 \
		strum-0.25.0 \
		strum_macros-0.25.1 \
		syn-1.0.109 \
		syn-2.0.23 \
		tar-0.4.38 \
		tempfile-3.6.0 \
		tendril-0.4.3 \
		termcolor-1.1.3 \
		terminal_size-0.2.6 \
		termtree-0.4.1 \
		thiserror-1.0.41 \
		thiserror-impl-1.0.41 \
		thread_local-1.1.7 \
		time-0.1.45 \
		time-0.3.22 \
		time-core-0.1.1 \
		time-macros-0.2.9 \
		tinyvec-1.6.0 \
		tinyvec_macros-0.1.1 \
		tokio-1.29.1 \
		tokio-rustls-0.23.4 \
		tokio-rustls-0.24.1 \
		tokio-util-0.7.8 \
		tower-service-0.3.2 \
		tracing-0.1.37 \
		tracing-core-0.1.31 \
		try-lock-0.2.4 \
		typed-arena-2.0.2 \
		typenum-1.16.0 \
		unicase-2.6.0 \
		unicode-bidi-0.3.13 \
		unicode-ident-1.0.10 \
		unicode-normalization-0.1.22 \
		unicode_categories-0.1.1 \
		untrusted-0.7.1 \
		url-2.4.0 \
		utf-8-0.7.6 \
		utf8parse-0.2.1 \
		version_check-0.9.4 \
		wait-timeout-0.2.0 \
		walkdir-2.3.3 \
		want-0.3.1 \
		wasi-0.10.0+wasi-snapshot-preview1 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.87 \
		wasm-bindgen-backend-0.2.87 \
		wasm-bindgen-futures-0.4.37 \
		wasm-bindgen-macro-0.2.87 \
		wasm-bindgen-macro-support-0.2.87 \
		wasm-bindgen-shared-0.2.87 \
		web-sys-0.3.64 \
		webpki-0.22.0 \
		webpki-roots-0.22.6 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.5 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-0.48.0 \
		windows-sys-0.45.0 \
		windows-sys-0.48.0 \
		windows-targets-0.42.2 \
		windows-targets-0.48.1 \
		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.10.1 \
		xattr-0.2.3 \
		xml5ever-0.17.0 \
		yansi-0.5.1 \
		zip-0.6.6 \
		zstd-0.12.3+zstd.1.5.2 \
		zstd-safe-6.0.5+zstd.1.5.4 \
		zstd-sys-2.0.8+zstd.1.5.5

PLIST_FILES=	bin/miniserve
PORTDOCS=	README.md

OPTIONS_DEFINE=	DOCS

post-install:
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/miniserve

post-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
	${INSTALL_MAN} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}

.include <bsd.port.mk>
