summaryrefslogtreecommitdiff
path: root/python-pyepics/PKGBUILD
blob: f677b0f84d385f6f04a6d170a0df5223d0873011 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
pkgbase=python-pyepics
pkgname=(python2-pyepics python-pyepics)
_pkgname="${pkgbase#*-}"
pkgver=3.4.0
pkgrel=4
pkgdesc='Python Interface to the Epics Channel Access protocol of the Epics control system'
arch=('i686' 'pentium4' 'x86_64')
url='https://pypi.python.org/pypi/pyepics'
license=('Epics Open License')
groups=()
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_makedepends=(
  'python-setuptools'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_makedepends[@]}"
  "${_makedepends[@]/ython/ython2}"
)
source=(
    "https://pypi.python.org/packages/99/99/398cd2dbdabf889072546e997da635c3f6ddb3e00439653f2f41cf936875/${_pkgname}-${pkgver}.tar.gz"
)
sha512sums=('b7b2bbece6b180d21f45b3fced273b9ee98604a82543bf4579c5fc37cffc04fa3f7843dea2b38518748cae7120f41f69a41483afcf49374b8fde1e7b0b7f329b')

prepare() {
  cp -a ${_pkgname}-${pkgver}{,-py2}
}

build() {
  echo "Building python..."
  (
    cd ${_pkgname}-${pkgver}
    python setup.py build
  )
  echo "Building python2..."
  (
    cd ${_pkgname}-${pkgver}-py2
    python2 setup.py build
  )
}

package_python-pyepics() {
  depends=(
    "${_deppy[@]}"
  )
  cd ${_pkgname}-${pkgver}
  python setup.py install --skip-build --root="${pkgdir}" --prefix=/usr
}

package_python2-pyepics() {
  depends=(
    "${_deppy2[@]}"
  )
  cd ${_pkgname}-${pkgver}-py2
  python2 setup.py install --skip-build --root="${pkgdir}" --prefix=/usr
  find "${pkgdir}" -type f -exec sed -si '1 s#[/ ]python\s*$# python2#' {} +
}