summaryrefslogtreecommitdiff
path: root/community/python-scikit-learn/PKGBUILD
blob: ae64bf4d2912a112bcaf523eca1dc5e66332277a (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
# $Id: PKGBUILD 96814 2013-09-05 19:19:46Z aginiewicz $
# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>

pkgbase=python-scikit-learn
pkgname=('python2-scikit-learn' 'python-scikit-learn')
pkgver=0.14.1
pkgrel=1
pkgdesc="A set of python modules for machine learning and data mining"
arch=('i686' 'x86_64')
url="http://scikit-learn.sourceforge.net/"
license=('BSD')
makedepends=('python2-scipy' 'python-scipy' 'python2-setuptools' 'python-setuptools')
options=(!emptydirs)

source=("http://downloads.sourceforge.net/project/scikit-learn/scikit-learn-${pkgver}.tar.gz" 
        "LICENSE")
md5sums=('790ad23547bb7f428060636628e13491'
         '327083d2576cc0aad1b8f10b2bcd2974')

build() {
  cd "$srcdir"
  cp -a scikit-learn-$pkgver scikit-learn-py2-$pkgver

  msg "Building Python2"
  cd "$srcdir"/scikit-learn-py2-$pkgver
  python2 setup.py build

  msg "Building Python3"
  cd "$srcdir"/scikit-learn-$pkgver
  python setup.py build
}

package_python2-scikit-learn() {
  depends=('python2-scipy')
  cd "$srcdir"/scikit-learn-py2-$pkgver

  python2 setup.py install --root="$pkgdir"/ --optimize=1

  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
         -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    $(find "${pkgdir}" -name '*.py')

  install -D "$srcdir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package_python-scikit-learn() {
  depends=('python-scipy')
  cd "$srcdir"/scikit-learn-$pkgver

  python setup.py install --root="$pkgdir"/ --optimize=1

  install -D "$srcdir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}