forked from bpfman/bpfman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bpfman.spec
103 lines (83 loc) · 2.75 KB
/
bpfman.spec
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Generated by rust2rpm 25
%bcond_without check
%global crate bpfman
## START DO NOT OVERRIDE: These are generated at runtime by .packit.sh
%global commit 0
%global shortcommit 0
%global base_version 0
%global prerelease 0
## END DO NOT OVERRIDE
%global package_version %{base_version}%{?prerelease:~%{prerelease}}
%global upstream_version %{base_version}%{?prerelease:-%{prerelease}}
Name: bpfman
Version: %{package_version}
Release: %autorelease
Summary: An eBPF program manager
License: Apache-2.0
URL: https://bpfman.io
Source0: https://github.com/bpfman/bpfman/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
# The vendor tarball is created using cargo-vendor-filterer to remove Windows
# related files (https://github.com/coreos/cargo-vendor-filterer)
# cargo vendor-filterer --format tar.gz --prefix vendor bpfman-bpfman-vendor.tar.gz
Source1: bpfman-bpfman-vendor.tar.gz
BuildRequires: cargo-rpm-macros >= 25
BuildRequires: systemd-rpm-macros
BuildRequires: openssl-devel
BuildRequires: pkgconfig(zlib)
BuildRequires: gcc
# TODO: Generate Provides for all of the vendored dependencies
%global _description %{expand:
An eBPF Program Manager.}
%description %{_description}
%prep
%autosetup %{name}-%{version_no_tilde} -n %{name}-%{commit} -p1 -a1
# Source1 is vendored dependencies
tar -xoaf %{SOURCE1}
# Let the macros setup Cargo.toml to use vendored sources
%cargo_prep -v vendor
%cargo_license_summary
%cargo_license
%build
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%{cargo_vendor_manifest}
%install
install -Dpm 0755 \
-t %{buildroot}%{_sbindir} \
./target/release/bpfman
install -Dpm 0755 \
-t %{buildroot}%{_sbindir} \
./target/release/bpfman-ns
install -Dpm 0755 \
-t %{buildroot}%{_sbindir} \
./target/release/bpfman-rpc
install -Dpm 644 \
-t %{buildroot}%{_unitdir} \
./scripts/bpfman.socket
install -Dpm 644 \
-t %{buildroot}%{_unitdir} \
./scripts/bpfman.service
%post
%systemd_post bpfman.service
%preun
%systemd_preun bpfman.service
%postun
%systemd_postun_with_restart bpfman.service
%files
%license LICENSE-APACHE
%license LICENSE.dependencies
%license cargo-vendor.txt
%doc README.md
%{_sbindir}/bpfman
%{_sbindir}/bpfman-ns
%{_sbindir}/bpfman-rpc
%{_unitdir}/bpfman.socket
%{_unitdir}/bpfman.service
%if %{with check}
%check
# Skip image_pull_* tests as require Internet to pull images from a registry
%cargo_test -- -- --skip oci_utils::image_manager::tests::image_pull_failure --skip oci_utils::image_manager::tests::image_pull_and_bytecode_verify --skip oci_utils::image_manager::tests::private_image_pull_and_bytecode_verify --skip oci_utils::image_manager::tests::image_pull_policy_never_failure
%endif
%changelog
%autochangelog