opt/python/Pkgfile

53 lines
1.5 KiB
Plaintext
Raw Normal View History

2010-08-31 22:55:01 +02:00
# Description: Python interpreter, version 2.7
2020-06-06 13:00:05 +02:00
# URL: https://www.python.org
2011-02-02 13:44:37 +01:00
# Maintainer: Juergen Daubert, jue at crux dot nu
2013-04-07 10:49:36 +02:00
# Depends on: db gdbm openssl bzip2 zlib sqlite3
2006-02-23 16:26:10 +01:00
name=python
2020-04-26 18:22:18 +02:00
version=2.7.18
release=3
2020-06-06 13:00:05 +02:00
source=(https://www.python.org/ftp/$name/${version::6}/Python-$version.tar.xz \
pyconfig.h \
CVE-2019-20907.patch \
CVE-2020-26116.patch \
CVE-2021-3177.patch)
2006-02-23 16:26:10 +01:00
build () {
cd Python-$version
2013-04-07 10:49:36 +02:00
patch -p1 -i $SRC/CVE-2019-20907.patch
patch -p1 -i $SRC/CVE-2020-26116.patch
patch -p1 -i $SRC/CVE-2021-3177.patch
# remove 2to3, we use the one from python3
rm -r Lib/lib2to3
# remove tests
rm -r Lib/{bsddb,ctypes,email,lib-tk,sqlite3,unittest}/test
rm -r Lib/{{distutils,json}/tests,idlelib/idle_test,test}
2006-02-23 16:26:10 +01:00
./configure --prefix=/usr \
--enable-shared \
--with-threads \
2013-04-07 10:49:36 +02:00
--enable-ipv6
2013-04-07 10:49:36 +02:00
make
2007-04-19 08:40:41 +02:00
make -j1 DESTDIR=$PKG install
2008-03-12 17:14:20 +01:00
python: fix issue with man-page symlink 0) Problem: Some people have an additional link to the python man-page: is the python footprint mismatch something I can fix or am I missing anything important? NEW lrwxrwxrwx root/root usr/man/man1/python.1.gz -> python2.1.gz 1) the relevant part of Makefile.pre.in: maninstall: altmaninstall -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1) -rm -f $(DESTDIR)$(MANDIR)/man1/python.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1) 2) after 'make install' we have the following chain of symlinks: lrwxrwxrwx 1 juergen users 9 Apr 21 09:13 python.1 -> python2.1 lrwxrwxrwx 1 juergen users 11 Apr 21 09:13 python2.1 -> python2.7.1 -rw-r--r-- 1 juergen users 14582 Apr 21 09:12 python2.7.1 3) the compress_manpages function of our pkgmk: compress_manpages() { local FILE DIR TARGET cd $PKG find . -type f -path "*/man/man*/*" | while read FILE; do if [ "$FILE" = "${FILE%%.gz}" ]; then gzip -9 "$FILE" fi done find . -type l -path "*/man/man*/*" | while read FILE; do TARGET=`readlink -n "$FILE"` TARGET="${TARGET##*/}" TARGET="${TARGET%%.gz}.gz" rm -f "$FILE" FILE="${FILE%%.gz}.gz" DIR=`dirname "$FILE"` if [ -e "$DIR/$TARGET" ]; then ln -sf "$TARGET" "$FILE" fi done } 4) How it works: We search for real man-pages in $PKG and compress them, breaking all symlinks to these man-pages, which we repair afterwards. Fixing is done by adding a .gz extension to all targets of the symlinks. However, we do a test if $TARGET exists before we do the actual link, which is not the case if we have chained symlink and we do not process in the right order. For a "normal" collating we have the order python.1 before python2.1, so python2.1.gz does not exits at the time we process python.1
2013-04-21 11:48:33 +02:00
# fix issue with man-page symlink
2015-12-06 18:23:39 +01:00
ln -sf python2.7.1 $PKG/usr/share//man/man1/python.1
python: fix issue with man-page symlink 0) Problem: Some people have an additional link to the python man-page: is the python footprint mismatch something I can fix or am I missing anything important? NEW lrwxrwxrwx root/root usr/man/man1/python.1.gz -> python2.1.gz 1) the relevant part of Makefile.pre.in: maninstall: altmaninstall -rm -f $(DESTDIR)$(MANDIR)/man1/python2.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python2.1) -rm -f $(DESTDIR)$(MANDIR)/man1/python.1 (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python2.1 python.1) 2) after 'make install' we have the following chain of symlinks: lrwxrwxrwx 1 juergen users 9 Apr 21 09:13 python.1 -> python2.1 lrwxrwxrwx 1 juergen users 11 Apr 21 09:13 python2.1 -> python2.7.1 -rw-r--r-- 1 juergen users 14582 Apr 21 09:12 python2.7.1 3) the compress_manpages function of our pkgmk: compress_manpages() { local FILE DIR TARGET cd $PKG find . -type f -path "*/man/man*/*" | while read FILE; do if [ "$FILE" = "${FILE%%.gz}" ]; then gzip -9 "$FILE" fi done find . -type l -path "*/man/man*/*" | while read FILE; do TARGET=`readlink -n "$FILE"` TARGET="${TARGET##*/}" TARGET="${TARGET%%.gz}.gz" rm -f "$FILE" FILE="${FILE%%.gz}.gz" DIR=`dirname "$FILE"` if [ -e "$DIR/$TARGET" ]; then ln -sf "$TARGET" "$FILE" fi done } 4) How it works: We search for real man-pages in $PKG and compress them, breaking all symlinks to these man-pages, which we repair afterwards. Fixing is done by adding a .gz extension to all targets of the symlinks. However, we do a test if $TARGET exists before we do the actual link, which is not the case if we have chained symlink and we do not process in the right order. For a "normal" collating we have the order python.1 before python2.1, so python2.1.gz does not exits at the time we process python.1
2013-04-21 11:48:33 +02:00
2010-06-03 13:36:08 +02:00
ln -sf python2.7 $PKG/usr/bin/python
ln -s python2.7 $PKG/usr/lib/python
ln -s python2.7 $PKG/usr/include/python
ln -s /usr/lib/libpython2.7.so $PKG/usr/lib/python2.7/config/libpython2.7.so
2008-03-12 17:14:20 +01:00
rm $PKG/usr/bin/2to3
2019-03-08 14:11:54 +01:00
rm $PKG/usr/lib/python/{distutils,site-packages}/README
rm $PKG/usr/lib/python/idlelib/{ChangeLog,{NEWS,README,TODO}.txt}
2006-11-25 18:07:07 +01:00
rm $PKG/usr/lib/python/ctypes/macholib/README.ctypes
2013-04-07 10:49:36 +02:00
mv $PKG/usr/include/python2.7/pyconfig{,-64}.h
install -m 0644 $SRC/pyconfig.h $PKG/usr/include/python2.7/
2006-02-23 16:26:10 +01:00
}