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