1 |
commit: bd569b9a6ef8d9e1e34a97116999e2345a16408b |
2 |
Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 29 11:53:31 2021 +0000 |
4 |
Commit: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 29 11:54:09 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bd569b9a |
7 |
|
8 |
net-libs/xdp-tools: add version 0.0.3 |
9 |
|
10 |
A bit rough around the edges, given the bespoke build system of |
11 |
xdp-tools is a little bit immature, and there's a bit of weirdness |
12 |
around installing BPF ELF objects. But hopefully this is a solid start. |
13 |
|
14 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
15 |
Signed-off-by: Jason A. Donenfeld <zx2c4 <AT> gentoo.org> |
16 |
|
17 |
net-libs/xdp-tools/Manifest | 1 + |
18 |
net-libs/xdp-tools/metadata.xml | 14 +++++++++ |
19 |
net-libs/xdp-tools/xdp-tools-0.0.3.ebuild | 52 +++++++++++++++++++++++++++++++ |
20 |
3 files changed, 67 insertions(+) |
21 |
|
22 |
diff --git a/net-libs/xdp-tools/Manifest b/net-libs/xdp-tools/Manifest |
23 |
new file mode 100644 |
24 |
index 00000000000..1ce4a87a70a |
25 |
--- /dev/null |
26 |
+++ b/net-libs/xdp-tools/Manifest |
27 |
@@ -0,0 +1 @@ |
28 |
+DIST xdp-tools-0.0.3.tar.gz 381386 BLAKE2B 1160d9a7cc2b6cf7b49e7223acdbeba72046c00ec710c21140da0607cac1e8a1231992a8967b2f8f2a964da593dfe0af08b28abbc3b13818ddafebbc2c3961a7 SHA512 c2a4278db41af020cf42b1139c93786a49ad2a071b2002177ac39e8d6b74203d251bd7823399d9e156c969d2ae741b0ecd4178edf446fe5c7270e53295458fce |
29 |
|
30 |
diff --git a/net-libs/xdp-tools/metadata.xml b/net-libs/xdp-tools/metadata.xml |
31 |
new file mode 100644 |
32 |
index 00000000000..51fa02b96ae |
33 |
--- /dev/null |
34 |
+++ b/net-libs/xdp-tools/metadata.xml |
35 |
@@ -0,0 +1,14 @@ |
36 |
+<?xml version="1.0" encoding="UTF-8"?> |
37 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
38 |
+<pkgmetadata> |
39 |
+ <maintainer type="person"> |
40 |
+ <email>Jason@×××××.com</email> |
41 |
+ <name>Jason A. Donenfeld</name> |
42 |
+ </maintainer> |
43 |
+ <upstream> |
44 |
+ <remote-id type="github">xdp-project/xdp-tools</remote-id> |
45 |
+ </upstream> |
46 |
+ <use> |
47 |
+ <flag name="tools">Install various helper tools rather than just libxdp.</flag> |
48 |
+ </use> |
49 |
+</pkgmetadata> |
50 |
|
51 |
diff --git a/net-libs/xdp-tools/xdp-tools-0.0.3.ebuild b/net-libs/xdp-tools/xdp-tools-0.0.3.ebuild |
52 |
new file mode 100644 |
53 |
index 00000000000..0966087d398 |
54 |
--- /dev/null |
55 |
+++ b/net-libs/xdp-tools/xdp-tools-0.0.3.ebuild |
56 |
@@ -0,0 +1,52 @@ |
57 |
+# Copyright 2021 Gentoo Authors |
58 |
+# Distributed under the terms of the GNU General Public License v2 |
59 |
+ |
60 |
+EAPI=8 |
61 |
+ |
62 |
+DESCRIPTION="The libxdp library and various tools for use with XDP" |
63 |
+HOMEPAGE="https://github.com/xdp-project/xdp-tools" |
64 |
+SRC_URI="https://github.com/xdp-project/${PN}/releases/download/v${PV}/${P}.tar.gz" |
65 |
+ |
66 |
+LICENSE="GPL-2 LGPL-2.1 BSD-2" |
67 |
+SLOT="0" |
68 |
+KEYWORDS="~amd64 ~x86" |
69 |
+ |
70 |
+IUSE="+doc +tools static-libs" |
71 |
+ |
72 |
+DEPEND="dev-libs/libbpf |
73 |
+ sys-libs/zlib |
74 |
+ net-libs/libpcap |
75 |
+ virtual/libelf" |
76 |
+RDEPEND="${DEPEND}" |
77 |
+BDEPEND=">=sys-devel/clang-10.0.0 |
78 |
+ doc? ( app-editors/emacs )" |
79 |
+ |
80 |
+# Not prebuilt -- we build them -- but they're not ordinary ELF objects either. |
81 |
+QA_PREBUILT="usr/lib/bpf/*.o" |
82 |
+ |
83 |
+MAKEOPTS+=" V=1" |
84 |
+ |
85 |
+src_prepare() { |
86 |
+ # A form of this kludge is upstream but hasn't yet been released: |
87 |
+ sed -i 's/install -m 0755 \$(SHARED_LIBS)/cp -fpR \$(SHARED_LIBS)/' lib/libxdp/Makefile || die |
88 |
+ default |
89 |
+} |
90 |
+ |
91 |
+src_configure() { |
92 |
+ export PRODUCTION=1 |
93 |
+ export DYNAMIC_LIBXDP=1 |
94 |
+ export FORCE_EMACS=$(usex doc 1 0) |
95 |
+ default |
96 |
+ { |
97 |
+ echo "PREFIX := ${EPREFIX}/usr" |
98 |
+ echo "LIBDIR := \$(PREFIX)/$(get_libdir)" |
99 |
+ echo "BPF_OBJECT_DIR := \$(PREFIX)/lib/bpf" |
100 |
+ } >> config.mk |
101 |
+} |
102 |
+ |
103 |
+src_install() { |
104 |
+ default |
105 |
+ use static-libs || rm -f "${D}/${EPREFIX}/usr/$(get_libdir)/libxdp.a" |
106 |
+ use tools || rm -f "${D}/${EPREFIX}/usr/"{sbin,bin}/* |
107 |
+ dostrip -x /usr/lib/bpf |
108 |
+} |