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