Tue, 20 Sep 2011 15:22:39 +0200
Import package vendor original specs for necessary manipulations.
python/python.patch | file | annotate | diff | comparison | revisions | |
python/python.spec | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/python/python.patch Tue Sep 20 15:22:39 2011 +0200 1.3 @@ -0,0 +1,120 @@ 1.4 +Index: configure 1.5 +--- configure.orig 2010-11-01 02:47:19.000000000 +0100 1.6 ++++ configure 2010-12-05 18:07:39.000000000 +0100 1.7 +@@ -3904,9 +3904,9 @@ 1.8 + CFLAGS=$ac_save_CFLAGS 1.9 + elif test $ac_cv_prog_cc_g = yes; then 1.10 + if test "$GCC" = yes; then 1.11 +- CFLAGS="-g -O2" 1.12 ++ CFLAGS="-O2" 1.13 + else 1.14 +- CFLAGS="-g" 1.15 ++ CFLAGS="" 1.16 + fi 1.17 + else 1.18 + if test "$GCC" = yes; then 1.19 +@@ -5352,7 +5352,7 @@ 1.20 + # debug builds. 1.21 + OPT="-g -O0 -Wall $STRICT_PROTO" 1.22 + else 1.23 +- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO" 1.24 ++ OPT="$WRAP -O3 -Wall $STRICT_PROTO" 1.25 + fi 1.26 + ;; 1.27 + *) 1.28 +@@ -7627,24 +7627,24 @@ 1.29 + FreeBSD*) 1.30 + if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ] 1.31 + then 1.32 +- LDSHARED='$(CC) -shared ${LDFLAGS}' 1.33 +- LDCXXSHARED='$(CXX) -shared ${LDFLAGS}' 1.34 ++ LDSHARED="\$(CC) -shared ${LDFLAGS}" 1.35 ++ LDCXXSHARED="\$(CXX) -shared ${LDFLAGS}" 1.36 + else 1.37 + LDSHARED="ld -Bshareable ${LDFLAGS}" 1.38 + fi;; 1.39 + OpenBSD*) 1.40 + if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ] 1.41 + then 1.42 +- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' 1.43 +- LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}' 1.44 ++ LDSHARED="\$(CC) -shared \$(CCSHARED) ${LDFLAGS}" 1.45 ++ LDCXXSHARED="\$(CXX) -shared \$(CCSHARED) ${LDFLAGS}" 1.46 + else 1.47 + case `uname -r` in 1.48 + [01].* | 2.[0-7] | 2.[0-7].*) 1.49 + LDSHARED="ld -Bshareable ${LDFLAGS}" 1.50 + ;; 1.51 + *) 1.52 +- LDSHARED='$(CC) -shared $(CCSHARED) ${LDFLAGS}' 1.53 +- LDCXXSHARED='$(CXX) -shared $(CCSHARED) ${LDFLAGS}' 1.54 ++ LDSHARED="\$(CC) -shared \$(CCSHARED) ${LDFLAGS}" 1.55 ++ LDCXXSHARED="\$(CXX) -shared \$(CCSHARED) ${LDFLAGS}" 1.56 + ;; 1.57 + esac 1.58 + fi;; 1.59 +@@ -7751,7 +7751,7 @@ 1.60 + then 1.61 + LINKFORSHARED="-Wl,--export-dynamic" 1.62 + fi;; 1.63 +- SunOS/5*) case $CC in 1.64 ++ SunOS/5*) case gcc in 1.65 + *gcc*) 1.66 + if $CC -Xlinker --help 2>&1 | grep export-dynamic >/dev/null 1.67 + then 1.68 +Index: setup.py 1.69 +--- setup.py.orig 2010-10-31 17:40:21.000000000 +0100 1.70 ++++ setup.py 2010-12-05 18:05:56.000000000 +0100 1.71 +@@ -347,8 +347,8 @@ 1.72 + 1.73 + def detect_modules(self): 1.74 + # Ensure that /usr/local is always used 1.75 +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 1.76 +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 1.77 ++ add_dir_to_list(self.compiler.library_dirs, '@l_prefix@/lib') 1.78 ++ add_dir_to_list(self.compiler.include_dirs, '@l_prefix@/include') 1.79 + 1.80 + # Add paths specified in the environment variables LDFLAGS and 1.81 + # CPPFLAGS for header and library files. 1.82 +@@ -680,8 +680,6 @@ 1.83 + depends = ['socketmodule.h']) ) 1.84 + # Detect SSL support for the socket module (via _ssl) 1.85 + search_for_ssl_incs_in = [ 1.86 +- '/usr/local/ssl/include', 1.87 +- '/usr/contrib/ssl/include/' 1.88 + ] 1.89 + ssl_incs = find_file('openssl/ssl.h', inc_dirs, 1.90 + search_for_ssl_incs_in 1.91 +@@ -692,8 +690,7 @@ 1.92 + if krb5_h: 1.93 + ssl_incs += krb5_h 1.94 + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, 1.95 +- ['/usr/local/ssl/lib', 1.96 +- '/usr/contrib/ssl/lib/' 1.97 ++ ['@l_prefix@/lib' 1.98 + ] ) 1.99 + 1.100 + if (ssl_incs is not None and 1.101 +@@ -813,14 +810,8 @@ 1.102 + # top of the normal inc_dirs. 1.103 + db_inc_paths = [ 1.104 + '/usr/include/db4', 1.105 +- '/usr/local/include/db4', 1.106 + '/opt/sfw/include/db4', 1.107 +- '/usr/include/db3', 1.108 +- '/usr/local/include/db3', 1.109 +- '/opt/sfw/include/db3', 1.110 +- # Fink defaults (http://fink.sourceforge.net/) 1.111 + '/sw/include/db4', 1.112 +- '/sw/include/db3', 1.113 + ] 1.114 + # 4.x minor number specific paths 1.115 + for x in gen_db_minor_ver_nums(4): 1.116 +@@ -1708,6 +1699,7 @@ 1.117 + dotversion = dotversion[:-1] + '.' + dotversion[-1] 1.118 + tcl_include_sub = [] 1.119 + tk_include_sub = [] 1.120 ++ dotversion = '' 1.121 + for dir in inc_dirs: 1.122 + tcl_include_sub += [dir + os.sep + "tcl" + dotversion] 1.123 + tk_include_sub += [dir + os.sep + "tk" + dotversion]
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/python/python.spec Tue Sep 20 15:22:39 2011 +0200 2.3 @@ -0,0 +1,202 @@ 2.4 +## 2.5 +## python.spec -- OpenPKG RPM Package Specification 2.6 +## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> 2.7 +## 2.8 +## Permission to use, copy, modify, and distribute this software for 2.9 +## any purpose with or without fee is hereby granted, provided that 2.10 +## the above copyright notice and this permission notice appear in all 2.11 +## copies. 2.12 +## 2.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 2.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 2.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 2.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 2.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2.24 +## SUCH DAMAGE. 2.25 +## 2.26 + 2.27 +# package information 2.28 +Name: python 2.29 +Summary: The Python Programming Language 2.30 +URL: http://www.python.org/ 2.31 +Vendor: Guido van Rossum 2.32 +Packager: OpenPKG Foundation e.V. 2.33 +Distribution: OpenPKG Community 2.34 +Class: BASE 2.35 +Group: Language 2.36 +License: GPL 2.37 +Version: 2.7.1 2.38 +Release: 20110212 2.39 + 2.40 +# package options 2.41 +%option with_readline no 2.42 +%option with_db no 2.43 +%option with_dbm no 2.44 +%option with_curses no 2.45 +%option with_zlib no 2.46 +%option with_bzip2 no 2.47 +%option with_xml no 2.48 +%option with_locale no 2.49 +%option with_ssl no 2.50 + 2.51 +# list of sources 2.52 +Source0: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2 2.53 +Patch0: python.patch 2.54 + 2.55 +# build information 2.56 +BuildPreReq: OpenPKG, openpkg >= 20100101, gcc 2.57 +PreReq: OpenPKG, openpkg >= 20100101, gcc 2.58 +BuildPreReq: zlib 2.59 +PreReq: zlib 2.60 +%if "%{with_readline}" == "yes" 2.61 +BuildPreReq: readline 2.62 +PreReq: readline 2.63 +%endif 2.64 +%if "%{with_db}" == "yes" 2.65 +BuildPreReq: db 2.66 +PreReq: db 2.67 +%endif 2.68 +%if "%{with_dbm}" == "yes" 2.69 +BuildPreReq: gdbm::with_ndbm = yes 2.70 +PreReq: gdbm::with_ndbm = yes 2.71 +%endif 2.72 +%if "%{with_curses}" == "yes" 2.73 +BuildPreReq: ncurses 2.74 +PreReq: ncurses 2.75 +%endif 2.76 +%if "%{with_zlib}" == "yes" 2.77 +BuildPreReq: zlib 2.78 +PreReq: zlib 2.79 +%endif 2.80 +%if "%{with_bzip2}" == "yes" 2.81 +BuildPreReq: bzip2 2.82 +PreReq: bzip2 2.83 +%endif 2.84 +%if "%{with_xml}" == "yes" 2.85 +BuildPreReq: expat 2.86 +PreReq: expat 2.87 +%endif 2.88 +%if "%{with_locale}" == "yes" 2.89 +BuildPreReq: gettext, libiconv 2.90 +PreReq: gettext, libiconv 2.91 +%endif 2.92 +%if "%{with_ssl}" == "yes" 2.93 +BuildPreReq: openssl 2.94 +PreReq: openssl 2.95 +%endif 2.96 + 2.97 +%description 2.98 + Python is an interpreted, interactive, object-oriented programming 2.99 + language. Python combines remarkable power with very clear syntax. 2.100 + It has modules, classes, exceptions, very high level dynamic data 2.101 + types, and dynamic typing. There are interfaces to many system calls 2.102 + and libraries, as well as to various windowing systems (X11, Motif, 2.103 + Tk, Mac, MFC). New built-in modules are easily written in C or C++. 2.104 + Python is also usable as an extension language for applications that 2.105 + need a programmable interface. 2.106 + 2.107 +%track 2.108 + prog python = { 2.109 + version = %{version} 2.110 + url = http://www.python.org/download/ 2.111 + regex = Python-(2(\.\d+)+)\.tar\.bz2 2.112 + } 2.113 + 2.114 +%prep 2.115 + %setup -q -n Python-%{version} 2.116 + %patch -p0 2.117 + 2.118 +%build 2.119 + %{l_shtool} subst %{l_value -s -a} \ 2.120 + setup.py 2.121 + %{l_shtool} subst \ 2.122 + -e 's;altinstall bininstall maninstall;altinstall maninstall;' \ 2.123 + -e 's;python$(VERSION);python;g' \ 2.124 + Makefile.pre.in 2.125 + %{l_shtool} subst \ 2.126 + -e 's;\(lib/python"\) *VERSION;\1;g' \ 2.127 + Modules/getpath.c 2.128 + find Lib -name "*.py" -print |\ 2.129 + xargs %{l_shtool} subst -q \ 2.130 + -e 's;\+ *sys\.version\[:3\];;g' \ 2.131 + -e 's;\+ *get_python_version();;g' 2.132 + %{l_shtool} subst \ 2.133 + -e 's;python\$py_version_short;python;g' \ 2.134 + Lib/distutils/command/install.py 2.135 + %{l_shtool} subst \ 2.136 + -e 's;python{py_version_short};python;g' \ 2.137 + Lib/sysconfig.py 2.138 +%if "%{with_readline}" == "yes" 2.139 + ( echo "readline readline.c %{l_cppflags} %{l_ldflags} -lreadline -ltermcap" 2.140 + ) >>Modules/Setup.local 2.141 +%endif 2.142 +%if "%{with_db}" == "yes" 2.143 + ( echo "_bsddb _bsddb.c %{l_cppflags} %{l_ldflags} -ldb" 2.144 + ) >>Modules/Setup.local 2.145 +%endif 2.146 +%if "%{with_dbm}" == "yes" 2.147 + ( echo "dbm dbmmodule.c -DHAVE_NDBM_H %{l_cppflags} %{l_ldflags} -lndbm -lgdbm" 2.148 + echo "gdbm gdbmmodule.c -DHAVE_GDBM_H %{l_cppflags} %{l_ldflags} -lgdbm" 2.149 + ) >>Modules/Setup.local 2.150 +%endif 2.151 +%if "%{with_curses}" == "yes" 2.152 + ( echo "_curses_panel _curses_panel.c %{l_cppflags} %{l_ldflags} -lpanel -lncurses" 2.153 + ) >>Modules/Setup.local 2.154 +%endif 2.155 +%if "%{with_zlib}" == "yes" 2.156 + ( echo "zlib zlibmodule.c %{l_cppflags} %{l_ldflags} -lz" 2.157 + ) >>Modules/Setup.local 2.158 +%endif 2.159 +%if "%{with_bzip2}" == "yes" 2.160 + ( echo "bz2 bz2module.c %{l_cppflags} %{l_ldflags} -lbz2" 2.161 + ) >>Modules/Setup.local 2.162 +%endif 2.163 +%if "%{with_xml}" == "yes" 2.164 + ( echo "EXPAT_DIR=%{l_prefix}" 2.165 + echo "pyexpat pyexpat.c -DHAVE_EXPAT_H %{l_cppflags} %{l_ldflags} -lexpat" 2.166 + ) >>Modules/Setup.local 2.167 +%endif 2.168 +%if "%{with_locale}" == "yes" 2.169 + ( echo "_locale _localemodule.c %{l_cppflags} %{l_ldflags} -lintl -liconv" 2.170 + ) >>Modules/Setup.local 2.171 +%endif 2.172 +%if "%{with_ssl}" == "yes" 2.173 + ( echo "_socket socketmodule.c" 2.174 + echo "SSL=%{l_prefix}" 2.175 + echo "_ssl _ssl.c -DUSE_SSL %{l_cppflags openssl .} %{l_ldflags} -lssl -lcrypto" 2.176 + ) >>Modules/Setup.local 2.177 +%endif 2.178 + 2.179 + CC="%{l_prefix}/bin/gcc" \ 2.180 + CXX="%{l_cxx}" \ 2.181 + CFLAGS="%{l_cflags -O}" \ 2.182 + OPT="%{l_cflags -O}" \ 2.183 + CXXFLAGS="%{l_cxxflags -O}" \ 2.184 + LDFLAGS="%{l_ldflags}" \ 2.185 + ./configure \ 2.186 + --prefix=%{l_prefix} \ 2.187 + --mandir=%{l_prefix}/man \ 2.188 + --with-dbmliborder=ndbm \ 2.189 + --with-gcc 2.190 + %{l_make} %{l_mflags} 2.191 + 2.192 +%install 2.193 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 2.194 + ln $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython*.a \ 2.195 + $RPM_BUILD_ROOT%{l_prefix}/lib/python/config/libpython.a 2.196 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/smtpd.py 2.197 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/idle 2.198 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/python/test 2.199 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 2.200 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} 2.201 + 2.202 +%files -f files 2.203 + 2.204 +%clean 2.205 +