summaryrefslogtreecommitdiff
blob: 04319fda899dba9efbbcea09e27cf8aa6e376410 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit systemd

DESCRIPTION="Userland client/server for kernel network block device"
HOMEPAGE="https://nbd.sourceforge.net/"
if [[ ${PV} = 9999 ]] ; then
	inherit autotools git-r3
	EGIT_REPO_URI="https://github.com/NetworkBlockDevice/nbd.git"
else
	SRC_URI="https://github.com/NetworkBlockDevice/nbd/releases/download/${P}/${P}.tar.xz
		mirror://sourceforge/nbd/${P}.tar.xz"
	KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
fi

LICENSE="GPL-2"
SLOT="0"
IUSE="debug gnutls netlink zlib"

BDEPEND="virtual/pkgconfig"

RDEPEND="
	>=dev-libs/glib-2.26.0
	gnutls? ( >=net-libs/gnutls-2.12.0 )
	netlink? ( >=dev-libs/libnl-3.1 )
	zlib? ( sys-libs/zlib )
"
DEPEND="${RDEPEND}"
BDEPEND="sys-devel/bison"

if [[ ${PV} = 9999 ]] ; then
	BDEPEND+="
		app-text/docbook-sgml-dtd:4.5
		app-text/docbook-sgml-utils
		sys-devel/autoconf-archive
	"
fi

src_prepare() {
	default

	if [[ ${PV} = 9999 ]] ; then
		emake -C man -f Makefile.am \
			nbd-server.1.sh.in \
			nbd-server.5.sh.in \
			nbd-client.8.sh.in \
			nbd-trdump.1.sh.in \
			nbdtab.5.sh.in

		emake -C systemd -f Makefile.am nbd@.service.sh.in

		eautoreconf
	fi
}

src_configure() {
	local myeconfargs=(
		--enable-lfs
		$(use_enable !debug syslog)
		$(use_enable debug)
		$(use_enable zlib gznbd)
		$(use_with gnutls)
		$(use_with netlink libnl)
	)

	econf "${myeconfargs[@]}"
}

src_install() {
	default
	systemd_dounit systemd/nbd@.service
}