summaryrefslogtreecommitdiff
path: root/python/Pkgfile
blob: 6618bbf6e7ba48d85183035ec9da37789368aa22 (plain)
    1 # Description: Python interpreter, version 2.7
    2 # URL:         https://www.python.org
    3 # Maintainer:  Juergen Daubert, jue at crux dot nu
    4 # Depends on:  db gdbm openssl bzip2 zlib sqlite3
    5 
    6 name=python
    7 version=2.7.18
    8 release=3
    9 source=(https://www.python.org/ftp/$name/${version::6}/Python-$version.tar.xz \
   10         pyconfig.h \
   11 	CVE-2019-20907.patch \
   12 	CVE-2020-26116.patch \
   13 	CVE-2021-3177.patch)
   14 
   15 build () {
   16     cd Python-$version
   17 
   18     patch -p1 -i $SRC/CVE-2019-20907.patch
   19     patch -p1 -i $SRC/CVE-2020-26116.patch
   20     patch -p1 -i $SRC/CVE-2021-3177.patch
   21 
   22     # remove 2to3, we use the one from python3
   23     rm -r Lib/lib2to3
   24 
   25     # remove tests
   26     rm -r Lib/{bsddb,ctypes,email,lib-tk,sqlite3,unittest}/test
   27     rm -r Lib/{{distutils,json}/tests,idlelib/idle_test,test}
   28 
   29     ./configure --prefix=/usr \
   30                 --enable-shared \
   31                 --with-threads \
   32                 --enable-ipv6 
   33 
   34     make 
   35     make -j1 DESTDIR=$PKG install
   36 
   37     # fix issue with man-page symlink
   38     ln -sf python2.7.1 $PKG/usr/share//man/man1/python.1
   39 
   40     ln -sf python2.7 $PKG/usr/bin/python
   41     ln -s python2.7 $PKG/usr/lib/python
   42     ln -s python2.7 $PKG/usr/include/python
   43     ln -s /usr/lib/libpython2.7.so $PKG/usr/lib/python2.7/config/libpython2.7.so
   44 
   45     rm $PKG/usr/bin/2to3
   46     rm $PKG/usr/lib/python/{distutils,site-packages}/README
   47     rm $PKG/usr/lib/python/idlelib/{ChangeLog,{NEWS,README,TODO}.txt}
   48     rm $PKG/usr/lib/python/ctypes/macholib/README.ctypes
   49 
   50     mv $PKG/usr/include/python2.7/pyconfig{,-64}.h
   51     install -m 0644 $SRC/pyconfig.h $PKG/usr/include/python2.7/
   52 }

Generated by cgit