dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / net-misc / vde / vde-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit flag-o-matic
7
8 if [[ ${PV} == 9999 ]]; then
9         inherit autotools git-r3
10         EGIT_REPO_URI="https://github.com/virtualsqaure/MY_PN"
11         KEYWORDS=""
12 elif [[ ${PV} = *_p* ]]; then
13         inherit autotools
14         MY_PN="vde-2"
15         COMMIT="c7b36a57831a9067c8619c3e17a03e595623b3eb"
16         SRC_URI="https://github.com/virtualsquare/${MY_PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
17         KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
18
19         S="${WORKDIR}/${MY_PN}-${COMMIT}"
20 else
21         MY_P="${PN}2-${PV}"
22         SRC_URI="mirror://sourceforge/vde/${MY_P}.tar.bz2"
23         KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
24         S="${WORKDIR}/${MY_P}"
25 fi
26
27 DESCRIPTION="Virtual distributed ethernet emulator for emulators like qemu, bochs, and uml"
28 HOMEPAGE="https://virtualsquare.org"
29
30 LICENSE="GPL-2"
31 SLOT="0"
32 #IUSE="pcap selinux ssl libressl static-libs"
33 # upstream switched to wolfssl
34 IUSE="pcap selinux static-libs"
35
36 COMMON_DEPS="pcap? ( net-libs/libpcap )"
37 # upstream switched to wolfssl
38 #       ssl? (
39 #               !libressl? ( dev-libs/openssl:0= )
40 #               libressl? ( dev-libs/libressl:0= )
41 #       )"
42 DEPEND="${COMMON_DEPS}"
43 RDEPEND="${COMMON_DEPS}
44         acct-group/qemu
45         selinux? ( sec-policy/selinux-vde )"
46
47 # upstream switched to wolfssl
48 src_prepare() {
49         default
50         if [[ ${PV} == 9999 ]] || [[ ${PV} == *_p* ]]; then
51                 eautoreconf
52         fi
53 # upstream switched to wolfssl
54 #       has_version ">=dev-libs/openssl-1.1.0" && \
55 #               eapply "${FILESDIR}/${PN}-2.3.2-openssl-1.1.patch"
56 }
57
58 src_configure() {
59         filter-flags -O0 -Os
60 # upstream switched to wolfssl
61 #               $(use_enable ssl cryptcab) \
62         econf \
63                 --disable-python \
64                 --disable-cryptcab \
65                 $(use_enable pcap) \
66                 $(use_enable static-libs static)
67 }
68
69 src_compile() {
70         # https://github.com/virtualsquare/vde-2/issues/6
71         emake -j1
72 }
73
74 src_install() {
75         default
76         find "${D}" -name '*.la' -type f -delete || die
77
78         newinitd "${FILESDIR}"/vde.init-r1 vde
79         newconfd "${FILESDIR}"/vde.conf-r1 vde
80 }
81
82 pkg_postinst() {
83         einfo "To start vde automatically add it to the default runlevel:"
84         einfo "# rc-update add vde default"
85         einfo "You need to setup tap0 in /etc/conf.d/net"
86         einfo "To use it as an user be sure to set a group in /etc/conf.d/vde"
87 }