summaryrefslogtreecommitdiff
path: root/www-servers/static-web-server/static-web-server-2.44.1.ebuild
blob: 39bf5f246072d23d639bac6ff2c29b8f5a4626b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

RUST_MIN_VER="1.88.0"
CRATES=" "
inherit cargo systemd shell-completion

DESCRIPTION="A high-performance and asynchronous web server for static files-serving"
HOMEPAGE="https://static-web-server.net/"
SRC_URI="https://github.com/static-web-server/static-web-server/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://share.terinstock.com/${P}-vendor.tar.xz"

LICENSE="MIT Apache-2.0"
LICENSE+=" BSD 0BSD ZLIB Unlicense Unicode-3.0 ISC"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="dev-libs/libgit2"

src_unpack() {
	cargo_src_unpack
	ln -s "${WORKDIR}/vendor/"* "${CARGO_HOME}/gentoo/" || die
}

src_configure() {
	cargo_gen_config
	cargo_src_configure --no-default-features --bin static-web-server
}

src_prepare() {
	default

	export LIBGIT2_NO_VENDOR=1
}

src_compile() {
	cargo_src_compile

	"$(cargo_target_dir)/${PN}" generate --completions . || die
	"$(cargo_target_dir)/${PN}" generate --man-pages . || die
}

src_install() {
	cargo_src_install

	systemd_dounit systemd/static-web-server.service
	systemd_dounit systemd/static-web-server.socket
	insinto /etc/default
	newins systemd/etc_default_static-web-server static-web-server

	newbashcomp "completions/${PN}.bash" "${PN}"
	newzshcomp "completions/_${PN}" "_${PN}"
	newfishcomp "completions/${PN}.fish" "${PN}"

	doman man/static-web-server.1
	doman man/static-web-server-generate.1
}