File libspf2.spec of Package libspf2

%define realname libspf2
%define realver  1.2.10
%define srcext   tar.gz

%define sover    2

# turn off the generation of debuginfo rpm  (RH9) ??
%global debug_package %{nil}

# Common info
Name:          %{realname}%{?sover:-%{sover}}
Version:       %{realver}
Release:       %{?extraver:0.}1%{?rhel:.el%{rhel}}%{?fedora:.fc%{fedora}}
License:       LGPL-2.0 or BSD-2-Clause
Group:         System/Libraries
Summary:       Fully thread safe Sender Policy Framework implementation

# Build-time parameters
BuildRoot:     %{_tmppath}/%{name}-root
Patch:         gcc5-build-fix.patch

libspf2 implements the Sender Policy Framework, a part of the SPF/SRS protocol
pair. libspf2 is a library which allows email systems such as Sendmail, Postfix,
Exim, Zmailer and MS Exchange to check SPF records and make sure that the email
is authorized by the domain name that it is coming from. This prevents email
forgery, commonly used by spammers, scammers and email viruses/worms.

%package -n %{realname}-devel
Group:         Development/Languages/C and C++
Summary:       Development files for %{name}
Requires:      %{name} = %{version}

%description -n %{realname}-devel
Development files for %{name}

# Preparation step (unpackung and patching if necessary)
%setup -q -n %{realname}-%{realver}%{?extraver}
%patch -p1

%configure \
 CFLAGS="%{optflags}" \
 CXXFLAGS="%{optflags}" \
 LDFLAGS="-Wl,--as-needed -Wl,--strip-all"
%{__make} %{?_smp_mflags}

%{__make} install DESTDIR=%{buildroot}

[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}

%exclude %{_bindir}/*_static

# Development stuff
%files -n %{realname}-devel
%dir %{_includedir}/spf2/
%exclude %{_libdir}/*.a
%exclude %{_libdir}/*.la

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig