libbprd/libbprd.spec
2020-10-21 09:33:34 +02:00

69 lines
1.4 KiB
RPMSpec

%define name libbprd
%define version 1.0.7
%define major_version 1
%define minor_version 0
%define release_version 7
%define target_lib libbprd
Summary: Silicom Bypass Library
Name: %{name}
Version: %{version}
Release: %(uname -r | sed s/-/\./g).2
Vendor: Silicom, Ltd
License: GPL
Group: System Environment/Base
Source: libbprd-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-buildroot
#BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
#BuildRequires: librdi
%description
This package contains Silicom Bypass Library.
%prep
%setup -c -b 0
%build
cd ./libbprd-%{version}/lib
make
%install
cd ./libbprd-%{version}/lib
if [ -d /usr/include ]
then
mkdir -p $RPM_BUILD_ROOT/usr/include
echo "/usr/include/libbprd.h" >> $RPM_BUILD_DIR/file.list.%{name}
fi
if [ -d /usr/local/lib ]
then
mkdir -p $RPM_BUILD_ROOT/usr/local/lib
echo "/usr/local/lib/%{target_lib}.so.%{major_version}.%{minor_version}.%{release_version}" >> $RPM_BUILD_DIR/file.list.%{name}
echo "/usr/local/lib/%{target_lib}.so.%{major_version}" >> $RPM_BUILD_DIR/file.list.%{name}
echo "/usr/local/lib/%{target_lib}.so" >> $RPM_BUILD_DIR/file.list.%{name}
fi
make install PREFIX=$RPM_BUILD_ROOT
%post
depmod -a > /dev/null 2> /dev/null
exit 0
%postun
depmod -a > /dev/null 2> /dev/null
exit 0
%clean
rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/file.list.%{name}
%files -f ../file.list.%{name}
%doc ./libbprd-%{version}/readme.txt ./libbprd-%{version}/release.txt
%changelog