python-2.5.1: Split out .debug, tests and scripts into separate sub-packages to save...
[vuplus_openembedded] / packages / python / python_2.5.1.bb
1 DESCRIPTION = "Python Programming Language"
2 HOMEPAGE = "http://www.python.org"
3 LICENSE = "PSF"
4 SECTION = "devel/python"
5 PRIORITY = "optional"
6 MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
7 DEPENDS = "python-native readline zlib gdbm openssl"
8 PR = "ml5"
9
10 PYTHON_MAJMIN = "2.5"
11
12 SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
13            file://bindir-libdir.patch;patch=1 \
14            file://crosscompile.patch;patch=1 \
15            file://build-native-md5-sha.patch;patch=1 \
16            file://fix-tkinter-detection.patch;patch=1 \
17            file://enable-ctypes-module.patch;patch=1 \
18            file://some_configure_fixes.patch;patch=1;pnum=0 \
19            file://strict_aliasing_site.patch;patch=0;pnum=0 \
20            file://fix_pthread_site.patch;patch=0;pnum=0"
21
22 SRC_URI_append_opendreambox = " file://forced_largefile_support.patch;patch=1;pnum=1"
23
24 S = "${WORKDIR}/Python-${PV}"
25
26 inherit autotools
27
28 EXTRA_OECONF = "--with-threads --with-pymalloc --with-cyclic-gc \
29                 --without-cxx --with-signal-module --with-wctype-functions \
30                 --enable-shared"
31
32 #
33 # copy config.h and an appropriate Makefile for distutils.sysconfig
34 # which laters uses the information out of these to compile extensions
35 #
36 do_compile_prepend() {
37         install -d ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
38         install -d ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
39         install -m 0644 pyconfig.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
40         install -m 0644 Makefile Makefile.orig
41         install -m 0644 Makefile Makefile.backup
42         sed -e 's,${includedir},${STAGING_INCDIR},' < Makefile.backup > Makefile
43         install -m 0644 Makefile Makefile.backup
44         sed -e 's,${libdir},${STAGING_LIBDIR},' < Makefile.backup > Makefile
45         install -m 0644 Makefile ${STAGING_LIBDIR}/python${PYTHON_MAJMIN}/config/
46 }
47
48 do_compile() {
49         oe_runmake HOSTPGEN=${STAGING_BINDIR}/pgen \
50                    HOSTPYTHON=${STAGING_BINDIR}/python \
51                    STAGING_LIBDIR=${STAGING_LIBDIR} \
52                    STAGING_INCDIR=${STAGING_INCDIR} \
53                    PYTHON_LIBDIR=${S} \
54                    BUILD_SYS=${BUILD_SYS} \
55                    HOST_SYS=${HOST_SYS}
56 }
57
58 do_stage() {
59         install -m 0644 Include/*.h ${STAGING_INCDIR}/python${PYTHON_MAJMIN}/
60         oe_libinstall -a -so libpython2.5 ${STAGING_LIBDIR}
61 }
62
63 do_install() {
64         install -m 0644 Makefile.orig Makefile
65         oe_runmake HOSTPGEN=${STAGING_BINDIR}/pgen \
66                    HOSTPYTHON=${STAGING_BINDIR}/python \
67                    STAGING_LIBDIR=${STAGING_LIBDIR} \
68                    STAGING_INCDIR=${STAGING_INCDIR} \
69                    PYTHON_LIBDIR=${S} \
70                    BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
71                    DESTDIR=${D} install
72 }
73
74 include python-${PV}-manifest.inc
75
76 PACKAGES =+ "libpython2"
77 FILES_libpython2 = "${libdir}/libpython*"
78