-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
template
40 lines (37 loc) · 1.1 KB
/
template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Template file for 'FlintQS'
pkgname=FlintQS
version=1.0
revision=1
build_style=gnu-configure
hostmakedepends="automake"
makedepends="gmp-devel"
checkdepends="bc"
short_desc="Multi-polynomial quadratic sieve for integer factorization"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="https://github.com/sagemath/FlintQS"
distfiles="https://github.com/sagemath/FlintQS/archive/v${version}.tar.gz"
checksum=b983052f267988192c9ec59c9d2754470e5f2db74b45e364cf7ad62f349bc9eb
pre_configure() {
touch ChangeLog
autoreconf -fi
}
_check_factor() {
echo -n "Factor $1 ... "
factors=$(echo "$1" | src/QuadraticSieve | awk 'x{print}/FACTORS:/{x=1}' | sort -u)
echo -n $factors | sed -e 's/ / * /'
prod=$(echo $factors | sed -e 's/ /*/' | bc)
if [ "$prod" == "$1" ] ; then
echo " - OK"
return 0
else
echo " - FAIL"
return 1
fi
}
do_check() {
# check that it can factor
_check_factor 7115311179635024735652627015068546182713648318529
_check_factor 55100662978045942257527719411373552579109062399339
_check_factor 179926028483627295233062780598576300117675953698228811539221
}