PORTNAME=	rathole
DISTVERSIONPREFIX=	v
DISTVERSION=	0.4.7
PORTREVISION=	2
CATEGORIES=	net

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Lightweight and high-performance reverse proxy for NAT traversal
WWW=		https://github.com/rapiz1/rathole

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		cargo ssl

USE_GITHUB=	yes
GH_ACCOUNT=	rapiz1

CARGO_CRATES=	adler-1.0.2 \
		aead-0.4.3 \
		aes-0.7.5 \
		aes-gcm-0.9.4 \
		android_system_properties-0.1.5 \
		ansi_term-0.12.1 \
		anyhow-1.0.66 \
		async-http-proxy-1.2.5 \
		async-socks5-0.5.1 \
		async-stream-0.3.3 \
		async-stream-impl-0.3.3 \
		async-trait-0.1.58 \
		atty-0.2.14 \
		autocfg-1.1.0 \
		axum-0.5.17 \
		axum-core-0.2.9 \
		backoff-0.4.0 \
		base64-0.13.1 \
		bincode-1.3.3 \
		bitflags-1.3.2 \
		blake2-0.10.4 \
		block-buffer-0.10.3 \
		bumpalo-3.11.1 \
		byteorder-1.4.3 \
		bytes-1.2.1 \
		cc-1.0.74 \
		cfg-if-1.0.0 \
		chacha20-0.8.2 \
		chacha20poly1305-0.9.1 \
		chrono-0.4.22 \
		cipher-0.3.0 \
		clap-3.2.23 \
		clap_derive-3.2.18 \
		clap_lex-0.2.4 \
		codespan-reporting-0.11.1 \
		console-api-0.4.0 \
		console-subscriber-0.1.8 \
		core-foundation-0.9.3 \
		core-foundation-sys-0.8.3 \
		cpufeatures-0.2.5 \
		crc32fast-1.3.2 \
		crossbeam-channel-0.5.6 \
		crossbeam-utils-0.8.12 \
		crypto-common-0.1.6 \
		ctr-0.8.0 \
		curve25519-dalek-4.0.0-pre.2 \
		cxx-1.0.80 \
		cxx-build-1.0.80 \
		cxxbridge-flags-1.0.80 \
		cxxbridge-macro-1.0.80 \
		digest-0.10.5 \
		either-1.8.0 \
		enum-iterator-1.1.3 \
		enum-iterator-derive-1.1.0 \
		fastrand-1.8.0 \
		fdlimit-0.2.1 \
		filetime-0.2.18 \
		flate2-1.0.24 \
		fnv-1.0.7 \
		foreign-types-0.3.2 \
		foreign-types-shared-0.1.1 \
		form_urlencoded-1.1.0 \
		fsevent-sys-4.1.0 \
		futures-0.3.25 \
		futures-channel-0.3.25 \
		futures-core-0.3.25 \
		futures-io-0.3.25 \
		futures-macro-0.3.25 \
		futures-sink-0.3.25 \
		futures-task-0.3.25 \
		futures-util-0.3.25 \
		generic-array-0.14.6 \
		getrandom-0.2.8 \
		getset-0.1.2 \
		ghash-0.4.4 \
		git2-0.14.4 \
		h2-0.3.15 \
		hashbrown-0.12.3 \
		hdrhistogram-7.5.2 \
		heck-0.4.0 \
		hermit-abi-0.1.19 \
		hex-0.4.3 \
		http-0.2.8 \
		http-body-0.4.5 \
		http-range-header-0.3.0 \
		httparse-1.8.0 \
		httpdate-1.0.2 \
		humantime-2.1.0 \
		hyper-0.14.22 \
		hyper-timeout-0.4.1 \
		iana-time-zone-0.1.53 \
		iana-time-zone-haiku-0.1.1 \
		idna-0.3.0 \
		indexmap-1.9.1 \
		inotify-0.9.6 \
		inotify-sys-0.1.5 \
		instant-0.1.12 \
		itertools-0.10.5 \
		itoa-1.0.4 \
		jobserver-0.1.25 \
		js-sys-0.3.60 \
		kqueue-1.0.7 \
		kqueue-sys-1.0.3 \
		lazy_static-1.4.0 \
		libc-0.2.137 \
		libgit2-sys-0.13.4+1.4.2 \
		libz-sys-1.1.8 \
		link-cplusplus-1.0.7 \
		lock_api-0.4.9 \
		log-0.4.17 \
		matchers-0.0.1 \
		matchers-0.1.0 \
		matchit-0.5.0 \
		memchr-2.5.0 \
		mime-0.3.16 \
		minimal-lexical-0.2.1 \
		miniz_oxide-0.5.4 \
		mio-0.8.5 \
		native-tls-0.2.11 \
		nom-7.1.1 \
		notify-5.0.0 \
		num-integer-0.1.45 \
		num-traits-0.2.15 \
		num_cpus-1.14.0 \
		num_threads-0.1.6 \
		once_cell-1.16.0 \
		opaque-debug-0.3.0 \
		openssl-0.10.42 \
		openssl-macros-0.1.0 \
		openssl-probe-0.1.5 \
		openssl-sys-0.9.77 \
		os_str_bytes-6.3.1 \
		parking_lot-0.11.2 \
		parking_lot-0.12.1 \
		parking_lot_core-0.8.5 \
		parking_lot_core-0.9.4 \
		percent-encoding-2.2.0 \
		pin-project-1.0.12 \
		pin-project-internal-1.0.12 \
		pin-project-lite-0.2.9 \
		pin-utils-0.1.0 \
		pkg-config-0.3.26 \
		poly1305-0.7.2 \
		polyval-0.5.3 \
		ppv-lite86-0.2.17 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro2-1.0.47 \
		prost-0.11.2 \
		prost-derive-0.11.2 \
		prost-types-0.11.2 \
		quote-1.0.21 \
		rand-0.8.5 \
		rand_chacha-0.3.1 \
		rand_core-0.6.4 \
		redox_syscall-0.2.16 \
		regex-1.6.0 \
		regex-automata-0.1.10 \
		regex-syntax-0.6.27 \
		remove_dir_all-0.5.3 \
		rustc_version-0.4.0 \
		rustversion-1.0.9 \
		ryu-1.0.11 \
		same-file-1.0.6 \
		schannel-0.1.20 \
		scopeguard-1.1.0 \
		scratch-1.0.2 \
		security-framework-2.7.0 \
		security-framework-sys-2.6.1 \
		semver-1.0.14 \
		serde-1.0.147 \
		serde_derive-1.0.147 \
		serde_json-1.0.87 \
		sha2-0.10.6 \
		sharded-slab-0.1.4 \
		signal-hook-registry-1.4.0 \
		slab-0.4.7 \
		smallvec-1.10.0 \
		snow-0.9.0 \
		snowstorm-0.4.0 \
		socket2-0.4.7 \
		strsim-0.10.0 \
		subtle-2.4.1 \
		syn-1.0.103 \
		sync_wrapper-0.1.1 \
		tempfile-3.3.0 \
		termcolor-1.1.3 \
		textwrap-0.16.0 \
		thiserror-1.0.37 \
		thiserror-impl-1.0.37 \
		thread_local-1.1.4 \
		time-0.3.16 \
		time-core-0.1.0 \
		time-macros-0.2.5 \
		tinyvec-1.6.0 \
		tinyvec_macros-0.1.0 \
		tokio-1.21.2 \
		tokio-io-timeout-1.2.0 \
		tokio-macros-1.8.0 \
		tokio-native-tls-0.3.0 \
		tokio-stream-0.1.11 \
		tokio-util-0.7.4 \
		toml-0.5.9 \
		tonic-0.8.2 \
		tower-0.4.13 \
		tower-http-0.3.4 \
		tower-layer-0.3.2 \
		tower-service-0.3.2 \
		tracing-0.1.37 \
		tracing-attributes-0.1.23 \
		tracing-core-0.1.30 \
		tracing-futures-0.2.5 \
		tracing-log-0.1.3 \
		tracing-serde-0.1.3 \
		tracing-subscriber-0.2.25 \
		tracing-subscriber-0.3.16 \
		try-lock-0.2.3 \
		typenum-1.15.0 \
		unicode-bidi-0.3.8 \
		unicode-ident-1.0.5 \
		unicode-normalization-0.1.22 \
		unicode-width-0.1.10 \
		universal-hash-0.4.1 \
		url-2.3.1 \
		valuable-0.1.0 \
		vcpkg-0.2.15 \
		vergen-7.4.2 \
		version_check-0.9.4 \
		walkdir-2.3.2 \
		want-0.3.0 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.83 \
		wasm-bindgen-backend-0.2.83 \
		wasm-bindgen-macro-0.2.83 \
		wasm-bindgen-macro-support-0.2.83 \
		wasm-bindgen-shared-0.2.83 \
		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-sys-0.36.1 \
		windows-sys-0.42.0 \
		windows_aarch64_gnullvm-0.42.0 \
		windows_aarch64_msvc-0.36.1 \
		windows_aarch64_msvc-0.42.0 \
		windows_i686_gnu-0.36.1 \
		windows_i686_gnu-0.42.0 \
		windows_i686_msvc-0.36.1 \
		windows_i686_msvc-0.42.0 \
		windows_x86_64_gnu-0.36.1 \
		windows_x86_64_gnu-0.42.0 \
		windows_x86_64_gnullvm-0.42.0 \
		windows_x86_64_msvc-0.36.1 \
		windows_x86_64_msvc-0.42.0 \
		zeroize-1.3.0

OPENSSLINC=	/usr/include
OPENSSLLIB=	/usr/lib

PLIST_FILES=	bin/${PORTNAME}

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

.include <bsd.port.mk>
