]>
Commit | Line | Data |
---|---|---|
9a6d47a2 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without apidocs # API documentation | |
4 | ||
85fe4023 JB |
5 | Summary: Libbpf library |
6 | Summary(pl.UTF-8): Biblioteka libbpf | |
7 | Name: libbpf | |
8f35f62b | 8 | Version: 1.2.0 |
1930f955 | 9 | Release: 1 |
85fe4023 JB |
10 | License: LGPL v2.1 or BSD |
11 | Group: Libraries | |
12 | #Source0Download: https://github.com/libbpf/libbpf/releases | |
13 | Source0: https://github.com/libbpf/libbpf/archive/v%{version}/%{name}-%{version}.tar.gz | |
8f35f62b | 14 | # Source0-md5: 99c94606189ad9718e051737a4209b54 |
85fe4023 JB |
15 | URL: https://github.com/libbpf/libbpf |
16 | BuildRequires: elfutils-devel | |
17 | BuildRequires: linux-libc-headers >= 7:5.4.0 | |
18 | BuildRequires: pkgconfig | |
9a6d47a2 | 19 | BuildRequires: rpm-build >= 4.6 |
85fe4023 | 20 | BuildRequires: zlib-devel |
9a6d47a2 JB |
21 | %if %{with apidocs} |
22 | BuildRequires: doxygen | |
23 | BuildRequires: python3-breathe | |
24 | BuildRequires: sphinx-pdg-3 | |
25 | %endif | |
85fe4023 JB |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
27 | ||
28 | %description | |
29 | A mirror of bpf-next Linux tree bpf-next/tools/lib/bpf directory plus | |
30 | its supporting header files. The version of the package reflects the | |
31 | version of ABI. | |
32 | ||
33 | %description -l pl.UTF-8 | |
34 | Kopia lustrzana katalogu bpf-next/tools/lib/bpf ze źródeł Linuksa, z | |
35 | drzewka bpf-next wraz ze wspierającymi plikami nagłówkowymi. Wersja | |
36 | pakietu odzwierciedla wersję ABI. | |
37 | ||
38 | %package devel | |
39 | Summary: Development files for libbpf library | |
40 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki libbpf | |
41 | Group: Development/Libraries | |
42 | Requires: %{name} = %{version}-%{release} | |
43 | Requires: elfutils-devel | |
44 | Requires: linux-libc-headers >= 7:5.4.0 | |
45 | Requires: zlib-devel | |
46 | ||
47 | %description devel | |
48 | This package contains header files for developing applications that | |
49 | use libbpf. | |
50 | ||
51 | %description devel -l pl.UTF-8 | |
52 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
53 | wykorzystujących libbpf. | |
54 | ||
55 | %package static | |
56 | Summary: Static libbpf library | |
57 | Summary(pl.UTF-8): Statyczna biblioteka libbpf | |
58 | Group: Development/Libraries | |
59 | Requires: %{name}-devel = %{version}-%{release} | |
60 | ||
61 | %description static | |
62 | This package contains static library for developing applications that | |
63 | use libbpf. | |
64 | ||
65 | %description static -l pl.UTF-8 | |
66 | Ten pakiet zawiera bibliotekę statyczną do tworzenia aplikacji | |
67 | wykorzystujących libbpf. | |
68 | ||
9a6d47a2 JB |
69 | %package apidocs |
70 | Summary: API documentation for libbpf library | |
71 | Summary(pl.UTF-8): Dokumentacja API biblioteki libbpf | |
72 | Group: Documentation | |
73 | BuildArch: noarch | |
74 | ||
75 | %description apidocs | |
76 | API documentation for libbpf library. | |
77 | ||
78 | %description apidocs -l pl.UTF-8 | |
79 | Dokumentacja API biblioteki libbpf. | |
80 | ||
85fe4023 JB |
81 | %prep |
82 | %setup -q | |
83 | ||
84 | %build | |
85 | # use NO_PKG_CONFIG to link with -lelf -lz, not $(pkg-config --libs libelf) which doesn't contain -lz | |
86 | %{__make} -C src \ | |
87 | CC="%{__cc}" \ | |
88 | CFLAGS="%{rpmcflags} %{rpmcppflags} -fPIC" \ | |
89 | LDFLAGS="%{rpmldflags}" \ | |
ab31e099 JB |
90 | NO_PKG_CONFIG=1 \ |
91 | V=1 | |
85fe4023 | 92 | |
9a6d47a2 JB |
93 | %if %{with apidocs} |
94 | READTHEDOCS=True \ | |
95 | %{__make} -C docs -f sphinx/Makefile html \ | |
96 | SOURCEDIR=. \ | |
97 | SPHINXBUILD=sphinx-build-3 | |
98 | %endif | |
99 | ||
85fe4023 JB |
100 | %install |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %{__make} -C src install \ | |
104 | DESTDIR=$RPM_BUILD_ROOT \ | |
105 | LIBSUBDIR=%{_lib} | |
106 | ||
107 | %clean | |
108 | rm -rf $RPM_BUILD_ROOT | |
109 | ||
a1addb93 JB |
110 | %post -p /sbin/ldconfig |
111 | %postun -p /sbin/ldconfig | |
112 | ||
85fe4023 JB |
113 | %files |
114 | %defattr(644,root,root,755) | |
115 | %doc LICENSE LICENSE.BSD-2-Clause README.md | |
2d35d38d | 116 | %attr(755,root,root) %{_libdir}/libbpf.so.*.*.* |
5d598593 | 117 | %attr(755,root,root) %ghost %{_libdir}/libbpf.so.1 |
85fe4023 JB |
118 | |
119 | %files devel | |
120 | %defattr(644,root,root,755) | |
121 | %attr(755,root,root) %{_libdir}/libbpf.so | |
122 | %{_includedir}/bpf | |
123 | %{_pkgconfigdir}/libbpf.pc | |
124 | ||
125 | %files static | |
126 | %defattr(644,root,root,755) | |
127 | %{_libdir}/libbpf.a | |
9a6d47a2 JB |
128 | |
129 | %if %{with apidocs} | |
130 | %files apidocs | |
131 | %defattr(644,root,root,755) | |
132 | %doc docs/build/html/{_static,*.html,*.js} | |
133 | %endif |