[2238] | 1 | # if you wanna test, add " --define '_run_test 1' " option to rpmbuild command |
---|
| 2 | %define run_test %{?_run_test:1}%{!?_run_test:0} |
---|
[3491] | 3 | %define libvers 3.2 |
---|
| 4 | %define binsuffix 3.2 |
---|
| 5 | %define python_lib %{_libdir}/python%{libvers} |
---|
| 6 | %define config_htmldir /var/www/html/python |
---|
[1216] | 7 | Summary: An interpreted, interactive, object-oriented programming language. |
---|
[1222] | 8 | Summary(ja): オブジェクト指向 Python3 インタプリタ |
---|
[1216] | 9 | Name: python3 |
---|
[3491] | 10 | Version: 3.2 |
---|
| 11 | Release: 1%{?_dist_release} |
---|
| 12 | License: PSF |
---|
[1216] | 13 | Group: Development/Languages |
---|
| 14 | URL: http://www.python.org/download/releases/%{version} |
---|
| 15 | Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 |
---|
| 16 | Source1: http://docs.python.org/py3k/archives/python-%{version}-docs-html.tar.bz2 |
---|
[3491] | 17 | Patch1: python-3.2b2-lib64.patch |
---|
[1216] | 18 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
[3491] | 19 | BuildRequires: expat-devel |
---|
| 20 | BuildRequires: db4-devel |
---|
| 21 | BuildRequires: gdbm-devel |
---|
| 22 | BuildRequires: sqlite3-devel |
---|
[1221] | 23 | BuildRequires: gzip tar gcc-c++ pkgconfig sed findutils |
---|
| 24 | BuildRequires: bzip2-devel |
---|
| 25 | BuildRequires: glibc-devel |
---|
| 26 | BuildRequires: ncurses-devel |
---|
| 27 | BuildRequires: openssl-devel |
---|
| 28 | BuildRequires: readline-devel |
---|
| 29 | BuildRequires: zlib-devel |
---|
[2238] | 30 | BuildRequires: libffi-devel |
---|
[1221] | 31 | Requires: bzip2 |
---|
| 32 | Requires: gdbm |
---|
| 33 | Requires: ncurses |
---|
| 34 | Requires: openssl |
---|
| 35 | Requires: readline |
---|
| 36 | Requires: sqlite3 |
---|
| 37 | Requires: zlib |
---|
[2238] | 38 | Packager: owa |
---|
| 39 | Vendor: Project Vine |
---|
| 40 | Distribution: Vine Linux |
---|
[1221] | 41 | |
---|
[1216] | 42 | %description |
---|
| 43 | Python is an interpreted, interactive, object-oriented programming |
---|
[3491] | 44 | language. It incorporates modules, exceptions, dynamic typing, very high |
---|
| 45 | level dynamic data types, and classes. Python combines remarkable power |
---|
| 46 | with very clear syntax. It has interfaces to many system calls and |
---|
| 47 | libraries, as well as to various window systems, and is extensible in C or |
---|
| 48 | C++. It is also usable as an extension language for applications that need |
---|
| 49 | a programmable interface. Finally, Python is portable: it runs on many |
---|
| 50 | brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the |
---|
| 51 | Mac. |
---|
[1216] | 52 | |
---|
| 53 | %package devel |
---|
| 54 | Summary: The libraries and header files needed for Python development. |
---|
| 55 | Group: Development/Libraries |
---|
| 56 | |
---|
| 57 | %description devel |
---|
| 58 | The Python programming language's interpreter can be extended with |
---|
| 59 | dynamically loaded extensions and can be embedded in other programs. |
---|
| 60 | This package contains the header files and libraries needed to do |
---|
| 61 | these types of tasks. |
---|
| 62 | |
---|
| 63 | Install python-devel if you want to develop Python extensions. The |
---|
| 64 | python package will also need to be installed. You'll probably also |
---|
| 65 | want to install the python-docs package, which contains Python |
---|
| 66 | documentation. |
---|
| 67 | |
---|
| 68 | %package tkinter |
---|
| 69 | Summary: A graphical user interface for the Python scripting language. |
---|
| 70 | Group: Development/Languages |
---|
| 71 | Requires: %{name} = %{version} |
---|
[1221] | 72 | Requires: tcl, tk, tix |
---|
| 73 | Requires: libX11, libxcb, libXau, libXdmcp |
---|
| 74 | BuildRequires: tcl, tk, tix |
---|
| 75 | BuildRequires: libX11-devel, libxcb-devel, libXau-devel, libXdmcp-devel |
---|
[1216] | 76 | |
---|
| 77 | %description tkinter |
---|
| 78 | The Tkinter (Tk interface) program is an graphical user interface for |
---|
| 79 | the Python scripting language. |
---|
| 80 | |
---|
| 81 | You should install the tkinter package if you'd like to use a graphical |
---|
| 82 | user interface for Python programming. |
---|
| 83 | |
---|
| 84 | %package tools |
---|
| 85 | Summary: A collection of development tools included with Python. |
---|
| 86 | Group: Development/Tools |
---|
| 87 | Requires: %{name} = %{version} |
---|
| 88 | Requires: %{name}-tkinter = %{version} |
---|
| 89 | |
---|
| 90 | %description tools |
---|
| 91 | The Python package includes several development tools that are used |
---|
| 92 | to build python programs. |
---|
| 93 | |
---|
| 94 | %package docs |
---|
| 95 | Summary: Documentation for the Python programming language. |
---|
| 96 | Group: Documentation |
---|
| 97 | |
---|
| 98 | %description docs |
---|
| 99 | The python-docs package contains documentation on the Python |
---|
| 100 | programming language and interpreter. The documentation is provided |
---|
| 101 | in ASCII text files and in LaTeX source files. |
---|
| 102 | |
---|
| 103 | Install the python-docs package if you'd like to use the documentation |
---|
| 104 | for the Python language. |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | %prep |
---|
| 108 | %setup -q -n Python-%{version} |
---|
| 109 | %if %{_lib} == lib64 |
---|
[3491] | 110 | %patch1 -p1 -b .lib64 |
---|
[1216] | 111 | %endif |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | %build |
---|
[3491] | 115 | ./configure \ |
---|
| 116 | --prefix=%{_prefix} \ |
---|
| 117 | --libdir=%{_libdir} \ |
---|
[1216] | 118 | --enable-shared \ |
---|
| 119 | --enable-profiling \ |
---|
[3491] | 120 | --enable-ipv6 \ |
---|
| 121 | --with-fpectl \ |
---|
[1216] | 122 | --with-wide-unicode \ |
---|
[3491] | 123 | --with-doc-strings \ |
---|
| 124 | --with-pymalloc \ |
---|
[2238] | 125 | --with-signal-module \ |
---|
[3491] | 126 | --with-system-ffi \ |
---|
| 127 | --with-threads \ |
---|
| 128 | --with-valgrind \ |
---|
| 129 | %ifarch x86_64 |
---|
| 130 | --with-universal-archs=64-bit \ |
---|
| 131 | %endif |
---|
| 132 | CXX=g++; |
---|
[1216] | 133 | |
---|
[2238] | 134 | make %{?_smp_mflags} |
---|
[1216] | 135 | |
---|
[2238] | 136 | %if %{run_test} |
---|
[3491] | 137 | make test |
---|
[2238] | 138 | %endif |
---|
| 139 | |
---|
| 140 | |
---|
[1216] | 141 | %install |
---|
[3491] | 142 | [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT |
---|
| 143 | echo '[install_scripts]' >setup.cfg |
---|
| 144 | echo 'install_dir='"${RPM_BUILD_ROOT}%{_bindir}" >> setup.cfg |
---|
[1216] | 145 | |
---|
[3491] | 146 | mkdir -p $RPM_BUILD_ROOT%{python_lib}/lib-dynload |
---|
| 147 | make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install |
---|
[1216] | 148 | |
---|
[3491] | 149 | # if --with-wide-unicode at configure |
---|
| 150 | ln -s python%{libvers}u $RPM_BUILD_ROOT%{_includedir}/python%{libvers} |
---|
[1216] | 151 | |
---|
[3491] | 152 | # replace path in pydoc |
---|
| 153 | if [ ! -z "%{binsuffix}" ] |
---|
| 154 | then |
---|
| 155 | ( |
---|
| 156 | cd $RPM_BUILD_ROOT%{_bindir} |
---|
| 157 | mv pydoc%{libvers} pydoc.old |
---|
| 158 | sed 's|#!.*|#!%{_bindir}/env python'%{libvers}'|' \ |
---|
| 159 | pydoc.old > pydoc%{libvers} |
---|
| 160 | chmod 755 pydoc%{libvers} |
---|
| 161 | rm -f pydoc.old |
---|
| 162 | ) |
---|
| 163 | fi |
---|
[1216] | 164 | |
---|
[3491] | 165 | # Tools |
---|
| 166 | echo '#!%{_bindir}/env python%{binsuffix}' > ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
| 167 | echo 'import os, sys' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
| 168 | echo 'os.execvp("%{_bindir}/python%{binsuffix}", ["%{_bindir}/python%{binsuffix}", "%{python_lib}/idlelib/idle.py"] + sys.argv[1:])' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
| 169 | echo 'print "Failed to exec Idle"' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
| 170 | echo 'sys.exit(1)' >> ${RPM_BUILD_ROOT}%{_bindir}/idle%{binsuffix} |
---|
| 171 | chmod 755 $RPM_BUILD_ROOT%{_bindir}/idle%{binsuffix} |
---|
| 172 | cp -a Tools $RPM_BUILD_ROOT%{python_lib} |
---|
| 173 | |
---|
| 174 | # make file lists |
---|
| 175 | rm -f mainpkg.files |
---|
| 176 | find "$RPM_BUILD_ROOT"%{python_lib} -type f | |
---|
| 177 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
---|
| 178 | grep -v -e '/python%{libvers}/config$' -e '_tkinter.so$' >> mainpkg.files |
---|
| 179 | |
---|
| 180 | rm -f $RPM_BUILD_ROOT%{_prefix}/bin/2to3 |
---|
| 181 | find "$RPM_BUILD_ROOT""%{_prefix}"/bin -type f -o -type l | |
---|
| 182 | sed "s|^${RPM_BUILD_ROOT}|/|" | |
---|
| 183 | grep -v -e '/bin/2to3%{binsuffix}$' | |
---|
| 184 | grep -v -e '/bin/pydoc%{binsuffix}$' | |
---|
| 185 | grep -v -e '/bin/smtpd.py%{binsuffix}$' | |
---|
| 186 | grep -v -e '/bin/idle%{binsuffix}$' >> mainpkg.files |
---|
| 187 | |
---|
| 188 | |
---|
| 189 | rm -f tools.files |
---|
| 190 | find "$RPM_BUILD_ROOT"%{python_lib}/idlelib \ |
---|
| 191 | "$RPM_BUILD_ROOT"%{python_lib}/Tools -type f | |
---|
| 192 | sed "s|^${RPM_BUILD_ROOT}|/|" > tools.files |
---|
| 193 | echo %{_bindir}/2to3-%{binsuffix} >> tools.files |
---|
| 194 | echo %{_bindir}/pydoc%{binsuffix} >> tools.files |
---|
| 195 | ##echo %{_bindir}/smtpd.py%{binsuffix} >> tools.files |
---|
| 196 | echo %{_bindir}/idle%{binsuffix} >> tools.files |
---|
| 197 | |
---|
| 198 | # docs |
---|
| 199 | mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir} |
---|
| 200 | ( |
---|
| 201 | cd "$RPM_BUILD_ROOT"%{config_htmldir} |
---|
| 202 | bunzip2 < %{SOURCE1} | tar x |
---|
| 203 | ) |
---|
| 204 | |
---|
| 205 | # fix the #! line in installed files |
---|
| 206 | find "$RPM_BUILD_ROOT" -type f -print0 | |
---|
| 207 | xargs -0 grep -l /usr/local/bin/python | while read file |
---|
| 208 | do |
---|
| 209 | FIXFILE="$file" |
---|
| 210 | sed 's|^#!.*python|#!%{_bindir}/env python'"%{binsuffix}"'|' \ |
---|
| 211 | "$FIXFILE" >/tmp/fix-python-path.$$ |
---|
| 212 | cat /tmp/fix-python-path.$$ > "$FIXFILE" |
---|
| 213 | rm -f /tmp/fix-python-path.$$ |
---|
| 214 | done |
---|
| 215 | |
---|
| 216 | # check to see if there are any straggling #! lines |
---|
| 217 | find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \ |
---|
| 218 | | grep ':1:#!' >/tmp/python-rpm-files.$$ || true |
---|
| 219 | if [ -s /tmp/python-rpm-files.$$ ] |
---|
| 220 | then |
---|
| 221 | echo '*****************************************************' |
---|
| 222 | cat /tmp/python-rpm-files.$$ |
---|
| 223 | cat <<@EOF |
---|
| 224 | ***************************************************** |
---|
| 225 | There are still files referencing /usr/local/bin/python in the |
---|
| 226 | install directory. They are listed above. Please fix the .spec |
---|
| 227 | file and try again. If you are an end-user, you probably want |
---|
| 228 | to report this to jafo-rpms@tummy.com as well. |
---|
| 229 | ***************************************************** |
---|
| 230 | @EOF |
---|
| 231 | rm -f /tmp/python-rpm-files.$$ |
---|
| 232 | exit 1 |
---|
[1216] | 233 | fi |
---|
[3491] | 234 | rm -f /tmp/python-rpm-files.$$ |
---|
[1216] | 235 | |
---|
| 236 | |
---|
| 237 | %post -p /sbin/ldconfig |
---|
| 238 | %postun -p /sbin/ldconfig |
---|
| 239 | %clean |
---|
| 240 | rm -fr $RPM_BUILD_ROOT |
---|
| 241 | |
---|
[3491] | 242 | %files -f mainpkg.files |
---|
[1216] | 243 | %defattr(-, root, root) |
---|
[3491] | 244 | %doc LICENSE |
---|
| 245 | %doc Misc/ACKS Misc/HISTORY Misc/NEWS Misc/Porting Misc/README |
---|
| 246 | %attr(755,root,root) %dir %{python_lib}/ |
---|
| 247 | %{_libdir}/libpython* |
---|
| 248 | %{_mandir}/man1/python%{libvers}.1* |
---|
[1216] | 249 | |
---|
| 250 | %files devel |
---|
| 251 | %defattr(-,root,root) |
---|
[3491] | 252 | %dir %{_includedir}/python%{libvers}u |
---|
| 253 | %{_includedir}/python%{libvers}u/*.h |
---|
| 254 | %{_includedir}/python%{libvers} |
---|
| 255 | %{_libdir}/pkgconfig/*.pc |
---|
[1216] | 256 | |
---|
[3491] | 257 | %files -f tools.files tools |
---|
[1216] | 258 | %defattr(-,root,root) |
---|
| 259 | |
---|
| 260 | %files tkinter |
---|
| 261 | %defattr(-,root,root) |
---|
| 262 | %{python_lib}/tkinter |
---|
[3491] | 263 | %{python_lib}/lib-dynload/_tkinter.*.so* |
---|
[1216] | 264 | |
---|
| 265 | %files docs |
---|
| 266 | %defattr(-,root,root) |
---|
[3491] | 267 | %{config_htmldir}/* |
---|
[1216] | 268 | |
---|
| 269 | |
---|
| 270 | %changelog |
---|
[3491] | 271 | * Sat Apr 16 2011 Shu KONNO <owa@bg.wakwak.com> 3.2-1 |
---|
| 272 | - updated python to 3.2 |
---|
| 273 | - updated python-*-docs-html to 3.2 |
---|
| 274 | - dropt all patchs |
---|
| 275 | - added python-3.2b2-lib64.patch |
---|
| 276 | - referred to the review Python-3.2/Misc/RPM/python-3.2.spec |
---|
| 277 | |
---|
[2500] | 278 | * Fri Jan 14 2011 Shu KONNO <owa@bg.wakwak.com> 3.1.3-2 |
---|
| 279 | - rebuilt with openssl-1.0.0c |
---|
| 280 | |
---|
[2238] | 281 | * Mon Nov 29 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.3-1 |
---|
| 282 | - updated python to 3.1.3 |
---|
| 283 | - added python-3.1.3-locale.patch |
---|
| 284 | - dropt python-3.1.2-lib64.patch |
---|
| 285 | - added python-3.1.3-lib64-*.patchs |
---|
| 286 | python-3.1.3-lib64-Makefile.patch |
---|
| 287 | python-3.1.3-lib64-setup.patch |
---|
| 288 | python-3.1.3-lib64-site.patch |
---|
| 289 | python-3.1.3-lib64-install.patch |
---|
| 290 | python-3.1.3-lib64-sysconfig.patch |
---|
| 291 | python-3.1.3-lib64-getpath.patch |
---|
| 292 | python-3.1.3-lib64-test_install.patch |
---|
| 293 | - added run_test macro to run unit test |
---|
| 294 | - added BR: libffi |
---|
| 295 | |
---|
[1902] | 296 | * Sun Sep 26 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-4 |
---|
| 297 | - rebuilt with rpm-4.8.1 for pkg-config |
---|
| 298 | |
---|
[1222] | 299 | * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-3 |
---|
| 300 | - spec in utf-8 |
---|
| 301 | |
---|
[1221] | 302 | * Sun Jun 20 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-2 |
---|
| 303 | - added missings in BuildRequires, Requires |
---|
| 304 | |
---|
[1216] | 305 | * Fri Jun 18 2010 Shu KONNO <owa@bg.wakwak.com> 3.1.2-1 |
---|
| 306 | - initial build for VineSeed |
---|
| 307 | |
---|