summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 99f5f1460cd119f647c493fe4f0ee119c7135e36 (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
71
# Maintainer: Gordian Edenhofer <gordian.edenhofer@gmail.com>

pkgbase=python-scikit-surprise
pkgname=("python-scikit-surprise" "python2-scikit-surprise")
_reponame="Surprise"
pkgver=1.0.6
pkgrel=1
pkgdesc="Python scikit for building and analyzing recommender systems"
arch=('any')
license=('BSD-3-Clause')
url="https://github.com/NicolasHug/${_reponame}"
depends=('')
makedepends=('git' 'python-setuptools' 'python2-setuptools' 'cython' 'cython2' 'python-numpy' 'python2-numpy')
provides=("")
conflicts=("")
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/NicolasHug/${_reponame}/archive/v${pkgver}.tar.gz")
sha512sums=('6ae60b522bec70c4b2dc55bda5e8d1bd4566a865a7ef803c03e29ea3eedaa625558e5019136d9b69c364e963638f3968b006c82a51f8422c538b523fa4cc805b')

prepare() {
	cp -a "${srcdir}/${_reponame}-${pkgver}"{,-py2}
}

build_python-scikit-surprise() {
	cd "${srcdir}/${_reponame}-${pkgver}"
	python setup.py clean
	rm -rf build dist
	python setup.py build
}

build_python2-scikit-surprise() {
	cd "${srcdir}/${_reponame}-${pkgver}-py2"
	python2 setup.py clean
	rm -rf build dist
	python2 setup.py build
}

package_python-scikit-surprise() {
	depends=('python-joblib' 'python-numpy' 'python-scipy' 'python-six')
	optdepends=("flake8: code linting to comply with contributing standards"
		"python-pandas: dataframe handling"
		"python-pytest: test suite"
		"python-sphinx: documentation generator"
		"python-sphinx_rtd_theme: Read The Docs theme for documentation generator"
		"python-sphinxcontrib-spelling: spelling extension for documentation generator")
	provides=("python-scikit-surprise=${pkgver}")
	conflicts=("python-scikit-surprise")

	cd "${srcdir}/${_reponame}-${pkgver}"
	python setup.py install --root="${pkgdir}" --optimize=1
	ln -s "${pkgdir}/usr/bin/surprise"{,3}

	install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname///}/LICENSE"
}

package_python2-scikit-surprise() {
	depends=('python2-joblib' 'python2-numpy' 'python2-scipy' 'python2-six')
	optdepends=("python2-flake8: code linting to comply with contributing standards"
		"python2-pandas: dataframe handling"
		"python2-pytest: test suite"
		"python2-sphinx: documentation generator"
		"python2-sphinx_rtd_theme: Read The Docs theme for documentation generator"
		"python2-sphinxcontrib-spelling: spelling extension for documentation generator")
	provides=("python2-scikit-surprise=${pkgver}")
	conflicts=("python2-scikit-surprise")

	cd "${srcdir}/${_reponame}-${pkgver}-py2"
	python2 setup.py install --root="${pkgdir}" --optimize=1
	mv "${pkgdir}/usr/bin/surprise"{,2}

	install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname///}/LICENSE"
}