File libnfs.spec of Package libnfs
%define realname libnfs
%define realver 6.0.2
%define srcext tar.gz
%define so_ver 16
# Common info
Name: %{realname}%{?so_ver}
Version: %{realver}
Release: wiz%{?extraver:0.}1
License: LGPL-2.1-or-later
Group: Development/Libraries/C and C++
URL: https://github.com/sahlberg/libnfs
Summary: Client library for accessing NFS shares over a network
# Install-time parameters
Provides: %{realname} = %{version}
Obsoletes: %{realname} < %{version}
# Build-time parameters
BuildRequires: pkg-config
BuildRequires: krb5-devel
Source0: https://codeload.github.com/sahlberg/libnfs/%{srcext}/refs/tags/%{realname}-%{realver}#/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
LIBNFS is a client library for accessing NFS shares over a network.
LIBNFS offers three different APIs, for different use :
1, RAW : A fully async low level RPC library for NFS protocols
2, NFS ASYNC : A fully asynchronous library for high level vfs functions
3, NFS SYNC : A synchronous library for high level vfs functions
%package -n %{realname}-devel
License: LGPL-2.1-or-later and BSD-2-Clause
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}
%description -n %{realname}-devel
Development files for %{name}
%package -n %{realname}-utils
License: GPL-3.0-or-later
Group: Productivity/Networking/NFS
Summary: Utilities to deal with files placed on not mounted NFS
%description -n %{realname}-utils
nfs-cat - read a file off NFS
nfs-cp - copy files to/from and NFS server
nfs-ls - list NFS servers, exports and directories
nfs-stat - stat an nfs file
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realname}-%{realver}%{?extraver}
autoreconf -f -i
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
--disable-static \
--enable-pthread \
CFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%license LICENCE-LGPL-2.1.txt
%doc COPYING README
%{_libdir}/libnfs.so.%{?so_ver}*
# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%license LICENCE-LGPL-2.1.txt LICENCE-BSD.txt
%doc COPYING README README.multithreading
%{_libdir}/pkgconfig/libnfs.pc
%{_includedir}/nfsc/
%{_libdir}/libnfs.so
%exclude %{_libdir}/libnfs.la
# Utils
%files -n %{realname}-utils
%defattr(-,root,root)
%license LICENCE-GPL-3.txt
%{_bindir}/*
%doc %{_mandir}/man1/*
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog