1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
7 %define py3kdate 20081210
12 %define tools_dir %{_libdir}/python%{pybasever}/Tools
13 %define demo_dir %{_libdir}/python%{pybasever}/Demo
14 %define doc_tools_dir %{_libdir}/python%{pybasever}/Doc/tools
18 Release: 0.1.svn%{py3kdate}.%{?dist}
19 Summary: MinGW Windows port of Python 3 programming language
22 Group: Development/Libraries
23 URL: http://www.python.org/
24 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
28 # svn co http://svn.python.org/projects/python/branches/py3k py3k
29 # tar --exclude .svn -zcf /tmp/py3k-%{py3kdate}.tar.gz py3k
30 Source0: py3k-%{py3kdate}.tar.gz
32 # These are needed by ./configure when cross-compiling.
33 Source1000: config.guess
34 Source1001: config.sub
36 # The Python configure.in uses AC_STRUCT_ST_BLOCKS which wants a
37 # replacement fileblocks.c file if stat.st_blocks doesn't exist.
38 # We could use 'lib/fileblocks.c' from Gnulib (under GPL), but
39 # instead an empty file will do. (Thanks Jim Meyering).
40 Source1002: fileblocks.c
42 # Basic cross-compilation patch, mainly derived from
43 # http://bugs.python.org/issue1597850
44 Patch1000: mingw32-python-3.1-cross-build.patch
46 # Windows has setlocale but not LC_CTYPE.
47 Patch1001: mingw32-python-3.1-lc_ctype.patch
49 # Get posix module working.
50 Patch1002: mingw32-python-3.1-posixmodule.patch
52 # Get miscellaneous modules working.
53 Patch1003: mingw32-python-3.1-misc-modules.patch
55 # Get pwdmodule working (only barely functional on Windows).
56 Patch1004: mingw32-python-3.1-pwdmodule.patch
58 BuildRequires: mingw32-filesystem >= 40
59 BuildRequires: mingw32-gcc
60 BuildRequires: mingw32-binutils
62 # Only some of these deps have been ported to MinGW so far. The
63 # rest are listed here as they appear in the native python spec,
64 # just so remember them.
65 BuildPrereq: mingw32-readline
66 BuildPrereq: mingw32-openssl
67 #BuildPrereq: gmp-devel
68 #BuildPrereq: ncurses-devel <- doesn't exist for MinGW
69 BuildPrereq: mingw32-pdcurses
70 BuildPrereq: mingw32-gdbm
71 BuildPrereq: mingw32-zlib
72 BuildPrereq: mingw32-expat
73 #BuildPrereq: libGL-devel
76 BuildPrereq: mingw32-gcc-c++
77 #BuildPrereq: libX11-devel <- no equivalent for MinGW
78 #BuildPrereq: glibc-devel <- no equivalent for MinGW
79 #BuildPrereq: tcl-devel
80 #BuildPrereq: tk-devel
81 #BuildPrereq: tix-devel
82 BuildPrereq: mingw32-bzip2
83 BuildPrereq: mingw32-sqlite
84 #BuildPrereq: db4-devel >= 4.7
86 # Native dependencies.
89 BuildPrereq: /usr/bin/find
90 BuildPrereq: pkgconfig
93 # Will be required for cross-build.
94 #BuildRequires: python = %{version}
98 Python is an interpreted, interactive, object-oriented programming
99 language often compared to Tcl, Perl, Scheme or Java. Python includes
100 modules, classes, exceptions, very high level dynamic data types and
103 This packages is the MinGW port of the CPython interpreter,
104 development tools and libraries.
118 cp %{SOURCE1002} Python/
124 # Export these to avoid failing a cross-test in configure:
125 export ac_cv_file__dev_ptmx=no
126 export ac_cv_file__dev_ptc=no
127 export ac_cv_printf_zd_format=yes
129 %{_mingw32_configure} \
130 --enable-unicode=%{unicode} \
134 make OPT="%{_mingw32_cflags}"
139 LD_LIBRARY_PATH=$topdir \
141 Tools/scripts/pathfix.py -i "%{_bindir}/env python%{pybasever}" .
142 # Rebuild with new python
143 # We need a link to a versioned python in the build directory
144 ln -s python python%{pybasever}
145 LD_LIBRARY_PATH=$topdir \
147 make -s OPT="$CFLAGS"
152 rm -rf $RPM_BUILD_ROOT
154 make DESTDIR=$RPM_BUILD_ROOT install
156 # Remove static libraries but DON'T remove *.dll.a files.
157 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libfoo.a
161 rm -rf $RPM_BUILD_ROOT
165 %defattr(-,root,root)
166 %{_mingw32_bindir}/foo.dll
167 %{_mingw32_libdir}/foo.dll.a
172 * Fri Oct 24 2008 Richard W.M. Jones <rjones@redhat.com> - 2.5.2-1
173 - Initial RPM release.