summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c3bd92f7d350fef9bde547eb56350557cee9741d (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
pkgname=python30
pkgver=3.0.1
pkgrel=1
_pybasever=3.0
pkgdesc="Next generation of the python high-level scripting language"
arch=('i686' 'x86_64')
license=('custom')
url="http://www.python.org/"
depends=('expat' 'bzip2' 'gdbm' 'openssl' 'libffi' 'zlib')
makedepends=('tk' 'sqlite' 'valgrind')
optdepends=('tk: for tkinter' 'sqlite')
provides=('python3')
replaces=('python3')
options=('!makeflags')
source=(http://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tar.bz2)
sha256sums=('91afb6ac16d3d22bc6bfbc80726dc85ede32bf838f660cc67016c7d0a7079add')

build() {
  cd "${srcdir}/Python-${pkgver}"

  # FS#23997
  sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python|" Lib/cgi.py

  # Ensure that we are using the system copy of various libraries
  # (expat, zlib), rather than copies shipped in the tarball
  rm -r Modules/expat
  rm -r Modules/zlib

  ./configure --prefix=/usr \
              --enable-shared \
              --with-threads \
              --with-computed-gotos \
              --enable-ipv6 \
              --with-valgrind \
              --with-system-expat \
              --with-dbmliborder=gdbm:ndbm \
              --with-system-ffi

  # Use the hg revision, fixes build process
  make SVNVERSION=51576
}

check_DISABLED() {
  cd "${srcdir}/Python-${pkgver}"
  LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \
     "${srcdir}/Python-${pkgver}/python" -m test.regrtest -x test_distutils test_site \
     test_urllib test_uuid test_pydoc
}

package() {
  cd "${srcdir}/Python-${pkgver}"
  make DESTDIR="${pkgdir}" altinstall maninstall

  # fix conflicts with python
  mv "${pkgdir}"/usr/bin/idle{,-3.0}
  mv "${pkgdir}"/usr/bin/pydoc{,-3.0}
  mv "${pkgdir}"/usr/bin/2to3{,-3.0}
  # Make it more clear smtpd.py is from an old version
  mv "${pkgdir}"/usr/bin/smtpd{,${_pybasever}}.py

  # Fix FS#22552
  ln -sf ../../libpython${_pybasever}.so \
    ${pkgdir}/usr/lib/python${_pybasever}/config/libpython${_pybasever}.so

  # Clean-up reference to build directory
  sed -i "s|$srcdir/Python-${pkgver}:||" "$pkgdir/usr/lib/python${_pybasever}/config/Makefile"

  # License
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}