summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRadostin Stoyanov <[email protected]>2022-03-27 11:36:38 +0100
committerRadostin Stoyanov <[email protected]>2022-03-27 12:50:00 +0100
commit09070480687d77df87bcf2ac6c9545a5921c1130 (patch)
tree322e028081a177c9ab0fc5eef37cb1031ee66f0f
downloadp4lang-pi-09070480687d77df87bcf2ac6c9545a5921c1130.tar.gz
p4lang-pi-09070480687d77df87bcf2ac6c9545a5921c1130.tar.xz
p4lang-pi-09070480687d77df87bcf2ac6c9545a5921c1130.zip
initial
Signed-off-by: Radostin Stoyanov <[email protected]>
-rw-r--r--.gitignore6
-rw-r--r--p4lang-pi.spec103
-rw-r--r--sources6
3 files changed, 115 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..263f20a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+/v0.1.0.tar.gz
+/1040d11c089c74084c64c234bee3691ec70e8a9f.tar.gz
+/9c8d9e965b3e854107ea02c12ab11b70717456f2.tar.gz
+/bf15263081be6229be31addd48566df93921cb46.tar.gz
+/release-1.8.0.tar.gz
+/v1.3.0.tar.gz
diff --git a/p4lang-pi.spec b/p4lang-pi.spec
new file mode 100644
index 0000000..87894b0
--- /dev/null
+++ b/p4lang-pi.spec
@@ -0,0 +1,103 @@
+Name: p4lang-pi
+Version: 0.1.0
+Release: 1%{?dist}
+Summary: Protocol Independent API
+License: ASL 2.0
+URL: https://github.com/p4lang/PI
+
+# Architectures supported by PI
+ExclusiveArch: x86_64
+
+%define submodule_googletest_version 1.8.0
+%define submodule_gnmi_version 9c8d9e965b3e854107ea02c12ab11b70717456f2
+%define submodule_public_version 1040d11c089c74084c64c234bee3691ec70e8a9f
+%define submodule_p4runtime_version 1.3.0
+%define submodule_uthash_version bf15263081be6229be31addd48566df93921cb46
+
+Source0: https://github.com/p4lang/PI/archive/refs/tags/v%{version}.tar.gz
+Source1: https://github.com/google/googletest/archive/refs/tags/release-%{submodule_googletest_version}.tar.gz
+Source2: https://github.com/openconfig/gnmi/archive/%{submodule_gnmi_version}.tar.gz
+Source3: https://github.com/openconfig/public/archive/%{submodule_public_version}.tar.gz
+Source4: https://github.com/p4lang/p4runtime/archive/refs/tags/v%{submodule_p4runtime_version}.tar.gz
+Source5: https://github.com/troydhanson/uthash/archive/%{submodule_uthash_version}.tar.gz
+
+BuildRequires: valgrind
+BuildRequires: libtool
+BuildRequires: boost-devel boost-system boost-thread
+BuildRequires: grpc-devel grpc-plugins
+BuildRequires: protobuf-devel
+
+%description
+Protocol Independent API (PI or P4 Runtime) defines a set of APIs that allow
+interacting with entities defined in a P4 program, such as tables, counters,
+meters.
+
+%prep
+%setup -q -c -n p4lang-pi-%{version}
+
+%setup -q -T -D -a 1 -n p4lang-pi-%{version}
+cp -r googletest-release-%{submodule_googletest_version}/* PI-%{version}/third_party/googletest/
+
+%setup -q -T -D -a 2 -n p4lang-pi-%{version}
+cp -r gnmi-%{submodule_gnmi_version}/* PI-%{version}/proto/openconfig/gnmi/
+
+%setup -q -T -D -a 3 -n p4lang-pi-%{version}
+cp -r public-%{submodule_public_version}/* PI-%{version}/proto/openconfig/public/
+
+%setup -q -T -D -a 4 -n p4lang-pi-%{version}
+cp -r p4runtime-%{submodule_p4runtime_version}/* PI-%{version}/proto/p4runtime/
+
+%setup -q -T -D -a 5 -n p4lang-pi-%{version}
+cp -r uthash-%{submodule_uthash_version}/* PI-%{version}/third_party/uthash/
+
+
+%build
+cd PI-%{version}
+./autogen.sh
+mkdir build
+cd build
+
+# --with-cli and --with-internal-rpc are mostly deprecated.
+# The internal RPC mechanism predates P4Runtime, and the CLI
+# (very incomplete) should ideally be replaced by one built
+# over P4Runtime.
+#
+# --with-sysrepo is to enable supporting gNMI and OpenConfig
+# YANG models as part of the P4 Runtime server.
+
+../configure \
+ --prefix=%{_prefix} \
+ --libdir=%{_libdir} \
+ --without-bmv2 \
+ --without-sysrepo \
+ --without-internal-rpc \
+ --without-cli \
+ --with-proto
+
+make %{?_smp_mflags}
+
+%install
+cd PI-%{version}
+# license
+%{__mkdir_p} %{buildroot}%{_datadir}/p4lang-pi
+%{__cp} LICENSE %{buildroot}%{_datadir}/p4lang-pi/LICENSE
+cd build
+make install prefix=%{buildroot}%{_prefix} libdir=%{buildroot}/%{_libdir}
+
+%files
+%{_bindir}/pi_convert_p4info
+%{_bindir}/pi_gen_fe_defines
+%{_bindir}/pi_gen_native_json
+%{_includedir}/gnmi/*
+%{_includedir}/google/rpc/*
+%{_includedir}/p4/*
+%{_includedir}/PI/*
+%{python3_sitelib}/gnmi/*
+%{python3_sitelib}/google/*
+%{python3_sitelib}/p4/*
+%{_libdir}/libpi*
+%{_datadir}/p4lang-pi/LICENSE
+
+%changelog
+* Sun Mar 27 2022 <[email protected]> - 0.1.0
+- Initial release \ No newline at end of file
diff --git a/sources b/sources
new file mode 100644
index 0000000..721f931
--- /dev/null
+++ b/sources
@@ -0,0 +1,6 @@
+SHA512 (1040d11c089c74084c64c234bee3691ec70e8a9f.tar.gz) = 13fa74b2d35f906c93d95353cb05b58eab51aff24b09d272ead4793da36fc2d0f1f8027e36112ad7717fedc78ecbe8410513ec67b63be7a5fc9ad475b8dc9f85
+SHA512 (9c8d9e965b3e854107ea02c12ab11b70717456f2.tar.gz) = 7ab96fe1c71e8a288fb096dc2de6a865057b09fc611a7a21d45d789d035530b8be51edb95b32a970908ab0f22309ba6924ad7b6e8d202d890bdbb2820be51544
+SHA512 (bf15263081be6229be31addd48566df93921cb46.tar.gz) = 450a1fe9eb652d17170c50e8c2ffa92347d81a1e3f7c152dfed5523f4e9b5cdf8348ed645a744e1baceb4ded85142bcc6e459c270ed7ee2b265b33a47a922526
+SHA512 (release-1.8.0.tar.gz) = 1dbece324473e53a83a60601b02c92c089f5d314761351974e097b2cf4d24af4296f9eb8653b6b03b1e363d9c5f793897acae1f0c7ac40149216035c4d395d9d
+SHA512 (v0.1.0.tar.gz) = 7ed22c38490163acd1b641109ed3f9a997e2e8858b238716c269aca0f3a324f974abee8086052515ecb01e7bae95defd6c72297718cd53c4d4f0979174ce1859
+SHA512 (v1.3.0.tar.gz) = 42318ad891637ec7be80a50e68a9112cb3d9133ca65059408b80212d91a90646a412bcb29147b4b64f1179b98c5be58f837179550684b9087672d4ea50c613fe
OSZAR »