Name: gf2x
Version: 1.1
Release: 2%{?dist}
Summary: Polynomial multiplication over the binary field
License: GPLv2+
URL: http://gf2x.gforge.inria.fr/
Source0: https://gforge.inria.fr/frs/download.php/30873/%{name}-%{version}.tar.gz
%description
Gf2x is a C/C++ software package containing routines for fast arithmetic
in GF(2)[x] (multiplication, squaring, GCD) and searching for
irreducible/primitive trinomials.
%package devel
Summary: Headers and library files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Headers and library files for developing applications that use %{name}.
%prep
%setup -q
# Fix the FSF's address
for badfile in `grep -FRl 'Fifth Floor' .`; do
sed -e 's/Fifth Floor/Suite 500/' -e 's/02111-1307/02110-1335/' \
-i.orig $badfile
touch -r $badfile.orig $badfile
rm -f $badfile.orig
done
%build
# Build an SSE2-enabled version for 32-bit x86
%ifarch %{ix86}
%configure --disable-static --enable-sse2 --disable-pclmul \
CFLAGS="$RPM_OPT_FLAGS -march=pentium4 -msse2"
# Eliminate hardcoded rpaths
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-i libtool
make %{?_smp_mflags}
# Stash the results away and prepare to build again
mv .libs sse2
make distclean
%endif
# Build the native version for all CPUs (SSE2 for x86_64).
# Support for pclmul would be nice, but not all x86_64s support it.
%ifarch x86_64
%configure --disable-static --enable-sse2 --disable-pclmul
%else
%configure --disable-static --disable-sse2 --disable-pclmul
%endif
# Eliminate hardcoded rpaths
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-i libtool
make %{?_smp_mflags} --eval='.SECONDARY:'
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%ifarch %{ix86}
mkdir -p $RPM_BUILD_ROOT%{_libdir}/sse2
install -m 755 sse2/lib%{name}.so.*.*.* $RPM_BUILD_ROOT%{_libdir}/sse2
%endif
%check
LD_LIBRARY_PATH=`pwd`/.libs make check
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%doc AUTHORS BUGS COPYING README TODO
%{_libdir}/lib%{name}.so.*
%ifarch %{ix86}
%{_libdir}/sse2/lib%{name}.so.*
%endif
%files devel
%{_includedir}/%{name}/
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}.so
%changelog
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Fri Aug 3 2012 Jerry James <loganjerry@gmail.com> - 1.1-1
- New upstream release
* Fri May 4 2012 Jerry James <loganjerry@gmail.com> - 1.0-1
- Initial RPM