]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - python/python.nm
python: Make package ready for x86_64.
[people/ms/ipfire-3.x.git] / python / python.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = python
7 major_ver = 2.7
8 version = %{major_ver}.2
9 release = 4
10 thisapp = Python-%{version}
11
12 groups = Development/Languages
13 url = http://www.python.org
14 license = Python
15 summary = An interpreted, interactive, object-oriented programming language.
16
17 description
18 Python is an interpreted, interactive, object-oriented programming
19 language often compared to Tcl, Perl, Scheme or Java. Python includes
20 modules, classes, exceptions, very high level dynamic data types and
21 dynamic typing. Python supports interfaces to many system calls and
22 libraries, as well as to various windowing systems.
23 end
24
25 source_dl = http://python.org/ftp/python/%{version}/
26 sources = %{thisapp}.tar.xz
27
28 build
29 requires
30 autoconf
31 automake
32 bzip2-devel
33 db4-devel
34 expat-devel
35 gdbm-devel
36 libffi-devel
37 libselinux-devel
38 ncurses-devel
39 openssl-devel
40 pkg-config
41 readline-devel
42 sqlite-devel
43 tar
44 zlib-devel
45 end
46
47 export CFLAGS += -D_GNU_SOURCE -fwrapv
48
49 prepare_cmds
50 # Apply patches for x86_64.
51 if [ "$(uname -m)" = "x86_64" ]; then
52 patch -Np1 -i %{DIR_SOURCE}/python-2.7.1-lib64.patch
53 patch -Np1 -i %{DIR_SOURCE}/python-2.7-lib64-sysconfig.patch
54 fi
55
56 sed -e "s/#*shared*/*shared*/g" -i Modules/Setup.dist
57
58 # Remove embedded copies of expat, zlib and libffi
59 rm -rf Modules/{expat,zlib}
60 rm -rf Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
61
62 # Remove autoconf version check and reconfigure
63 sed -e "s/^version_required.*//" -i configure.in
64 autoreconf --force
65 end
66
67 configure_options += \
68 --enable-ipv6 \
69 --enable-unicode=ucs4 \
70 --with-system-expat \
71 --with-system-ffi \
72 --enable-shared
73
74 build
75 export CPPFLAGS=$(pkg-config --cflags-only-I libffi)
76
77 OPT="%{CFLAGS}" \
78 ./configure \
79 %{configure_options}
80
81 make %{PARALLELISMFLAGS}
82 end
83
84 install_cmds
85 # All *.py files don't need to be executeable...
86 find %{BUILDROOT}%{libdir}/python*/ -name "*.py" | xargs -r chmod a-x -v
87
88 # Create symlink for shared lib.
89 ln -svf ../../libpython%{major_ver}.so %{BUILDROOT}%{libdir}/python%{major_ver}/config/
90 end
91 end
92
93 packages
94 package %{name}
95 # Define python-abi manually.
96 provides
97 python-abi = %{major_ver}
98 end
99 end
100
101 package %{name}-devel
102 template DEVEL
103
104 files += \
105 !%{libdir}/python*/config/Makefile \
106 !%{includedir}/python*/pyconfig.h
107 end
108
109 package %{name}-debuginfo
110 template DEBUGINFO
111 end
112 end