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