Wed, 22 Jan 2014 18:52:02 +0100
Update version and integrate additional IPv4 and IPv6 country databases.
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@784 | 34 | Version: 3.3.2 |
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_ssl no |
michael@369 | 46 | |
michael@369 | 47 | # list of sources |
michael@369 | 48 | Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 |
michael@369 | 49 | Patch0: python.patch |
michael@369 | 50 | |
michael@369 | 51 | # build information |
michael@524 | 52 | BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make |
michael@524 | 53 | PreReq: OpenPKG, openpkg >= 20100101, gcc |
michael@784 | 54 | BuildPreReq: zlib, gettext, libiconv |
michael@784 | 55 | PreReq: zlib, gettext, libiconv |
michael@369 | 56 | %if "%{with_readline}" == "yes" |
michael@369 | 57 | BuildPreReq: readline |
michael@369 | 58 | PreReq: readline |
michael@369 | 59 | %endif |
michael@369 | 60 | %if "%{with_db}" == "yes" |
michael@369 | 61 | BuildPreReq: db |
michael@369 | 62 | PreReq: db |
michael@369 | 63 | %endif |
michael@369 | 64 | %if "%{with_dbm}" == "yes" |
michael@369 | 65 | BuildPreReq: gdbm::with_ndbm = yes |
michael@369 | 66 | PreReq: gdbm::with_ndbm = yes |
michael@369 | 67 | %endif |
michael@369 | 68 | %if "%{with_curses}" == "yes" |
michael@369 | 69 | BuildPreReq: ncurses |
michael@369 | 70 | PreReq: ncurses |
michael@369 | 71 | %endif |
michael@369 | 72 | %if "%{with_zlib}" == "yes" |
michael@369 | 73 | BuildPreReq: zlib |
michael@369 | 74 | PreReq: zlib |
michael@369 | 75 | %endif |
michael@369 | 76 | %if "%{with_bzip2}" == "yes" |
michael@369 | 77 | BuildPreReq: bzip2 |
michael@369 | 78 | PreReq: bzip2 |
michael@369 | 79 | %endif |
michael@369 | 80 | %if "%{with_xml}" == "yes" |
michael@369 | 81 | BuildPreReq: expat |
michael@369 | 82 | PreReq: expat |
michael@369 | 83 | %endif |
michael@369 | 84 | %if "%{with_ssl}" == "yes" |
michael@369 | 85 | BuildPreReq: openssl |
michael@369 | 86 | PreReq: openssl |
michael@369 | 87 | %endif |
michael@369 | 88 | |
michael@369 | 89 | %description |
michael@369 | 90 | Python is an interpreted, interactive, object-oriented programming |
michael@369 | 91 | language. Python combines remarkable power with very clear syntax. |
michael@369 | 92 | It has modules, classes, exceptions, very high level dynamic data |
michael@369 | 93 | types, and dynamic typing. There are interfaces to many system calls |
michael@369 | 94 | and libraries, as well as to various windowing systems (X11, Motif, |
michael@369 | 95 | Tk, Mac, MFC). New built-in modules are easily written in C or C++. |
michael@369 | 96 | Python is also usable as an extension language for applications that |
michael@369 | 97 | need a programmable interface. |
michael@369 | 98 | |
michael@369 | 99 | %track |
michael@369 | 100 | prog python = { |
michael@369 | 101 | version = %{version} |
michael@369 | 102 | url = http://www.python.org/download/ |
michael@369 | 103 | regex = Python-(2(\.\d+)+)\.tar\.bz2 |
michael@369 | 104 | } |
michael@369 | 105 | |
michael@369 | 106 | %prep |
michael@369 | 107 | %setup -q -n Python-%{version} |
michael@369 | 108 | %patch -p0 |
michael@524 | 109 | |
michael@524 | 110 | %build |
michael@524 | 111 | %{l_shtool} subst %{l_value -s -a} \ |
michael@524 | 112 | setup.py |
michael@369 | 113 | %{l_shtool} subst \ |
michael@369 | 114 | -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ |
michael@369 | 115 | -e 's;python$(VERSION);python;g' \ |
michael@369 | 116 | Makefile.pre.in |
michael@369 | 117 | %{l_shtool} subst \ |
michael@369 | 118 | -e 's;\(lib/python"\) *VERSION;\1;g' \ |
michael@369 | 119 | Modules/getpath.c |
michael@369 | 120 | find Lib -name "*.py" -print |\ |
michael@369 | 121 | xargs %{l_shtool} subst -q \ |
michael@369 | 122 | -e 's;\+ *sys\.version\[:3\];;g' \ |
michael@369 | 123 | -e 's;\+ *get_python_version();;g' |
michael@369 | 124 | %{l_shtool} subst \ |
michael@369 | 125 | -e 's;python\$py_version_short;python;g' \ |
michael@369 | 126 | Lib/distutils/command/install.py |
michael@369 | 127 | %{l_shtool} subst \ |
michael@369 | 128 | -e 's;python{py_version_short};python;g' \ |
michael@369 | 129 | Lib/sysconfig.py |
michael@369 | 130 | %if "%{with_readline}" == "yes" |
michael@654 | 131 | ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline" |
michael@369 | 132 | ) >>Modules/Setup.local |
michael@369 | 133 | %endif |
michael@369 | 134 | %if "%{with_db}" == "yes" |
michael@369 | 135 | ( echo "_bsddb _bsddb.c %{l_cppflags} %{l_ldflags} -ldb" |
michael@369 | 136 | ) >>Modules/Setup.local |
michael@369 | 137 | %endif |
michael@369 | 138 | %if "%{with_dbm}" == "yes" |
michael@369 | 139 | ( echo "dbm dbmmodule.c -DHAVE_NDBM_H %{l_cppflags} %{l_ldflags} -lndbm -lgdbm" |
michael@369 | 140 | echo "gdbm gdbmmodule.c -DHAVE_GDBM_H %{l_cppflags} %{l_ldflags} -lgdbm" |
michael@369 | 141 | ) >>Modules/Setup.local |
michael@369 | 142 | %endif |
michael@369 | 143 | %if "%{with_curses}" == "yes" |
michael@369 | 144 | ( echo "_curses_panel _curses_panel.c %{l_cppflags} %{l_ldflags} -lpanel -lncurses" |
michael@369 | 145 | ) >>Modules/Setup.local |
michael@369 | 146 | %endif |
michael@369 | 147 | %if "%{with_zlib}" == "yes" |
michael@369 | 148 | ( echo "zlib zlibmodule.c %{l_cppflags} %{l_ldflags} -lz" |
michael@369 | 149 | ) >>Modules/Setup.local |
michael@369 | 150 | %endif |
michael@369 | 151 | %if "%{with_bzip2}" == "yes" |
michael@369 | 152 | ( echo "bz2 bz2module.c %{l_cppflags} %{l_ldflags} -lbz2" |
michael@369 | 153 | ) >>Modules/Setup.local |
michael@369 | 154 | %endif |
michael@369 | 155 | %if "%{with_xml}" == "yes" |
michael@369 | 156 | ( echo "EXPAT_DIR=%{l_prefix}" |
michael@369 | 157 | echo "pyexpat pyexpat.c -DHAVE_EXPAT_H %{l_cppflags} %{l_ldflags} -lexpat" |
michael@369 | 158 | ) >>Modules/Setup.local |
michael@369 | 159 | %endif |
michael@369 | 160 | %if "%{with_ssl}" == "yes" |
michael@369 | 161 | ( echo "_socket socketmodule.c" |
michael@369 | 162 | echo "SSL=%{l_prefix}" |
michael@369 | 163 | echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" |
michael@369 | 164 | ) >>Modules/Setup.local |
michael@369 | 165 | %endif |
michael@369 | 166 | |
michael@654 | 167 | l_cppflags="%{l_cppflags}" |
michael@654 | 168 | %if "%{with_curses}" == "yes" |
michael@654 | 169 | l_cppflags="%{l_cppflags ncurses}" |
michael@654 | 170 | %endif |
michael@369 | 171 | CC="%{l_prefix}/bin/gcc" \ |
michael@369 | 172 | CXX="%{l_cxx}" \ |
michael@369 | 173 | CFLAGS="%{l_cflags -O}" \ |
michael@369 | 174 | OPT="%{l_cflags -O}" \ |
michael@369 | 175 | CXXFLAGS="%{l_cxxflags -O}" \ |
michael@654 | 176 | CPPFLAGS="$l_cppflags" \ |
michael@369 | 177 | LDFLAGS="%{l_ldflags}" \ |
michael@784 | 178 | LIBS="-lintl -liconv" \ |
michael@369 | 179 | ./configure \ |
michael@369 | 180 | --prefix=%{l_prefix} \ |
michael@369 | 181 | --mandir=%{l_prefix}/man \ |
michael@369 | 182 | --with-dbmliborder=ndbm \ |
michael@369 | 183 | --with-gcc |
michael@784 | 184 | %{l_make} %{l_mflags} |
michael@369 | 185 | |
michael@369 | 186 | %install |
michael@369 | 187 | %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT |
michael@784 | 188 | ( cd $RPM_BUILD_ROOT%{l_prefix}/lib/python/config* |
michael@784 | 189 | ln libpython*.a libpython.a |
michael@784 | 190 | ) || exit $? |
michael@786 | 191 | mv \ |
michael@786 | 192 | $RPM_BUILD_ROOT%{l_prefix}/include/python3.3m \ |
michael@786 | 193 | $RPM_BUILD_ROOT%{l_prefix}/include/pythonm |
michael@369 | 194 | rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py |
michael@369 | 195 | rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle |
michael@369 | 196 | rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python/test |
michael@369 | 197 | strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
michael@369 | 198 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} |
michael@369 | 199 | |
michael@369 | 200 | %files -f files |
michael@369 | 201 | |
michael@369 | 202 | %clean |
michael@369 | 203 |