698e0e4
%global pkgname factint
698e0e4
698e0e4
Name:           gap-pkg-%{pkgname}
8b9f739
Version:        1.6.2
8b9f739
Release:        1%{?dist}
698e0e4
Summary:        Advanced methods for factoring integers
698e0e4
8b9f739
%global pkgdir FactInt-%{version}
8b9f739
698e0e4
License:        GPLv2+
8b9f739
URL:            https://gap-packages.github.io/FactInt/
8b9f739
Source0:        https://github.com/gap-packages/FactInt/releases/download/v%{version}/%{pkgdir}.tar.gz
698e0e4
BuildArch:      noarch
698e0e4
698e0e4
BuildRequires:  gap-devel
8b9f739
BuildRequires:  gap-pkg-autodoc
698e0e4
698e0e4
Requires:       gap-core
698e0e4
698e0e4
%description
698e0e4
FactInt provides implementations of the following methods for factoring
698e0e4
integers:
698e0e4
- Pollard's p-1
698e0e4
- Williams' p+1
698e0e4
- Elliptic Curves Method (ECM)
698e0e4
- Continued Fraction Algorithm (CFRAC)
698e0e4
- Multiple Polynomial Quadratic Sieve (MPQS)
698e0e4
FactInt also makes use of Richard P. Brent's tables of known factors of
698e0e4
integers of the form bk+/-1 for "small" b.
698e0e4
698e0e4
The ECM method is suited best for finding factors which are neither too
698e0e4
small (i.e. have less than about 12 decimal digits) nor too close to the
698e0e4
square root of the number to be factored.  The MPQS method is designed
698e0e4
for factoring products of two primes of comparable orders of magnitude.
698e0e4
CFRAC is the historical predecessor of the MPQS method.  Pollard's p-1
698e0e4
and Williams' p+1 are useful for finding factors p such that all prime
698e0e4
factors of p-1 (respectively p+1) are "small", e.g. smaller than 1000000.
698e0e4
All factoring methods implemented in this package are probabilistic.  In
698e0e4
particular the time needed by the ECM method depends largely on luck.
698e0e4
698e0e4
FactInt provides a general-purpose factorization routine which uses an
698e0e4
appropriate combination of the methods mentioned above, the Pollard Rho
698e0e4
routine which is implemented in the GAP Library and a variety of tricks
698e0e4
for special cases to obtain a good average performance for "arbitrary"
698e0e4
integers.  At the user's option, FactInt provides detailed information
698e0e4
about the progress of the factorization process.
698e0e4
698e0e4
%prep
8b9f739
%setup -q -n %{pkgdir}
698e0e4
698e0e4
# Fix encodings
343c753
for fil in CHANGES; do
698e0e4
  iconv -f iso8859-1 -t utf-8 $fil > $fil.utf8
698e0e4
  touch -r $fil $fil.utf8
698e0e4
  mv -f $fil.utf8 $fil
698e0e4
done
698e0e4
698e0e4
%build
8b9f739
gap makedoc.g
698e0e4
698e0e4
%install
698e0e4
mkdir -p %{buildroot}%{_gap_dir}/pkg
8b9f739
cp -a ../%{pkgdir} %{buildroot}%{_gap_dir}/pkg
8b9f739
rm -fr %{buildroot}%{_gap_dir}/pkg/%{pkgdir}/scripts
8b9f739
rm -f %{buildroot}%{_gap_dir}/pkg/%{pkgdir}/doc/*.{aux,bbl,blg,brf,idx,ilg,ind,log,out,pnr,tex,toc}
698e0e4
698e0e4
%check
8b9f739
gap -l "%{buildroot}%{_gap_dir};%{_gap_dir}" tst/testall.g 2>&1 | tee log
10e8258
! grep -Fq fail log
698e0e4
rm -f log
698e0e4
698e0e4
%files
8b9f739
%doc CHANGES README.md
8b9f739
%docdir %{_gap_dir}/pkg/%{pkgdir}/doc
8b9f739
%{_gap_dir}/pkg/%{pkgdir}/
698e0e4
698e0e4
%changelog
8b9f739
* Sat Jun  9 2018 Jerry James <loganjerry@gmail.com> - 1.6.2-1
8b9f739
- New upstream version
8b9f739
- New URLs
8b9f739
70b9b8a
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-2
70b9b8a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
70b9b8a
10e8258
* Sat Jan  6 2018 Jerry James <loganjerry@gmail.com> - 1.6.0-1
10e8258
- New upstream version
10e8258
- New URLs
10e8258
7f18193
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-2
7f18193
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
7f18193
343c753
* Fri Mar 31 2017 Jerry James <loganjerry@gmail.com> - 1.5.4-1
343c753
- New upstream version
343c753
1a63bab
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.3-2
1a63bab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
1a63bab
698e0e4
* Tue May  3 2016 Jerry James <loganjerry@gmail.com> - 1.5.3-1
698e0e4
- Initial RPM