summaryrefslogtreecommitdiff
path: root/extra/python-pycurl/PKGBUILD
blob: de88e58cdfe1f12ad99a8a5607e889742ada62fd (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 208855 2014-03-27 14:43:37Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve> 

_pypiname=pycurl
pkgbase=python-$_pypiname
pkgname=('python-pycurl' 'python2-pycurl')
pkgver=7.19.3.1
pkgrel=2
arch=('i686' 'x86_64')
url="http://pycurl.sourceforge.net/"
license=('LGPL' 'MIT')
makedepends=('python' 'python2' 'curl' 'git')
source=("git+https://github.com/pycurl/pycurl.git#tag=REL_${pkgver//./_}")
sha1sums=('SKIP')

prepare() {
  cp -r ${_pypiname} python2-${_pypiname}

  cd "${srcdir}/${_pypiname}"
  find . -name '*.py' -exec sed -i -e "s|#! /usr/bin/env python|#!/usr/bin/env python3|" {} +
    sed -i 's/"share", "doc", PACKAGE/"share", "doc", "python-pycurl"/' setup.py

  cd "${srcdir}/python2-${_pypiname}"
  find . -name '*.py' -exec sed -i -e "s|#! /usr/bin/env python|#!/usr/bin/env python2|" {} +
    sed -i 's/"share", "doc", PACKAGE/"share", "doc", "python2-pycurl"/' setup.py
}

build() {
  cd "${srcdir}/${_pypiname}"
  python3 setup.py build --with-ssl

  cd "${srcdir}/python2-${_pypiname}"
  python2 setup.py build --with-ssl
}

package_python-pycurl() {
  pkgdesc="A Python 3.x interface to libcurl"
  depends=('python' 'curl')

  cd ${_pypiname}
  python setup.py install -O1 --root="${pkgdir}"
  install -D -m644 COPYING-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_python2-pycurl() {
  pkgdesc="A Python 2.x interface to libcurl"
  depends=('python2' 'curl')

  cd python2-${_pypiname}
  python2 setup.py install -O1 --root="${pkgdir}"
  install -D -m644 COPYING-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}