!1 add spec to build rpm
From: @LHesperus Reviewed-by: @ksana123 Signed-off-by: @ksana123
This commit is contained in:
commit
80696f6ae5
BIN
oeAware-collector-v1.0.0.tar.gz
Normal file
BIN
oeAware-collector-v1.0.0.tar.gz
Normal file
Binary file not shown.
84
oeAware-collector.spec
Normal file
84
oeAware-collector.spec
Normal file
@ -0,0 +1,84 @@
|
||||
%define debug_package %{nil}
|
||||
Name: oeAware-collector
|
||||
Version: v1.0.0
|
||||
Release: 1
|
||||
Summary: %{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information.
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
%global libkperf_name libkperf
|
||||
%global libkperf_tagver v1.0
|
||||
%global libkperf_source https://gitee.com/openeuler/libkperf.git
|
||||
|
||||
BuildRequires: cmake gcc-c++
|
||||
BuildRequires: numactl-devel
|
||||
BuildRequires: git
|
||||
BuildRequires: libboundscheck
|
||||
Provides: %{name}
|
||||
|
||||
ExclusiveArch: aarch64 x86_64
|
||||
|
||||
%description
|
||||
%{name} provides low-overhead metrics collection capabilities, including microarchitecture, system, and kernel information.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{version}
|
||||
%ifarch aarch64
|
||||
cd ./pmu/
|
||||
git clone --recurse-submodules %{libkperf_source}
|
||||
cd %{libkperf_name}
|
||||
git checkout %{libkperf_tagver}
|
||||
cd ..
|
||||
mv %{libkperf_name}/ %{libkperf_name}-%{libkperf_tagver}/
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
|
||||
%build
|
||||
# build libkperf.so
|
||||
%ifarch aarch64
|
||||
cd %{_builddir}/%{name}-%{version}/pmu/
|
||||
mkdir -p ./3rdlib/
|
||||
sh ./%{libkperf_name}-%{libkperf_tagver}/build.sh
|
||||
cp -r %{libkperf_name}-%{libkperf_tagver}/output/* ./3rdlib/
|
||||
%endif
|
||||
|
||||
# build libpmu.so
|
||||
%ifarch aarch64
|
||||
cd %{_builddir}/%{name}-%{version}/pmu/
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DLIB_KPERF_LIBPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/bin/ \
|
||||
-DLIB_KPERF_INCPATH=%{_builddir}/%{name}-%{version}/pmu/3rdlib/include/ \
|
||||
-DCMAKE_SKIP_RPATH=TRUE
|
||||
make
|
||||
%endif
|
||||
|
||||
# build libthread_collector.so
|
||||
cd %{_builddir}/%{name}-%{version}/thread_collector/
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
|
||||
%install
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
||||
%ifarch aarch64
|
||||
install -b -m640 ./pmu/3rdlib/bin/*.so ${RPM_BUILD_ROOT}%{_libdir}
|
||||
install -b -m640 ./pmu/build/libpmu.so ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
||||
%endif
|
||||
install -b -m640 ./thread_collector/build/libthread_collector.so ${RPM_BUILD_ROOT}%{_libdir}/oeAware-plugin/collector/
|
||||
|
||||
%files
|
||||
%defattr (-, root, root)
|
||||
%ifarch aarch64
|
||||
%attr(0440, root, root) %{_libdir}/libkperf.so
|
||||
%attr(0440, root, root) %{_libdir}/libsym.so
|
||||
%endif
|
||||
%attr(0440, root, root) %{_libdir}/oeAware-plugin/collector/*.so
|
||||
|
||||
%changelog
|
||||
* Wed Apr 17 2024 liuchanggeng<liuchanggeng@huawei.com> - v1.0.0-1
|
||||
- Package init
|
||||
Loading…
x
Reference in New Issue
Block a user