init repo with spec and source code

first add hikptool spec and source code, first version is 1.0.0

Signed-off-by: veega2022 <zhuweijia@huawei.com>
This commit is contained in:
veega2022 2022-10-13 17:30:45 +08:00
parent ef391f2c26
commit 4d5465ee95
2 changed files with 72 additions and 0 deletions

BIN
hikptool-1.0.0.tar.gz Normal file

Binary file not shown.

72
hikptool.spec Normal file
View File

@ -0,0 +1,72 @@
%global debug_package %{nil}
Name: hikptool
Summary: A userspace tool for Linux providing problem location on Kunpeng chips
Version: 1.0.0
Release: 1
License: MulanPSL2
Source: %{name}-%{version}.tar.gz
ExclusiveOS: linux
URL: https://gitee.com/openeuler/hikptool
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Prefix: /usr/lib64
Conflicts: %{name} < %{version}-%{release}
Provides: %{name} = %{version}-%{release}
BuildRequires: gcc make cmake
Requires: glibc
ExclusiveArch: aarch64
%description
This package contains the hikptool
%prep
%autosetup -n %{name} -p1
mkdir -p build
%build
cd build
cmake ../
make
%install
mkdir -p ${RPM_BUILD_ROOT}/usr/bin
mkdir -p ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/hikptool ${RPM_BUILD_ROOT}/usr/bin
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so.1 ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so ${RPM_BUILD_ROOT}/usr/lib64
install -b -m755 ./build/libhikptdev/src/rciep/libhikptdev.so.1.0.0 ${RPM_BUILD_ROOT}/usr/lib64
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(755,root,root)
/usr/lib64/libhikptdev.so.1
/usr/lib64/libhikptdev.so
/usr/lib64/libhikptdev.so.1.0.0
/usr/bin/hikptool
%pre
if [ "$1" = "2" ] ; then #2: update
rm -rf $RPM_INSTALL_PREFIX/libhikptdev.so > /dev/null 2>&1 || true
rm -rf $RPM_INSTALL_PREFIX/libhikptdev.so.1 > /dev/null 2>&1 || true
fi
%post
if [[ "$1" = "1" || "$1" = "2" ]] ; then #1: install 2: update
ln -sf $RPM_INSTALL_PREFIX/libhikptdev.so.%{version} $RPM_INSTALL_PREFIX/libhikptdev.so
ln -sf $RPM_INSTALL_PREFIX/libhikptdev.so.%{version} $RPM_INSTALL_PREFIX/libhikptdev.so.1
fi
/sbin/ldconfig
%preun
if [ "$1" = "0" ] ; then #0: uninstall
rm -rf /var/log/hikp/ > /dev/null 2>&1 || true
fi
%postun
/sbin/ldconfig
%changelog
* Wed Oct 12 2022 veega2022 <zhuweijia@huawei.com> 1.0.0-1
- First Spec Version Include hikptool Code