File libcacard.spec of Package libcacard
%define realname libcacard
%define realver 2.6.1
%define srcext tar.xz
%define so_ver 0
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}%{?so_ver}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: LGPL-2.1+
Group: System/Libraries
URL: https://www.spice-space.org/page/Libcacard
Summary: Common Access Card library
# Install-time parameters
Provides: %{realname} = %{version}-%{release}
Obsoletes: %{realname} < %{version}-%{release}
# Build-time parameters
BuildRequires: xz
BuildRequires: pkg-config
BuildRequires: pkgconfig(glib-2.0) >= 2.22
BuildRequires: pkgconfig(nss) >= 3.12.8
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(libpcsclite)
BuildRoot: %{_tmppath}/%{name}-root
Source: https://www.spice-space.org/download/%{realname}/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
This library provides emulation of smart cards to a virtual card reader running
in a guest virtual machine.
It implements DoD CAC standard with separate pki containers (compatible
coolkey), using certificates read from NSS.
%package -n %{realname}-devel
Group: Development/Languages/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-devel
%description -n %{realname}-devel
Development files for %{name}
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
%configure \
--disable-static \
CFLAGS="$_CFLAGS" \
CXXFLAGS="$_CFLAGS" \
LDFLAGS="$_LDFLAGS"
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc COPYING NEWS README.md
%{_libdir}/%{realname}.so.%{?so_ver}*
# Development stuff
%files -n %{realname}-devel
%defattr(-,root,root)
%doc COPYING NEWS README.md docs/libcacard.txt
%{_libdir}/pkgconfig/%{realname}.pc
%dir %{_includedir}/cacard/
%{_includedir}/cacard/*.h
%{_libdir}/%{realname}.so
%exclude %{_libdir}/*.la
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog