python/python.spec

Sun, 27 Jan 2013 20:22:45 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sun, 27 Jan 2013 20:22:45 +0100
changeset 757
bb40ee892364
parent 524
241043c7d657
child 784
8a194ef19c9c
permissions
-rw-r--r--

Update to new version, improve socket error reporting, and correct SCTP bug.

michael@369 1 ##
michael@369 2 ## python.spec -- OpenPKG RPM Package Specification
michael@524 3 ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@369 4 ##
michael@369 5 ## Permission to use, copy, modify, and distribute this software for
michael@369 6 ## any purpose with or without fee is hereby granted, provided that
michael@369 7 ## the above copyright notice and this permission notice appear in all
michael@369 8 ## copies.
michael@369 9 ##
michael@369 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@369 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@369 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@369 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@369 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@369 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@369 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@369 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@369 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@369 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@369 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@369 21 ## SUCH DAMAGE.
michael@369 22 ##
michael@369 23
michael@369 24 # package information
michael@369 25 Name: python
michael@369 26 Summary: The Python Programming Language
michael@369 27 URL: http://www.python.org/
michael@369 28 Vendor: Guido van Rossum
michael@369 29 Packager: OpenPKG Foundation e.V.
michael@369 30 Distribution: OpenPKG Community
michael@369 31 Class: BASE
michael@369 32 Group: Language
michael@369 33 License: GPL
michael@524 34 Version: 2.7.3
michael@524 35 Release: 20120800
michael@369 36
michael@369 37 # package options
michael@369 38 %option with_readline no
michael@369 39 %option with_db no
michael@369 40 %option with_dbm no
michael@369 41 %option with_curses no
michael@369 42 %option with_zlib no
michael@369 43 %option with_bzip2 no
michael@369 44 %option with_xml no
michael@369 45 %option with_locale no
michael@369 46 %option with_ssl no
michael@369 47
michael@369 48 # list of sources
michael@369 49 Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
michael@369 50 Patch0: python.patch
michael@369 51
michael@369 52 # build information
michael@524 53 BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make
michael@524 54 PreReq: OpenPKG, openpkg >= 20100101, gcc
michael@369 55 BuildPreReq: zlib
michael@369 56 PreReq: zlib
michael@369 57 %if "%{with_readline}" == "yes"
michael@369 58 BuildPreReq: readline
michael@369 59 PreReq: readline
michael@369 60 %endif
michael@369 61 %if "%{with_db}" == "yes"
michael@369 62 BuildPreReq: db
michael@369 63 PreReq: db
michael@369 64 %endif
michael@369 65 %if "%{with_dbm}" == "yes"
michael@369 66 BuildPreReq: gdbm::with_ndbm = yes
michael@369 67 PreReq: gdbm::with_ndbm = yes
michael@369 68 %endif
michael@369 69 %if "%{with_curses}" == "yes"
michael@369 70 BuildPreReq: ncurses
michael@369 71 PreReq: ncurses
michael@369 72 %endif
michael@369 73 %if "%{with_zlib}" == "yes"
michael@369 74 BuildPreReq: zlib
michael@369 75 PreReq: zlib
michael@369 76 %endif
michael@369 77 %if "%{with_bzip2}" == "yes"
michael@369 78 BuildPreReq: bzip2
michael@369 79 PreReq: bzip2
michael@369 80 %endif
michael@369 81 %if "%{with_xml}" == "yes"
michael@369 82 BuildPreReq: expat
michael@369 83 PreReq: expat
michael@369 84 %endif
michael@369 85 %if "%{with_locale}" == "yes"
michael@369 86 BuildPreReq: gettext, libiconv
michael@369 87 PreReq: gettext, libiconv
michael@369 88 %endif
michael@369 89 %if "%{with_ssl}" == "yes"
michael@369 90 BuildPreReq: openssl
michael@369 91 PreReq: openssl
michael@369 92 %endif
michael@369 93
michael@369 94 %description
michael@369 95 Python is an interpreted, interactive, object-oriented programming
michael@369 96 language. Python combines remarkable power with very clear syntax.
michael@369 97 It has modules, classes, exceptions, very high level dynamic data
michael@369 98 types, and dynamic typing. There are interfaces to many system calls
michael@369 99 and libraries, as well as to various windowing systems (X11, Motif,
michael@369 100 Tk, Mac, MFC). New built-in modules are easily written in C or C++.
michael@369 101 Python is also usable as an extension language for applications that
michael@369 102 need a programmable interface.
michael@369 103
michael@369 104 %track
michael@369 105 prog python = {
michael@369 106 version = %{version}
michael@369 107 url = http://www.python.org/download/
michael@369 108 regex = Python-(2(\.\d+)+)\.tar\.bz2
michael@369 109 }
michael@369 110
michael@369 111 %prep
michael@369 112 %setup -q -n Python-%{version}
michael@369 113 %patch -p0
michael@524 114
michael@524 115 %build
michael@524 116 %{l_shtool} subst %{l_value -s -a} \
michael@524 117 setup.py
michael@369 118 %{l_shtool} subst \
michael@369 119 -e 's;altinstall bininstall maninstall;altinstall maninstall;' \
michael@369 120 -e 's;python$(VERSION);python;g' \
michael@369 121 Makefile.pre.in
michael@369 122 %{l_shtool} subst \
michael@369 123 -e 's;\(lib/python"\) *VERSION;\1;g' \
michael@369 124 Modules/getpath.c
michael@369 125 find Lib -name "*.py" -print |\
michael@369 126 xargs %{l_shtool} subst -q \
michael@369 127 -e 's;\+ *sys\.version\[:3\];;g' \
michael@369 128 -e 's;\+ *get_python_version();;g'
michael@369 129 %{l_shtool} subst \
michael@369 130 -e 's;python\$py_version_short;python;g' \
michael@369 131 Lib/distutils/command/install.py
michael@369 132 %{l_shtool} subst \
michael@369 133 -e 's;python{py_version_short};python;g' \
michael@369 134 Lib/sysconfig.py
michael@369 135 %if "%{with_readline}" == "yes"
michael@654 136 ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline"
michael@369 137 ) >>Modules/Setup.local
michael@369 138 %endif
michael@369 139 %if "%{with_db}" == "yes"
michael@369 140 ( echo "_bsddb _bsddb.c %{l_cppflags} %{l_ldflags} -ldb"
michael@369 141 ) >>Modules/Setup.local
michael@369 142 %endif
michael@369 143 %if "%{with_dbm}" == "yes"
michael@369 144 ( echo "dbm dbmmodule.c -DHAVE_NDBM_H %{l_cppflags} %{l_ldflags} -lndbm -lgdbm"
michael@369 145 echo "gdbm gdbmmodule.c -DHAVE_GDBM_H %{l_cppflags} %{l_ldflags} -lgdbm"
michael@369 146 ) >>Modules/Setup.local
michael@369 147 %endif
michael@369 148 %if "%{with_curses}" == "yes"
michael@369 149 ( echo "_curses_panel _curses_panel.c %{l_cppflags} %{l_ldflags} -lpanel -lncurses"
michael@369 150 ) >>Modules/Setup.local
michael@369 151 %endif
michael@369 152 %if "%{with_zlib}" == "yes"
michael@369 153 ( echo "zlib zlibmodule.c %{l_cppflags} %{l_ldflags} -lz"
michael@369 154 ) >>Modules/Setup.local
michael@369 155 %endif
michael@369 156 %if "%{with_bzip2}" == "yes"
michael@369 157 ( echo "bz2 bz2module.c %{l_cppflags} %{l_ldflags} -lbz2"
michael@369 158 ) >>Modules/Setup.local
michael@369 159 %endif
michael@369 160 %if "%{with_xml}" == "yes"
michael@369 161 ( echo "EXPAT_DIR=%{l_prefix}"
michael@369 162 echo "pyexpat pyexpat.c -DHAVE_EXPAT_H %{l_cppflags} %{l_ldflags} -lexpat"
michael@369 163 ) >>Modules/Setup.local
michael@369 164 %endif
michael@369 165 %if "%{with_locale}" == "yes"
michael@369 166 ( echo "_locale _localemodule.c %{l_cppflags} %{l_ldflags} -lintl -liconv"
michael@369 167 ) >>Modules/Setup.local
michael@369 168 %endif
michael@369 169 %if "%{with_ssl}" == "yes"
michael@369 170 ( echo "_socket socketmodule.c"
michael@369 171 echo "SSL=%{l_prefix}"
michael@369 172 echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto"
michael@369 173 ) >>Modules/Setup.local
michael@369 174 %endif
michael@369 175
michael@654 176 l_cppflags="%{l_cppflags}"
michael@654 177 %if "%{with_curses}" == "yes"
michael@654 178 l_cppflags="%{l_cppflags ncurses}"
michael@654 179 %endif
michael@369 180 CC="%{l_prefix}/bin/gcc" \
michael@369 181 CXX="%{l_cxx}" \
michael@369 182 CFLAGS="%{l_cflags -O}" \
michael@369 183 OPT="%{l_cflags -O}" \
michael@369 184 CXXFLAGS="%{l_cxxflags -O}" \
michael@654 185 CPPFLAGS="$l_cppflags" \
michael@369 186 LDFLAGS="%{l_ldflags}" \
michael@369 187 ./configure \
michael@369 188 --prefix=%{l_prefix} \
michael@369 189 --mandir=%{l_prefix}/man \
michael@369 190 --with-dbmliborder=ndbm \
michael@369 191 --with-gcc
michael@370 192 %{l_make} %{l_mflags -O}
michael@369 193
michael@369 194 %install
michael@369 195 %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
michael@369 196 ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \
michael@369 197 $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a
michael@369 198 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py
michael@369 199 rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle
michael@369 200 rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python/test
michael@369 201 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@369 202 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
michael@369 203
michael@369 204 %files -f files
michael@369 205
michael@369 206 %clean
michael@369 207

mercurial