]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - python/python.nm
prevent kernel address space leak via dmesg or /proc files
[people/pmueller/ipfire-3.x.git] / python / python.nm
index dd4ea61bfb7ab415072a53d486d1094ced1ca22d..5cba0a2f39481340f8bbc9e13e09e183388fe238 100644 (file)
@@ -4,8 +4,9 @@
 ###############################################################################
 
 name       = python
-version    = 2.7.1
-release    = 3
+major_ver  = 2.7
+version    = %{major_ver}.12
+release    = 2
 thisapp    = Python-%{version}
 
 groups     = Development/Languages
@@ -21,70 +22,84 @@ description
        libraries, as well as to various windowing systems.
 end
 
-source_dl  =
-sources    = %{thisapp}.tgz
+source_dl  = http://python.org/ftp/python/%{version}/
+sources    = %{thisapp}.tar.xz
 
 build
        requires
                autoconf
                automake
                bzip2-devel
-               db4-devel
                expat-devel
                gdbm-devel
+               glibc-headers >= 2.16-4
+               libdb-devel
                libffi-devel
-               libselinux-devel
                ncurses-devel
                openssl-devel
-               pkg-config
+               pakfire-builder >= 0.9.23-4
                readline-devel
                sqlite-devel
                tar
+               util-linux
                zlib-devel
        end
 
        export CFLAGS  += -D_GNU_SOURCE -fwrapv
-       export CPPFLAGS = $(shell pkg-config --cflags-only-I libffi)
+       export CPPFLAGS = %(pkg-config --cflags-only-I libffi)
+       export OPT      = %{CFLAGS}
 
-       prepare_cmds
-               sed -e "s/#*shared*/*shared*/g" -i Modules/Setup.dist
+       if "%{lib}" == "lib64"
+               patches += %{DIR_SOURCE}/python-2.7.12-lib64.patch
+               patches += %{DIR_SOURCE}/python-2.7-lib64-sysconfig.patch
+       end
 
+       prepare_cmds
                # Remove embedded copies of expat, zlib and libffi
                rm -rf Modules/{expat,zlib}
                rm -rf Modules/_ctypes/{darwin,libffi,libffi_arm_wince,libffi_msvc,libffi_osx}
 
-               # Remove autoconf version check and reconfigure
-               sed -e "s/^version_required.*//" -i configure.in
+               # Reconfigure
                autoreconf --force
        end
 
-       build
-               OPT="%{CFLAGS}" \
-                       ./configure \
-                               --prefix=/usr \
-                               --enable-ipv6 \
-                               --with-system-expat \
-                               --with-system-ffi \
-                               --enable-shared
+       configure_options += \
+               --enable-ipv6 \
+               --enable-unicode=ucs4 \
+               --with-system-expat \
+               --with-system-ffi \
+               --enable-shared
 
-               make %{PARALLELISMFLAGS}
+       test
+               WITHIN_PYTHON_RPM_BUILD= EXTRATESTOPTS="--verbose" make test || :
        end
 
        install_cmds
                # All *.py files don't need to be executeable...
-               find %{BUILDROOT}/usr/lib/python*/ -name "*.py" | xargs chmod a-x -v
+               find %{BUILDROOT}%{libdir}/python*/ -name "*.py" | xargs -r chmod a-x -v
+
+               # Create symlink for shared lib.
+               ln -svf ../../libpython%{major_ver}.so %{BUILDROOT}%{libdir}/python%{major_ver}/config/
        end
 end
 
 packages
        package %{name}
+               # Define python-abi manually.
+               provides
+                       python-abi = %{major_ver}
+               end
        end
-       
+
        package %{name}-devel
                template DEVEL
-       
-               files =+ \
-                       !/usr/lib/python*/config/Makefile \
-                       !/usr/include/python*/pyconfig.h
+
+               files += \
+                       !%{libdir}/python*/config/Makefile \
+                       !%{includedir}/python*/pyconfig.h
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end