SUNWPython26.spec
branchgnome-2-28
changeset 18447 25cb48fe3874
parent 16843 c28e4faeb83f
child 18465 cd328ce2aa5b
--- a/SUNWPython26.spec	Thu Dec 03 10:27:02 2009 +0000
+++ b/SUNWPython26.spec	Thu Dec 03 10:37:48 2009 +0000
@@ -16,7 +16,7 @@
 
 Name:                    SUNWPython26
 Summary:                 The Python interpreter, libraries and utilities
-Version:                 2.6.2
+Version:                 2.6.4
 %define majmin           2.6
 SUNW_BaseDir:            %{_basedir}
 SUNW_Copyright:          %{name}.copyright
@@ -74,6 +74,13 @@
 # PSARC/2009/529 Python interface to privileges(5) & rbac(5)
 # written by [email protected]
 Patch16:		 Python26-16-privrbac.diff
+# date:2009-12-01 owner:laca type:bug
+# netpacket/packet.h on Solaris is incompatible with
+# python's socketmodule.c
+Patch17:                 Python26-17-netpacket-packet-h.diff
+# date:2009-12-02 owner:laca type:bug
+# enable readline support on Solaris
+Patch18:                 Python26-18-readline.diff
 
 %include default-depend.inc
 BuildRequires: SUNWTk
@@ -99,6 +106,7 @@
 Requires: SUNWsqlite3
 Requires: SUNWlibffi
 Requires: SUNWncurses
+Requires: SUNWgnu-readline
 
 %package devel
 Summary:                 %{summary} - development files
@@ -124,6 +132,8 @@
 %patch14 -p1
 %patch15 -p1
 %patch16 -p1
+%patch17 -p1
+%patch18 -p1 -b .readline
 cd ..
 
 echo fixing python binary name/path in python scripts:
@@ -169,7 +179,7 @@
 export CXX="$CXX -xregs=no%frameptr -norunpath -compat=5"
 export CFLAGS="-I/usr/include/ncurses %optflags -D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
 export CPPFLAGS="-D_LARGEFILE64_SOURCE `pkg-config --cflags libffi`"
-export LDFLAGS="%_ldflags -L."
+export LDFLAGS="%_ldflags -L. -L/usr/gnu/lib"
 
 ./configure --prefix=%{_prefix} \
   --libdir=%{_libdir} \
@@ -193,12 +203,12 @@
 cd Python-%{version}-64
 
 export CXXFLAGS="%cxx_optflags64"
-export CFLAGS="-I/usr/include/ncurses  %optflags64 -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
-export CPPFLAGS="-I/usr/include/ncurses -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/_arch64 pkg-config --cflags libffi`"
+export CFLAGS="-I/usr/include/ncurses  %optflags64 -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/%{_arch64} pkg-config --cflags libffi`"
+export CPPFLAGS="-I/usr/include/ncurses -D_LARGEFILE64_SOURCE `PKG_CONFIG_PATH=%{_libdir}/%{_arch64} pkg-config --cflags libffi`"
 export CC="$CC %optflags64"
 export CXX="$CXX %cxx_optflags64"
 export DFLAGS=-64
-export LDFLAGS="%_ldflags -L."
+export LDFLAGS="%_ldflags -L. -L/usr/gnu/lib/%{_arch64}"
 
 autoheader
 autoconf
@@ -296,23 +306,33 @@
 rm python-config
 mv python%{majmin} isapython%{majmin}
 ln -s isapython%{majmin} python%{majmin}
+# this is the default python
+ln -s python%{majmin} python
 # don't need a 64-bit version of this tool
 rm 2to3
 cd ..
 %endif
 
+# this becomes a hard link in the pkgmap, due to %hard
 ln -s ../lib/isaexec isapython%{majmin}
-# FIXME: because python 2.5 is not the default
-# ln -s python%{majmin} python
-rm python-config
+
+# this is the default python
+ln -s python%{majmin} python
 
 %{?pkgbuild_postprocess: %pkgbuild_postprocess -v -c "%{version}:%{jds_version}:%{name}:$RPM_ARCH:%(date +%%Y-%%m-%%d):%{support_level}" $RPM_BUILD_ROOT}
 
 # sanity check: verify that some tricky modules were successfully built:
 for f in _ctypes.so _curses.so _curses_panel.so _elementtree.so \
     _multiprocessing.so _sqlite3.so _ssl.so _tkinter.so crypt.so \
-    pyexpat.so sunaudiodev.so zlib.so dlpi.so ucred.so bz2.so\
-    64/_ctypes.so 64/_curses.so 64/_curses_panel.so 64/_elementtree.so \
+    pyexpat.so sunaudiodev.so zlib.so dlpi.so ucred.so bz2.so; do
+    test -f $RPM_BUILD_ROOT%{_libdir}/python%{majmin}/lib-dynload/$f || {
+	echo ERROR: required module $f missing
+	exit 1
+    }
+done
+
+%ifarch amd64 sparcv9
+for f in 64/_ctypes.so 64/_curses.so 64/_curses_panel.so 64/_elementtree.so \
     64/_multiprocessing.so 64/_sqlite3.so 64/_ssl.so 64/_tkinter.so \
     64/crypt.so 64/dlpi.so 64/ucred.so 64/pyexpat.so 64/bz2.so 64/zlib.so \
     64/sunaudiodev.so; do
@@ -321,6 +341,7 @@
 	exit 1
     }
 done
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -329,6 +350,8 @@
 %defattr (-, root, bin)
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/python%{majmin}
+%{_bindir}/python-config
+%{_bindir}/python
 # hard link to isaexec
 %hard %{_bindir}/isapython%{majmin}
 %dir %attr (0755, root, bin) %{_bindir}/%{base_isa}
@@ -365,6 +388,7 @@
 %{_libdir}/%{_arch64}/lib*.so*
 %dir %attr(0755, root, bin) %{_bindir}/%{_arch64}
 %{_bindir}/%{_arch64}/python%{majmin}
+%{_bindir}/%{_arch64}/python
 %{_bindir}/%{_arch64}/isapython%{majmin}
 %endif
 %dir %attr(0755, root, sys) %{_datadir}
@@ -393,6 +417,16 @@
 %{_libdir}/python?.?/py[cC][cC]
 
 %changelog
+* Thu Dec  3 2009 - [email protected]
+- bump to 2.6.4
+- add patch readline.diff for enabling the build of the readline module
+- point /usr/bin/python to python2.6
+* Tue Dec  1 2009 - [email protected]
+- add a nicer fix for the netpacket/packet.h build issue
+* Thu Nov 19 2009 - [email protected]
+- Add Python26-17-disable-netpacket_h. SUNWpacketh delivers 
+  /usr/include/netpacket/packet.h which is incompatible with this version of 
+  Python. Patch disables use of packet.h.
 * Mon Aug 31 2009 - [email protected]
 - add patch getcwd.diff, fixes 6816108 and setting CCSHARED to -KPIC -zignore
   fixes 6871151