diff --git a/libxudp-1.0.0.tar.gz b/libxudp-1.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..cb40783db4496e186d8c6bb1dfce9bb4556b844b Binary files /dev/null and b/libxudp-1.0.0.tar.gz differ diff --git a/libxudp.pc b/libxudp.pc new file mode 100644 index 0000000000000000000000000000000000000000..1804681590c1c4042f49c161d2ae31689f141ab3 --- /dev/null +++ b/libxudp.pc @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${exec_prefix}/lib + +Name: libxudp +Description: Express UDP is a high-performance UDP communication software library based on the xdp socket technology. +Version: 1.0.0 +Cflags: -I${includedir}/ +Libs: -L${libdir} -lxudp diff --git a/libxudp.spec b/libxudp.spec new file mode 100644 index 0000000000000000000000000000000000000000..eef569685cf11f58e18f7217e1ccb46722770643 --- /dev/null +++ b/libxudp.spec @@ -0,0 +1,76 @@ +%define anolis_release 1 + +#Global macro/variable 定义 +%define _unpackaged_files_terminate_build 0 + +Name: libxudp +Version: 1.0.0 +Release: %{anolis_release}%{?dist} +Summary: Express UDP(xudp) library +Vendor: Alibaba +License: Mulan PSL v2 +Url: https://gitee.com/anolis/libxudp +Source0: https://gitee.com/anolis/libxudp/releases/download/v%{version}/libxudp-%{version}.tar.gz + +BuildRequires: kernel-headers >= 4.19.91 +BuildRequires: libnl3-devel +BuildRequires: elfutils-libelf-devel +BuildRequires: libcap-devel +BuildRequires: clang +BuildRequires: llvm + +%description +Express UDP is a high-performance UDP communication software library based on the xdp socket technology. + +# xudp-tools +%package tools +Summary: Express UDP tools. +Requires: %{name} = %{version}-%{release} +%description tools +Express UDP is a high-performance UDP communication software library based on the xdp socket technology. + +# devel +%package devel +Summary: Express UDP devel package. +Requires: %{name} = %{version}-%{release} +%description devel +Express UDP is a high-performance UDP communication software library based on the xdp socket technology. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +make prefix=%{buildroot} SO=1 + +%install +mkdir -p %{buildroot}/usr +mkdir -p %{buildroot}/usr/lib64 +mkdir -p %{buildroot}/usr/lib64/pkgconfig +mkdir -p %{buildroot}/usr/include +mkdir -p %{buildroot}/usr/bin +make install prefix=%{buildroot}/usr +cp -p libxudp.pc %{buildroot}/usr/lib64/pkgconfig + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%{_libdir}/libxudp.so.1.0.0 +%{_libdir}/libxudp.so.1 + +%files tools +%{_bindir}/xudp-echo-server +%{_bindir}/xudp-map +%{_bindir}/xudp-dump +%{_bindir}/xudp-stats +%{_bindir}/xudpperf + +%files devel +%{_includedir}/xudp.h +%{_libdir}/libxudp.so +%{_libdir}/pkgconfig/libxudp.pc + +%changelog +* Mon Aug 15 2022 Xuan Zhuo - 1.0.0-1 +- Initial libxudp +