Backport RPM boilerplate logic for legacy OpenPKG and update version.

Tue, 20 Sep 2011 15:24:08 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 20 Sep 2011 15:24:08 +0200
changeset 370
6475ac4895a9
parent 369
3429ba7ff8dc
child 371
3d7d8c68b2fc

Backport RPM boilerplate logic for legacy OpenPKG and update version.

python/python.patch file | annotate | diff | comparison | revisions
python/python.spec file | annotate | diff | comparison | revisions
     1.1 --- a/python/python.patch	Tue Sep 20 15:22:39 2011 +0200
     1.2 +++ b/python/python.patch	Tue Sep 20 15:24:08 2011 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  Index: configure
     1.5  --- configure.orig	2010-11-01 02:47:19.000000000 +0100
     1.6  +++ configure	2010-12-05 18:07:39.000000000 +0100
     1.7 -@@ -3904,9 +3904,9 @@
     1.8 +@@ -3920,9 +3920,9 @@
     1.9     CFLAGS=$ac_save_CFLAGS
    1.10   elif test $ac_cv_prog_cc_g = yes; then
    1.11     if test "$GCC" = yes; then
    1.12 @@ -13,7 +13,7 @@
    1.13     fi
    1.14   else
    1.15     if test "$GCC" = yes; then
    1.16 -@@ -5352,7 +5352,7 @@
    1.17 +@@ -5425,7 +5425,7 @@
    1.18   		# debug builds.
    1.19   		OPT="-g -O0 -Wall $STRICT_PROTO"
    1.20   	    else
    1.21 @@ -22,38 +22,7 @@
    1.22   	    fi
    1.23   	    ;;
    1.24   	*)
    1.25 -@@ -7627,24 +7627,24 @@
    1.26 - 	FreeBSD*)
    1.27 - 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
    1.28 - 		then
    1.29 --			LDSHARED='$(CC) -shared ${LDFLAGS}'
    1.30 --			LDCXXSHARED='$(CXX) -shared ${LDFLAGS}'
    1.31 -+			LDSHARED="\$(CC) -shared ${LDFLAGS}"
    1.32 -+			LDCXXSHARED="\$(CXX) -shared ${LDFLAGS}"
    1.33 - 		else
    1.34 - 			LDSHARED="ld -Bshareable ${LDFLAGS}"
    1.35 - 		fi;;
    1.36 - 	OpenBSD*)
    1.37 - 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
    1.38 - 		then
    1.39 --				LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
    1.40 --				LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
    1.41 -+				LDSHARED="\$(CC) -shared \$(CCSHARED) ${LDFLAGS}"
    1.42 -+				LDCXXSHARED="\$(CXX) -shared \$(CCSHARED) ${LDFLAGS}"
    1.43 - 		else
    1.44 - 				case `uname -r` in
    1.45 - 				[01].* | 2.[0-7] | 2.[0-7].*)
    1.46 - 				   LDSHARED="ld -Bshareable ${LDFLAGS}"
    1.47 - 				   ;;
    1.48 - 				*)
    1.49 --				   LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}'
    1.50 --				   LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}'
    1.51 -+				   LDSHARED="\$(CC) -shared \$(CCSHARED) ${LDFLAGS}"
    1.52 -+				   LDCXXSHARED="\$(CXX) -shared \$(CCSHARED) ${LDFLAGS}"
    1.53 - 				   ;;
    1.54 - 				esac
    1.55 - 		fi;;
    1.56 -@@ -7751,7 +7751,7 @@
    1.57 +@@ -7813,7 +7813,7 @@
    1.58   		then
    1.59   			LINKFORSHARED="-Wl,--export-dynamic"
    1.60   		fi;;
    1.61 @@ -65,7 +34,7 @@
    1.62  Index: setup.py
    1.63  --- setup.py.orig	2010-10-31 17:40:21.000000000 +0100
    1.64  +++ setup.py	2010-12-05 18:05:56.000000000 +0100
    1.65 -@@ -347,8 +347,8 @@
    1.66 +@@ -369,8 +369,8 @@
    1.67   
    1.68       def detect_modules(self):
    1.69           # Ensure that /usr/local is always used
    1.70 @@ -73,10 +42,10 @@
    1.71  -        add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
    1.72  +        add_dir_to_list(self.compiler.library_dirs, '@l_prefix@/lib')
    1.73  +        add_dir_to_list(self.compiler.include_dirs, '@l_prefix@/include')
    1.74 +         self.add_multiarch_paths()
    1.75   
    1.76           # Add paths specified in the environment variables LDFLAGS and
    1.77 -         # CPPFLAGS for header and library files.
    1.78 -@@ -680,8 +680,6 @@
    1.79 +@@ -703,8 +703,6 @@
    1.80                                  depends = ['socketmodule.h']) )
    1.81           # Detect SSL support for the socket module (via _ssl)
    1.82           search_for_ssl_incs_in = [
    1.83 @@ -85,7 +54,7 @@
    1.84                                ]
    1.85           ssl_incs = find_file('openssl/ssl.h', inc_dirs,
    1.86                                search_for_ssl_incs_in
    1.87 -@@ -692,8 +690,7 @@
    1.88 +@@ -715,8 +713,7 @@
    1.89               if krb5_h:
    1.90                   ssl_incs += krb5_h
    1.91           ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
    1.92 @@ -95,7 +64,7 @@
    1.93                                        ] )
    1.94   
    1.95           if (ssl_incs is not None and
    1.96 -@@ -813,14 +810,8 @@
    1.97 +@@ -836,14 +833,8 @@
    1.98           # top of the normal inc_dirs.
    1.99           db_inc_paths = [
   1.100               '/usr/include/db4',
   1.101 @@ -110,7 +79,7 @@
   1.102           ]
   1.103           # 4.x minor number specific paths
   1.104           for x in gen_db_minor_ver_nums(4):
   1.105 -@@ -1708,6 +1699,7 @@
   1.106 +@@ -1731,6 +1722,7 @@
   1.107                   dotversion = dotversion[:-1] + '.' + dotversion[-1]
   1.108               tcl_include_sub = []
   1.109               tk_include_sub = []
   1.110 @@ -118,3 +87,4 @@
   1.111               for dir in inc_dirs:
   1.112                   tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
   1.113                   tk_include_sub += [dir + os.sep + "tk" + dotversion]
   1.114 +Common subdirectories: Python-2.7.2.orig/Tools and Python-2.7.2/Tools
     2.1 --- a/python/python.spec	Tue Sep 20 15:22:39 2011 +0200
     2.2 +++ b/python/python.spec	Tue Sep 20 15:24:08 2011 +0200
     2.3 @@ -1,6 +1,6 @@
     2.4  ##
     2.5  ##  python.spec -- OpenPKG RPM Package Specification
     2.6 -##  Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.7 +##  Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
     2.8  ##
     2.9  ##  Permission to use, copy, modify, and distribute this software for
    2.10  ##  any purpose with or without fee is hereby granted, provided that
    2.11 @@ -31,8 +31,8 @@
    2.12  Class:        BASE
    2.13  Group:        Language
    2.14  License:      GPL
    2.15 -Version:      2.7.1
    2.16 -Release:      20110212
    2.17 +Version:      2.7.2
    2.18 +Release:      20110914
    2.19  
    2.20  #   package options
    2.21  %option       with_readline      no
    2.22 @@ -50,8 +50,10 @@
    2.23  Patch0:       python.patch
    2.24  
    2.25  #   build information
    2.26 -BuildPreReq:  OpenPKG, openpkg >= 20100101, gcc
    2.27 -PreReq:       OpenPKG, openpkg >= 20100101, gcc
    2.28 +Prefix:       %{l_prefix}
    2.29 +BuildRoot:    %{l_buildroot}
    2.30 +BuildPreReq:  OpenPKG, openpkg >= 20060823, gcc
    2.31 +PreReq:       OpenPKG, openpkg >= 20060823, gcc
    2.32  BuildPreReq:  zlib
    2.33  PreReq:       zlib
    2.34  %if "%{with_readline}" == "yes"
    2.35 @@ -90,6 +92,8 @@
    2.36  BuildPreReq:  openssl
    2.37  PreReq:       openssl
    2.38  %endif
    2.39 +AutoReq:      no
    2.40 +AutoReqProv:  no
    2.41  
    2.42  %description
    2.43      Python is an interpreted, interactive, object-oriented programming
    2.44 @@ -111,10 +115,10 @@
    2.45  %prep
    2.46      %setup -q -n Python-%{version}
    2.47      %patch -p0
    2.48 -
    2.49 -%build
    2.50 -    %{l_shtool} subst %{l_value -s -a} \
    2.51 -        setup.py
    2.52 +    %{l_shtool} subst \
    2.53 +        -e 's;\(LDSHARED=.*\)\$(CC);\1\\$(CC);g' \
    2.54 +        -e 's;\(LDCXXSHARED=.*\)\$(CXX);\1\\$(CXX);g' \
    2.55 +        configure
    2.56      %{l_shtool} subst \
    2.57          -e 's;altinstall bininstall maninstall;altinstall maninstall;' \
    2.58          -e 's;python$(VERSION);python;g' \
    2.59 @@ -132,6 +136,9 @@
    2.60      %{l_shtool} subst \
    2.61          -e 's;python{py_version_short};python;g' \
    2.62          Lib/sysconfig.py
    2.63 +
    2.64 +%build
    2.65 +    echo "" >config.cache
    2.66  %if "%{with_readline}" == "yes"
    2.67      ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap"
    2.68      ) >>Modules/Setup.local
    2.69 @@ -173,6 +180,12 @@
    2.70      ) >>Modules/Setup.local
    2.71  %endif
    2.72  
    2.73 +    #   getaddrinfo bug
    2.74 +    disableipv6=""
    2.75 +    case "%{l_platform -t}" in
    2.76 +        *-aix* ) disableipv6="--disable-ipv6" ;;
    2.77 +    esac
    2.78 +
    2.79      CC="%{l_prefix}/bin/gcc" \
    2.80      CXX="%{l_cxx}" \
    2.81      CFLAGS="%{l_cflags -O}" \
    2.82 @@ -180,13 +193,17 @@
    2.83      CXXFLAGS="%{l_cxxflags -O}" \
    2.84      LDFLAGS="%{l_ldflags}" \
    2.85      ./configure \
    2.86 +        --cache-file=./config.cache \
    2.87 +        --with-gcc \
    2.88 +        $disableipv6 \
    2.89          --prefix=%{l_prefix} \
    2.90          --mandir=%{l_prefix}/man \
    2.91          --with-dbmliborder=ndbm \
    2.92          --with-gcc
    2.93 -    %{l_make} %{l_mflags}
    2.94 +    %{l_make} %{l_mflags -O}
    2.95  
    2.96  %install
    2.97 +    rm -rf $RPM_BUILD_ROOT
    2.98      %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
    2.99      ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \
   2.100         $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a
   2.101 @@ -199,4 +216,5 @@
   2.102  %files -f files
   2.103  
   2.104  %clean
   2.105 +    rm -rf $RPM_BUILD_ROOT
   2.106  

mercurial