]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blobdiff - python/python.nm
Merge remote-tracking branch 'arne_f/autoconf'
[people/arne_f/ipfire-3.x.git] / python / python.nm
index 0da36063b0678e29ddabf59bbd034d30b49ac4b8..c4c0c7d79cfaed49781e6f8f46090c070a75eef6 100644 (file)
@@ -6,7 +6,7 @@
 name       = python
 major_ver  = 2.7
 version    = %{major_ver}.2
-release    = 3
+release    = 7
 thisapp    = Python-%{version}
 
 groups     = Development/Languages
@@ -30,9 +30,8 @@ build
                autoconf
                automake
                bzip2-devel
-               db4-devel
+               db4-devel >= 1:4.8
                expat-devel
-               gdbm-devel
                libffi-devel
                libselinux-devel
                ncurses-devel
@@ -47,7 +46,11 @@ build
        export CFLAGS  += -D_GNU_SOURCE -fwrapv
 
        prepare_cmds
-               sed -e "s/#*shared*/*shared*/g" -i Modules/Setup.dist
+               # Apply patches for x86_64.
+               if [ "$(uname -m)" = "x86_64" ]; then
+                       patch -Np1 -i %{DIR_SOURCE}/python-2.7.1-lib64.patch
+                       patch -Np1 -i %{DIR_SOURCE}/python-2.7-lib64-sysconfig.patch
+               fi
 
                # Remove embedded copies of expat, zlib and libffi
                rm -rf Modules/{expat,zlib}
@@ -58,38 +61,49 @@ build
                autoreconf --force
        end
 
+       configure_options += \
+               --enable-ipv6 \
+               --enable-unicode=ucs4 \
+               --with-system-expat \
+               --with-system-ffi \
+               --enable-shared
+
        build
                export CPPFLAGS=$(pkg-config --cflags-only-I libffi)
 
                OPT="%{CFLAGS}" \
                        ./configure \
-                               --prefix=/usr \
-                               --enable-ipv6 \
-                               --enable-unicode=ucs4 \
-                               --with-system-expat \
-                               --with-system-ffi \
-                               --enable-shared
+                               %{configure_options}
 
                make %{PARALLELISMFLAGS}
        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}/usr/lib/python%{major_ver}/config/
+               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
+                       !%{libdir}/python*/config/Makefile \
+                       !%{includedir}/python*/pyconfig.h
+       end
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end