michael@369: ## michael@369: ## python.spec -- OpenPKG RPM Package Specification michael@524: ## Copyright (c) 2000-2012 OpenPKG Foundation e.V. michael@369: ## michael@369: ## Permission to use, copy, modify, and distribute this software for michael@369: ## any purpose with or without fee is hereby granted, provided that michael@369: ## the above copyright notice and this permission notice appear in all michael@369: ## copies. michael@369: ## michael@369: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED michael@369: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF michael@369: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. michael@369: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR michael@369: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, michael@369: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT michael@369: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF michael@369: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND michael@369: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, michael@369: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT michael@369: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF michael@369: ## SUCH DAMAGE. michael@369: ## michael@369: michael@369: # package information michael@369: Name: python michael@369: Summary: The Python Programming Language michael@369: URL: http://www.python.org/ michael@369: Vendor: Guido van Rossum michael@369: Packager: OpenPKG Foundation e.V. michael@369: Distribution: OpenPKG Community michael@369: Class: BASE michael@369: Group: Language michael@369: License: GPL michael@524: Version: 2.7.3 michael@524: Release: 20120800 michael@369: michael@369: # package options michael@369: %option with_readline no michael@369: %option with_db no michael@369: %option with_dbm no michael@369: %option with_curses no michael@369: %option with_zlib no michael@369: %option with_bzip2 no michael@369: %option with_xml no michael@369: %option with_locale no michael@369: %option with_ssl no michael@369: michael@369: # list of sources michael@369: Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 michael@369: Patch0: python.patch michael@369: michael@369: # build information michael@524: BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make michael@524: PreReq: OpenPKG, openpkg >= 20100101, gcc michael@369: BuildPreReq: zlib michael@369: PreReq: zlib michael@369: %if "%{with_readline}" == "yes" michael@369: BuildPreReq: readline michael@369: PreReq: readline michael@369: %endif michael@369: %if "%{with_db}" == "yes" michael@369: BuildPreReq: db michael@369: PreReq: db michael@369: %endif michael@369: %if "%{with_dbm}" == "yes" michael@369: BuildPreReq: gdbm::with_ndbm = yes michael@369: PreReq: gdbm::with_ndbm = yes michael@369: %endif michael@369: %if "%{with_curses}" == "yes" michael@369: BuildPreReq: ncurses michael@369: PreReq: ncurses michael@369: %endif michael@369: %if "%{with_zlib}" == "yes" michael@369: BuildPreReq: zlib michael@369: PreReq: zlib michael@369: %endif michael@369: %if "%{with_bzip2}" == "yes" michael@369: BuildPreReq: bzip2 michael@369: PreReq: bzip2 michael@369: %endif michael@369: %if "%{with_xml}" == "yes" michael@369: BuildPreReq: expat michael@369: PreReq: expat michael@369: %endif michael@369: %if "%{with_locale}" == "yes" michael@369: BuildPreReq: gettext, libiconv michael@369: PreReq: gettext, libiconv michael@369: %endif michael@369: %if "%{with_ssl}" == "yes" michael@369: BuildPreReq: openssl michael@369: PreReq: openssl michael@369: %endif michael@369: michael@369: %description michael@369: Python is an interpreted, interactive, object-oriented programming michael@369: language. Python combines remarkable power with very clear syntax. michael@369: It has modules, classes, exceptions, very high level dynamic data michael@369: types, and dynamic typing. There are interfaces to many system calls michael@369: and libraries, as well as to various windowing systems (X11, Motif, michael@369: Tk, Mac, MFC). New built-in modules are easily written in C or C++. michael@369: Python is also usable as an extension language for applications that michael@369: need a programmable interface. michael@369: michael@369: %track michael@369: prog python = { michael@369: version = %{version} michael@369: url = http://www.python.org/download/ michael@369: regex = Python-(2(\.\d+)+)\.tar\.bz2 michael@369: } michael@369: michael@369: %prep michael@369: %setup -q -n Python-%{version} michael@369: %patch -p0 michael@524: michael@524: %build michael@524: %{l_shtool} subst %{l_value -s -a} \ michael@524: setup.py michael@369: %{l_shtool} subst \ michael@369: -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ michael@369: -e 's;python$(VERSION);python;g' \ michael@369: Makefile.pre.in michael@369: %{l_shtool} subst \ michael@369: -e 's;\(lib/python"\) *VERSION;\1;g' \ michael@369: Modules/getpath.c michael@369: find Lib -name "*.py" -print |\ michael@369: xargs %{l_shtool} subst -q \ michael@369: -e 's;\+ *sys\.version\[:3\];;g' \ michael@369: -e 's;\+ *get_python_version();;g' michael@369: %{l_shtool} subst \ michael@369: -e 's;python\$py_version_short;python;g' \ michael@369: Lib/distutils/command/install.py michael@369: %{l_shtool} subst \ michael@369: -e 's;python{py_version_short};python;g' \ michael@369: Lib/sysconfig.py michael@369: %if "%{with_readline}" == "yes" michael@654: ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_db}" == "yes" michael@369: ( echo "_bsddb _bsddb.c %{l_cppflags} %{l_ldflags} -ldb" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_dbm}" == "yes" michael@369: ( echo "dbm dbmmodule.c -DHAVE_NDBM_H %{l_cppflags} %{l_ldflags} -lndbm -lgdbm" michael@369: echo "gdbm gdbmmodule.c -DHAVE_GDBM_H %{l_cppflags} %{l_ldflags} -lgdbm" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_curses}" == "yes" michael@369: ( echo "_curses_panel _curses_panel.c %{l_cppflags} %{l_ldflags} -lpanel -lncurses" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_zlib}" == "yes" michael@369: ( echo "zlib zlibmodule.c %{l_cppflags} %{l_ldflags} -lz" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_bzip2}" == "yes" michael@369: ( echo "bz2 bz2module.c %{l_cppflags} %{l_ldflags} -lbz2" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_xml}" == "yes" michael@369: ( echo "EXPAT_DIR=%{l_prefix}" michael@369: echo "pyexpat pyexpat.c -DHAVE_EXPAT_H %{l_cppflags} %{l_ldflags} -lexpat" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_locale}" == "yes" michael@369: ( echo "_locale _localemodule.c %{l_cppflags} %{l_ldflags} -lintl -liconv" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: %if "%{with_ssl}" == "yes" michael@369: ( echo "_socket socketmodule.c" michael@369: echo "SSL=%{l_prefix}" michael@369: echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" michael@369: ) >>Modules/Setup.local michael@369: %endif michael@369: michael@654: l_cppflags="%{l_cppflags}" michael@654: %if "%{with_curses}" == "yes" michael@654: l_cppflags="%{l_cppflags ncurses}" michael@654: %endif michael@369: CC="%{l_prefix}/bin/gcc" \ michael@369: CXX="%{l_cxx}" \ michael@369: CFLAGS="%{l_cflags -O}" \ michael@369: OPT="%{l_cflags -O}" \ michael@369: CXXFLAGS="%{l_cxxflags -O}" \ michael@654: CPPFLAGS="$l_cppflags" \ michael@369: LDFLAGS="%{l_ldflags}" \ michael@369: ./configure \ michael@369: --prefix=%{l_prefix} \ michael@369: --mandir=%{l_prefix}/man \ michael@369: --with-dbmliborder=ndbm \ michael@369: --with-gcc michael@370: %{l_make} %{l_mflags -O} michael@369: michael@369: %install michael@369: %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT michael@369: ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ michael@369: $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a michael@369: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py michael@369: rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle michael@369: rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python/test michael@369: strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true michael@369: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} michael@369: michael@369: %files -f files michael@369: michael@369: %clean michael@369: