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