summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 63027206c56cc664e15b55db737ac591506e8632 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer: KUMAX <kumax2048@pm.me>

_pkgbase=yafu
pkgname=yafu-git
pkgrel=1
pkgver=r640.ee519b2
pkgdesc="Automated integer factorization."
url=https://github.com/bbuhrow/yafu
license=("MIT")
arch=('x86_64')
conflicts=(${_pkgbase})
provides=('yafu' 'ysieve')
#makedepends=('zlib' 'msieve') ## These dependencies are related to some features, but they are not tested for being sufficient to make yafu work.
makedepends=('git' 'subversion')
depends=('gmp' 'gmp-ecm')
optdepends=('ggnfs')
source=(
	"git+https://github.com/bbuhrow/yafu.git"
	"git+https://github.com/bbuhrow/ytools.git"
	"git+https://github.com/bbuhrow/ysieve.git"
	msieve::"svn+svn://svn.code.sf.net/p/msieve/code/trunk"
	)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            )

prepare() {
	cd ${srcdir}/yafu
	sed -i "s%^LIBS += -lecm /users/buhrow/src%#LIBS += -lecm /users/buhrow/src%" Makefile
	sed -i "s/^\#LIBS += -lecm -lgmp -lytools -lysieve/LIBS += -lecm -lgmp -lytools -lysieve/" Makefile
}

pkgver() {
	cd "${_pkgbase}"
	( set -o pipefail
		git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

build() {
	cd ${srcdir}/ytools
    make CC=gcc CFLAGS="$CFLAGS -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"
	cp libytools.a ${srcdir}/ysieve/

	cd ${srcdir}/ysieve
    make CC=gcc CFLAGS="$CFLAGS -g -O3 -fomit-frame-pointer -Wall  -I.  -I../ytools -Wno-error=incompatible-pointer-types"
	cp libytools.a ${srcdir}/yafu/
	cp libysieve.a ${srcdir}/yafu/

	cd ${srcdir}/msieve
	make all NO_ZLIB=1

	cd ${srcdir}/yafu
	make yafu CC=gcc NFS=1 CFLAGS="$CFLAGS -g -m64 -std=gnu99 -DUSE_SSE2 -fno-common -DUSE_NFS -O2 -fomit-frame-pointer -Wall  -I. -Iinclude -Itop/aprcl -Itop/cmdParser -Itop/ -Ifactor/gmp-ecm   -I../ysieve -I../ytools -I../msieve/zlib -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch"
}

package() {
	cd ${srcdir}/ysieve
	install -Dm755 ysieve ${pkgdir}/usr/bin/ysieve

	cd ${srcdir}/yafu
	install -Dm755 yafu ${pkgdir}/usr/bin/yafu
	install -Dm644 yafu.ini -t ${pkgdir}/etc/yafu
	install -Dm644 README -t ${pkgdir}/usr/share/doc/yafu
	install -Dm644 CHANGES -t ${pkgdir}/usr/share/doc/yafu
	install -Dm644 docfile.txt -t ${pkgdir}/usr/share/doc/yafu
}