Browse Source

upload python3-3.2

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3491 ec354946-7b23-47d6-9f5a-488ba84defc7
owa 13 years ago
parent
commit
c199a0e0ca
1 changed files with 147 additions and 152 deletions
  1. 147 152
      p/python3/python3-vl.spec

+ 147 - 152
p/python3/python3-vl.spec

@@ -1,36 +1,31 @@
 # if you wanna test, add " --define '_run_test 1' " option to rpmbuild command
 %define run_test %{?_run_test:1}%{!?_run_test:0}
-%define TclTk 8.4
-%define pybasever 3.1
-%define python_lib %{_libdir}/python%{pybasever}
+%define libvers 3.2
+%define binsuffix 3.2
+%define python_lib %{_libdir}/python%{libvers}
+%define config_htmldir /var/www/html/python
 Summary: An interpreted, interactive, object-oriented programming language.
 Summary(ja): オブジェクト指向 Python3 インタプリタ
 Name: python3
-Version: %{pybasever}.3
-Release: 2%{?_dist_release}
-License: Modified CNRI Open Source License
+Version: 3.2
+Release: 1%{?_dist_release}
+License: PSF
 Group: Development/Languages
 URL: http://www.python.org/download/releases/%{version}
 Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
 Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2
-Patch0: python-3.1.3-Setup.dist.patch
-Patch10: python-3.1.3-locale.patch
-Patch100: python-3.1.3-lib64-Makefile.patch
-Patch101: python-3.1.3-lib64-setup.patch
-Patch102: python-3.1.3-lib64-site.patch
-Patch103: python-3.1.3-lib64-install.patch
-Patch104: python-3.1.3-lib64-sysconfig.patch
-Patch105: python-3.1.3-lib64-getpath.patch
-Patch106: python-3.1.3-lib64-test_install.patch
+Patch1: python-3.2b2-lib64.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRequires: expat-devel
+BuildRequires: db4-devel
+BuildRequires: gdbm-devel
+BuildRequires: sqlite3-devel
 BuildRequires: gzip tar gcc-c++ pkgconfig sed findutils
 BuildRequires: bzip2-devel
-BuildRequires: gdbm-devel
 BuildRequires: glibc-devel
 BuildRequires: ncurses-devel
 BuildRequires: openssl-devel
 BuildRequires: readline-devel
-BuildRequires: sqlite3-devel
 BuildRequires: zlib-devel
 BuildRequires: libffi-devel
 Requires: bzip2
@@ -46,20 +41,14 @@ Distribution: Vine Linux
 
 %description
 Python is an interpreted, interactive, object-oriented programming
-language often compared to Tcl, Perl, Scheme or Java. Python includes
-modules, classes, exceptions, very high level dynamic data types and
-dynamic typing. Python supports interfaces to many system calls and
-libraries, as well as to various windowing systems (X11, Motif, Tk,
-Mac and MFC).
-
-Programmers can write new built-in modules for Python in C or C++.
-Python can be used as an extension language for applications that need
-a programmable interface. This package contains most of the standard
-Python modules, as well as modules for interfacing to the Tix widget
-set for Tk and RPM.
-
-Note that documentation for Python is provided in the python-docs
-package.
+language.  It incorporates modules, exceptions, dynamic typing, very high
+level dynamic data types, and classes. Python combines remarkable power
+with very clear syntax. It has interfaces to many system calls and
+libraries, as well as to various window systems, and is extensible in C or
+C++. It is also usable as an extension language for applications that need
+a programmable interface.  Finally, Python is portable: it runs on many
+brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
+Mac.
 
 %package devel
 Summary: The libraries and header files needed for Python development.
@@ -117,95 +106,132 @@ for the Python language.
 
 %prep
 %setup -q -n Python-%{version}
-%patch0 -p1 -b .Setup
-%patch10 -p1 -b .locale
-
 %if %{_lib} == lib64
-%patch100 -p1 -b .lib64-Makefile
-%patch101 -p1 -b .lib64-setup
-%patch102 -p1 -b .lib64-site
-%patch103 -p1 -b .lib64-install
-%patch104 -p1 -b .lib64-sysconfig
-%patch105 -p1 -b .lib64-getpath
-%patch106 -p1 -b .test_install
+%patch1 -p1 -b .lib64
 %endif
 
-# fix Tcl/Tk versions
-pushd Modules
-mv Setup.dist Setup.dist.old
-cat Setup.dist.old \
-	| sed "s^-ltcl^-ltcl%{TclTk}^" \
-	| sed "s^-ltk^-ltk%{TclTk}^" \
-	| sed "s^-ltix^-ltix%{TclTk}^" \
-	> Setup.dist
-rm -f Setup.dist.old
-popd
-
 
 %build
-topdir=`pwd`
-%configure \
+./configure \
+	--prefix=%{_prefix} \
+	--libdir=%{_libdir} \
 	--enable-shared \
-	--enable-ipv6 \
 	--enable-profiling \
+	--enable-ipv6 \
+	--with-fpectl \
 	--with-wide-unicode \
-	--with-system-ffi \
+	--with-doc-strings \
+	--with-pymalloc \
 	--with-signal-module \
-	;
-make %{?_smp_mflags}
+	--with-system-ffi \
+	--with-threads \
+	--with-valgrind \
+%ifarch x86_64
+	--with-universal-archs=64-bit \
+%endif
+	CXX=g++;
 
-## rebuild with new python
-export LD_LIBRARY_PATH=$topdir
-export PATH="$topdir:$PATH"
-ln -s $topdir/python $topdir/python%{pybasever}
-#$topdir/python Tools/scripts/pathfix.py -i "/usr/bin/env python%{pybasever}" .
 make %{?_smp_mflags}
 
 %if %{run_test}
-#%%check
-find ./Lib -name '*.py[co]' -print | xargs rm -f
-LD_LIBRARY_PATH=$topdir:$topdir/Modules:$topdir/build/lib.linux-%{_host_cpu}-%{pybasever}
-PYTHONHOME=$topdir
-PYTHONPATH=$topdir/Lib:$topdir/Lib/test:$topdir/Lib/lib-tk:$topdir/Lib/site-packages
-PYTHONPATH=$PYTHONPATH:$LD_LIBRARY_PATH
-export PYTHONHOME PYTHONPATH LD_LIBRARY_PATH
-SKIPLIST="-x test_cmd_line"
-./python -tt -E ./Lib/test/regrtest.py -l -w $SKIPLIST 2>&1 | tee make.check1.log
-./python -tt -E ./Lib/test/regrtest.py -l -w $SKIPLIST 2>&1 | tee make.check2.log
-#-------------------------------##
-# Mon Nov 29 2010 ...last tested
-# 314 tests OK.
-# 4 tests failed:
-#  test_cmd_line: "Lib/test/test_cmd_line.py", line 190, in test_large_PYTHONPATH
-#  test_httpservers: Lib/test/test_httpservers.py", line 399 in tearDown
-#  test_pydoc: Lib/test/test_pydoc.py", line 299, in test_badimport
-#  test_warnings: Lib/test/test_warnings.py", line 707, in test_issue_8766
-# 22 tests skipped:
-# 2 skips unexpected on linux2:
-#-------------------------------##
+make test
 %endif
 
 
 %install
-rm -fr $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT BINDIR=%{_bindir} install
-
-## Clean up the testsuite - we don't need compiled files for it
-find $RPM_BUILD_ROOT%{python_lib}/test \
-    -name "*.pyc" -o -name "*.pyo" | xargs rm -f
-
-chmod 755 $RPM_BUILD_ROOT%{_libdir}/libpython*.so.*
-chmod 755 $RPM_BUILD_ROOT%{python_lib}/lib-dynload/*.so
-find $RPM_BUILD_ROOT%{python_lib} -perm -o=x -name '*.py' | xargs chmod -x
-mv $RPM_BUILD_ROOT%{_bindir}/2to3 $RPM_BUILD_ROOT%{_bindir}/2to3.1
-
+[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+echo '[install_scripts]' >setup.cfg
+echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg
+
+mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload
+make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
+
+# if --with-wide-unicode at configure
+ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers}
+
+# replace path in pydoc
+if [ ! -z "%{binsuffix}" ]
+then
+   (
+      cd $RPM_BUILD_ROOT%{_bindir}
+      mv pydoc%{libvers} pydoc.old
+      sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \
+            pydoc.old > pydoc%{libvers}
+      chmod 755 pydoc%{libvers}
+      rm -f pydoc.old
+   )
+fi
 
-## html document
-tar xvzf %SOURCE1
-if [ -d Doc/html ] ; then
-	rm -r Doc/html
+#  Tools
+echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
+echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
+echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
+echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
+echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix}
+chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix}
+cp -a Tools $RPM_BUILD_ROOT%{python_lib}
+
+# make file lists
+rm -f mainpkg.files
+find "$RPM_BUILD_ROOT"%{python_lib} -type f |
+	sed "s|^${RPM_BUILD_ROOT}|/|" |
+	grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files
+
+rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3
+find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l |
+	sed "s|^${RPM_BUILD_ROOT}|/|" |
+	grep -v -e '/bin/2to3%{binsuffix}$' |
+	grep -v -e '/bin/pydoc%{binsuffix}$' |
+	grep -v -e '/bin/smtpd.py%{binsuffix}$' |
+	grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files
+
+
+rm -f tools.files
+find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \
+      "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f |
+      sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files
+echo %{_bindir}/2to3-%{binsuffix} >> tools.files
+echo %{_bindir}/pydoc%{binsuffix} >> tools.files
+##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files
+echo %{_bindir}/idle%{binsuffix} >> tools.files
+
+# docs
+mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
+(
+   cd "$RPM_BUILD_ROOT"%{config_htmldir}
+   bunzip2 < %{SOURCE1} | tar x
+)
+
+#  fix the #! line in installed files
+find "$RPM_BUILD_ROOT" -type f -print0 |
+      xargs -0 grep -l /usr/local/bin/python | while read file
+do
+   FIXFILE="$file"
+   sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \
+         "$FIXFILE" >/tmp/fix-python-path.$$
+   cat /tmp/fix-python-path.$$ > "$FIXFILE"
+   rm -f /tmp/fix-python-path.$$
+done
+
+#  check to see if there are any straggling #! lines
+find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
+      | grep ':1:#!' >/tmp/python-rpm-files.$$ || true
+if [ -s /tmp/python-rpm-files.$$ ]
+then
+   echo '*****************************************************'
+   cat /tmp/python-rpm-files.$$
+   cat <<@EOF
+   *****************************************************
+     There are still files referencing /usr/local/bin/python in the
+     install directory.  They are listed above.  Please fix the .spec
+     file and try again.  If you are an end-user, you probably want
+     to report this to jafo-rpms@tummy.com as well.
+   *****************************************************
+@EOF
+   rm -f /tmp/python-rpm-files.$$
+   exit 1
 fi
-mv python-%{version}-docs-html Doc/html
+rm -f /tmp/python-rpm-files.$$
 
 
 %post -p /sbin/ldconfig
@@ -213,73 +239,42 @@ mv python-%{version}-docs-html Doc/html
 %clean
 rm -fr $RPM_BUILD_ROOT
 
-%files
+%files -f mainpkg.files
 %defattr(-, root, root)
-%doc LICENSE README
-%{_bindir}/%{name}
-%{_bindir}/%{name}-config
-%{_bindir}/python%{pybasever}
-%{_bindir}/python%{pybasever}-config
-%{_libdir}/libpython%{pybasever}.so*
-%{_libdir}/pkgconfig/python-%{pybasever}.pc
-%{_libdir}/pkgconfig/python3.pc
-%{_mandir}/man1/*
-%dir %{python_lib}
-%dir %{python_lib}/site-packages
-%{python_lib}/LICENSE.txt
-%{python_lib}/*.py*
-%{python_lib}/*.doc
-%{python_lib}/ctypes
-%{python_lib}/curses
-%{python_lib}/distutils
-%{python_lib}/dbm
-%{python_lib}/email
-%{python_lib}/encodings
-%{python_lib}/html
-%{python_lib}/http
-%{python_lib}/importlib
-%{python_lib}/json
-%{python_lib}/logging
-%{python_lib}/multiprocessing
-%{python_lib}/plat-linux2
-%{python_lib}/pydoc_data
-%{python_lib}/sqlite3
-%{python_lib}/urllib
-%{python_lib}/wsgiref
-%{python_lib}/wsgiref.egg-info
-%{python_lib}/xml
-%{python_lib}/xmlrpc
-%{python_lib}/lib-dynload
-%exclude %{python_lib}/lib-dynload/_tkinter.so
+%doc LICENSE
+%doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README
+%attr(755,root,root) %dir %{python_lib}/
+%{_libdir}/libpython*
+%{_mandir}/man1/python%{libvers}.1*
 
 %files devel
 %defattr(-,root,root)
-%{_includedir}/python%{pybasever}
-%{python_lib}/config
-%{python_lib}/test
+%dir %{_includedir}/python%{libvers}u
+%{_includedir}/python%{libvers}u/*.h
+%{_includedir}/python%{libvers}
+%{_libdir}/pkgconfig/*.pc
 
-%files tools
+%files -f tools.files tools
 %defattr(-,root,root)
-%{_bindir}/2to3.1
-%{_bindir}/idle3
-%{_bindir}/pydoc3
-%{python_lib}/idlelib
-%{python_lib}/lib2to3
-%{python_lib}/site-packages
 
 %files tkinter
 %defattr(-,root,root)
 %{python_lib}/tkinter
-%{python_lib}/lib-dynload/_tkinter.so
+%{python_lib}/lib-dynload/_tkinter.*.so*
 
 %files docs
 %defattr(-,root,root)
-%doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/README
-%doc Misc/cheatsheet Misc/Porting
-%doc Doc/html
+%{config_htmldir}/*
 
 
 %changelog
+* Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1
+- updated python to 3.2
+- updated python-*-docs-html to 3.2
+- dropt all patchs
+- added python-3.2b2-lib64.patch
+- referred to the review Python-3.2/Misc/RPM/python-3.2.spec
+
 * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2
 - rebuilt with openssl-1.0.0c