!28 create static libs and change subpackage name
From: @ironictwist Reviewed-by: @gameoverboss Signed-off-by: @gameoverboss
This commit is contained in:
commit
2a77b4a778
@ -1,9 +1,9 @@
|
||||
#needsrootforbuild
|
||||
%global __cargo_skip_build 0
|
||||
%global __cargo_common_opts %{?__cargo_common_opts} --all
|
||||
Name: sysboost
|
||||
Name: native-turbo
|
||||
Version: 1.0.0
|
||||
Release: 3
|
||||
Release: 5
|
||||
Summary: Numa Aware Scheduling
|
||||
License: Mulan PSL v2
|
||||
URL: https://gitee.com/openeuler/native-turbo
|
||||
@ -13,7 +13,6 @@ Source0: %{name}.tar.xz
|
||||
BuildRequires: meson >= 0.49.2, clang >= 12.0.1
|
||||
BuildRequires: make >= 4.0, bison >= 2.7, binutils >= 2.30-17, gcc >= 10.3.1
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: rust rust-packaging cargo
|
||||
|
||||
%description
|
||||
sysboost can merge ELF files to improve performance.
|
||||
@ -21,12 +20,17 @@ sysboost can merge ELF files to improve performance.
|
||||
# Add devel subpackage
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
BuildRequires: binutils
|
||||
|
||||
%description devel
|
||||
The %{name}-devel package contains some tools of sysboost.
|
||||
|
||||
%package tools
|
||||
Summary: Some tools for %{name}
|
||||
Requires: xz, binutils
|
||||
|
||||
%description tools
|
||||
The %{name}-tools package contains some tools of sysboost.
|
||||
|
||||
%prep
|
||||
export RPM_BUILD_DIR=%_topdir/BUILD
|
||||
export RPM_BUILD_SOURCE=%_topdir/SOURCES
|
||||
@ -34,53 +38,43 @@ export RPM_BUILD_SOURCE=%_topdir/SOURCES
|
||||
tar -Jxf $RPM_BUILD_SOURCE/%{name}.tar.xz
|
||||
|
||||
cp $RPM_BUILD_SOURCE/objreloc.sh $RPM_BUILD_DIR/objreloc
|
||||
cp $RPM_BUILD_DIR/native-turbo/sysboost/Cargo.toml $RPM_BUILD_DIR/
|
||||
|
||||
%cargo_prep
|
||||
|
||||
%cargo_generate_buildrequires
|
||||
|
||||
%build
|
||||
cd $RPM_BUILD_DIR/native-turbo/sysboost
|
||||
%cargo_build -a
|
||||
|
||||
cd $RPM_BUILD_DIR/native-turbo
|
||||
make release
|
||||
make
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/include/
|
||||
|
||||
pushd native-turbo/build
|
||||
install -D -p -m 750 ./sysboost/sysboost $RPM_BUILD_ROOT/%{_bindir}/sysboost
|
||||
install -D -p -m 750 ./sysboost/src/static_template/sysboost_static_template $RPM_BUILD_ROOT/%{_bindir}/sysboost_static_template
|
||||
install -D -p -m 750 ./sysboost/src/libhook/libhook.so $RPM_BUILD_ROOT/%{_bindir}/libhook.so
|
||||
install -D -p -m 644 ./lib/libsi_array.a $RPM_BUILD_ROOT/%{_libdir}/libsi_array.a
|
||||
install -D -p -m 644 ./lib/libsi_hashmap.a $RPM_BUILD_ROOT/%{_libdir}/libsi_hashmap.a
|
||||
install -D -p -m 644 ./lib/libsi_ring.a $RPM_BUILD_ROOT/%{_libdir}/libsi_ring.a
|
||||
install -D -p -m 644 ./lib/libsi_sys.a $RPM_BUILD_ROOT/%{_libdir}/libsi_sys.a
|
||||
popd
|
||||
|
||||
pushd native-turbo/sysboost
|
||||
install -D -p -m 640 %{name}.service $RPM_BUILD_ROOT/usr/lib/systemd/system/%{name}.service
|
||||
install -D -p -m 750 ./target/release/sysboostd $RPM_BUILD_ROOT%{_bindir}/
|
||||
pushd native-turbo
|
||||
install -D -p -m 644 ./lib/sys/include/* $RPM_BUILD_ROOT/usr/include/
|
||||
install -D -p -m 644 ./lib/hashmap/si_hashmap.h $RPM_BUILD_ROOT/usr/include/si_hashmap.h
|
||||
install -D -p -m 644 ./lib/array/si_array.h $RPM_BUILD_ROOT/usr/include/si_array.h
|
||||
install -D -p -m 644 ./lib/ring/si_ring_core.h $RPM_BUILD_ROOT/usr/include/si_ring_core.h
|
||||
install -D -p -m 644 ./lib/ring/si_ring.h $RPM_BUILD_ROOT/usr/include/si_ring.h
|
||||
popd
|
||||
|
||||
install -m 755 $RPM_BUILD_DIR/objreloc $RPM_BUILD_ROOT%{_bindir}/
|
||||
|
||||
mkdir -p %{buildroot}/etc/sysboost.d/
|
||||
mkdir -p %{buildroot}/var/lib/sysboost/
|
||||
|
||||
%check
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir /etc/sysboost.d/
|
||||
%dir /var/lib/sysboost/
|
||||
%{_bindir}/sysboost
|
||||
%{_bindir}/sysboost_static_template
|
||||
%{_bindir}/libhook.so
|
||||
%{_bindir}/sysboostd
|
||||
/usr/lib/systemd/system/%{name}.service
|
||||
|
||||
%files devel
|
||||
%{_libdir}/*
|
||||
/usr/include/*
|
||||
|
||||
%files tools
|
||||
%defattr(0755,root,root)
|
||||
%{_bindir}/objreloc
|
||||
|
||||
@ -96,6 +90,18 @@ mkdir -p %{buildroot}/var/lib/sysboost/
|
||||
%systemd_postun_with_restart %{name}.service
|
||||
|
||||
%changelog
|
||||
* Mon Jun 12 2023 liutie <liutie4@huawei.com> - 1.0.0-5
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: when tools should run with xz and
|
||||
|
||||
* Mon Jun 12 2023 liutie <liutie4@huawei.com> - 1.0.0-4
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: create static libs and change devel subpackage name
|
||||
|
||||
* Tue May 16 2023 liutie <liutie4@huawei.com> - 1.0.0-3
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
@ -115,3 +121,7 @@ mkdir -p %{buildroot}/var/lib/sysboost/
|
||||
- DESC: Independently generate the objreloc tool
|
||||
|
||||
* Thu Apr 6 2023 liutie <liutie4@huawei.com> - 1.0.0-0
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: init
|
||||
Binary file not shown.
@ -12,4 +12,6 @@ fi
|
||||
|
||||
# Remove debug and unnecessary sections, and create relocation and primary files
|
||||
objcopy --strip-debug --strip-dwo --strip-unneeded "$LIB_FILE" "$LIB_FILE.relocation"
|
||||
objcopy --remove-relocations=".*" "$LIB_FILE" "$LIB_FILE.prim"
|
||||
xz -z "$LIB_FILE.relocation"
|
||||
mv -f "$LIB_FILE.relocation.xz" "$LIB_FILE.relocation"
|
||||
# objcopy --remove-relocations=".*" "$LIB_FILE" "$LIB_FILE.prim"
|
||||
Loading…
x
Reference in New Issue
Block a user