%global upstreamver 1r2p5
%global pkgname tomlib
Name: gap-pkg-%{pkgname}
Version: %(sed -r "s/r|p/./g" <<< %{upstreamver})
Release: 3%{?dist}
Summary: GAP Table of Marks package
License: GPLv2+
URL: http://schmidt.nuigalway.ie/%{pkgname}/
Source0: http://schmidt.nuigalway.ie/%{pkgname}/%{pkgname}%{upstreamver}.tar.gz
BuildArch: noarch
BuildRequires: gap-devel
BuildRequires: gap-pkg-atlasrep
BuildRequires: parallel
Requires: gap-pkg-atlasrep
Requires(post): gap-core
Requires(postun): gap-core
Recommends: gap-pkg-ctbllib
# This can be removed once Fedora 21 reaches EOL
Obsoletes: gap-table-of-marks < 1.2.5-1%{?dist}
Provides: gap-table-of-marks = %{version}-%{release}
%description
This package provides access to several hundred tables of marks of
almost simple groups and their maximal subgroups.
%prep
%setup -q -n %{pkgname}
# Remove spurious executable bits
chmod a-x doc/tomlib.xml
%build
# Compress large tables of marks
parallel %{?_smp_mflags} --no-notice gzip --best ::: data/*.tom
%install
mkdir -p %{buildroot}%{_gap_dir}/pkg
cp -a ../%{pkgname} %{buildroot}%{_gap_dir}/pkg
rm -f %{buildroot}%{_gap_dir}/pkg/%{pkgname}/README
%post -p %{_bindir}/update-gap-workspace
%postun -p %{_bindir}/update-gap-workspace
%check
cd tst
gap -l "%{_gap_dir};%{buildroot}%{_gap_dir}" testall.g < /dev/null
%files
%doc README
%docdir %{_gap_dir}/pkg/%{pkgname}/doc
%{_gap_dir}/pkg/%{pkgname}/
%changelog
* Thu Jan 29 2015 Jerry James <loganjerry@gmail.com> - 1.2.5-3
- Compress with _smp_mflags
* Thu Jan 29 2015 Jerry James <loganjerry@gmail.com> - 1.2.5-2
- Compress the tables in parallel
* Fri Jan 16 2015 Jerry James <loganjerry@gmail.com> - 1.2.5-1
- Initial RPM