]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/wxPythonFull.spec.in
adding protected inquiry function whether a child window belongs to the 'client'...
[wxWidgets.git] / wxPython / distrib / wxPythonFull.spec.in
CommitLineData
70934952
RD
1#----------------------------------------------------------------------
2# Name: wxPython.spec
3# Purpose: RPM Build and packaging instructions
4#
5# Author: Robin Dunn
6#
7# RCS-ID: $Id$
8# Copyright: (c) 2004 by Total Control Software
9# Licence: wxWindows license
10#----------------------------------------------------------------------
11
12
13# The following values can be set on the rpmbuild command line with
14# --define 'name VALUE' If no value is set on the command line then
15# the default value set here will be used instead.
16
17
b908d8bf
RD
18# Which version of Python to build with. Used to assemble python
19# binary name so use '2.2', '2.3', etc.
20%if %{?pyver:0}%{!?pyver:1}
21%define pyver 2.3
70934952 22%endif
4726eec6 23
b817523b 24
b908d8bf 25# Which wxWidgets port to build and use. Current acceptable values
70934952
RD
26# are 'gtk' and 'gtk2'.
27%if %{?port:0}%{!?port:1}
28%define port gtk2
ca46ba60
RD
29%endif
30
31
70934952
RD
32# Build in unicode mode? Can only be used if port is gtk2, acceptable
33# values are '0' and '1'
34%if %{?unicode:0}%{!?unicode:1}
35%define unicode 1
36%endif
37
70934952 38
1e4a197e
RD
39# Should the builtin image and etc. libs be used, or system libs?
40# Distro specific RPMs should probably set this to 0, generic ones
70934952
RD
41# should use 1.
42# NOTE: I'm trying 0 for this next release to see if I can get rid of
43# this...
44%if %{?builtin_libs:0}%{!?builtin_libs:1}
45%define builtin_libs 0
46%endif
b817523b 47
4726eec6 48
1e4a197e
RD
49# Should --enable-debug_flag be used in release builds? Using it
50# defines __WXDEBUG__ and gives us runtime diagnostics that are turned
70934952
RD
51# into Python exceptions. (So turning it on is a very helpful thing
52# IMO and is recommended.) The code is still compiled with
53# optimization flags and and without debug info and such when this
54# option is used, it simply turns on some extra code.
55%if %{?debug_flag:0}%{!?debug_flag:1}
1e4a197e 56%define debug_flag 1
70934952
RD
57%endif
58
59
b908d8bf
RD
60# Used to set the Release tag below. I normally use it to define what
61# distro the RPM was build on and also include the version of Python
62# it was built with.
63%if %{?release:0}%{!?release:1}
64%define release 1_py%{pyver}
65%endif
66
67
68
70934952
RD
69#----------------------------------------------------------------------
70# Other variables used below
71
72%define pref %{_prefix}
73%define python /usr/bin/python%{pyver}
74%define tarname @TARNAME@
75%define version @VERSION@
76%define ver2 @VER2@
4726eec6 77
70934952
RD
78%define chartype %(if [ "%{unicode}" = "1" ]; then echo unicode; else echo ansi; fi)
79%define gtktype %(if [ "%{port}" = "gtk2" ]; then echo 2; fi)
80%define using_gtk1 %(if [ "%{port}" = "gtk" ]; then echo 1; else echo 0; fi)
1e4a197e 81
70934952
RD
82%define wxprefbase %{pref}/lib/wxPython
83%define wxpref %{wxprefbase}-%{version}-%{port}-%{chartype}
84%define pkgname wxPython
b817523b 85
70934952 86# turn off the generation of debuginfo rpm (RH9) ??
1fded56b 87%define debug_package %{nil}
b817523b 88
70934952
RD
89
90#----------------------------------------------------------------------
91# Package definition
92#----------------------------------------------------------------------
93Name: %{pkgname}%{ver2}
94Summary: Cross platform GUI toolkit for Python
5ccc0a56
RD
95Version: %{version}
96Release: %{release}
97Source0: %{tarname}-%{version}.tar.gz
6e83b721 98License: wx Library Licence, Version 3
5ccc0a56 99URL: http://wxPython.org/
ba201fa4 100Packager: Robin Dunn <robin@alldunn.com>
5ccc0a56 101Group: Development/Python
70934952 102BuildRoot: %{_tmppath}/%{pkgname}-buildroot
5ccc0a56 103Prefix: %{pref}
4726eec6 104
70934952
RD
105%description
106Cross platform GUI toolkit for Python
4726eec6 107
1fded56b
RD
108
109
4726eec6 110
70934952
RD
111%package -n %{pkgname}%{ver2}-%{port}-%{chartype}
112Summary: Cross platform GUI toolkit for Python
113Group: Development/Python
114Requires: %{pkgname}-common
115Obsoletes: wxPythonGTK%{gtktype}-py%{pyver}
116Provides: wxPython
4726eec6 117
4726eec6 118
70934952
RD
119%description -n %{pkgname}%{ver2}-%{port}-%{chartype}
120wxPython is a GUI toolkit for the Python programming language. It
121 allows Python programmers to create programs with a robust, highly
122functional graphical user interface, simply and easily. It is
123implemented as a Python extension module (native code) that wraps the
124popular wxWidgets cross platform GUI library, which is written in C++.
4726eec6 125
70934952
RD
126wxPython is a cross-platform toolkit. The same program will usually
127run on multiple platforms without modification. Currently supported
128platforms are 32-bit Microsoft Windows, most Unix or unix-like
129systems, and Macintosh OS X.
130
131This package contains the wxPython runtime files built for the
132wxWidgets %{port} port with %{chartype} character type.
4726eec6 133
5ccc0a56
RD
134
135
70934952
RD
136
137
138%package -n %{pkgname}-common-%{port}-%{chartype}
139Summary: Common files for needed by all wxPython runtimes
140Group: Development/Python
141Provides: %{pkgname}-common
142
143# They obsolete each other so any of them can be installed over another
144# without conflicts
145Obsoletes: %{pkgname}-common-gtk-ansi
146Obsoletes: %{pkgname}-common-gtk2-ansi
147Obsoletes: %{pkgname}-common-gtk2-unicode
148
149%description -n %{pkgname}-common-%{port}-%{chartype}
150This package contains the common files needed by any version of the
151wxPython runtime. This pacakge also installs a wx.pth file which will
152determine which of the installed runtimes is the default version of
153wxPython that is imported automatically with a bare "import wx".
154
155
156
157
158
159%package -n %{pkgname}%{ver2}-devel-%{port}-%{chartype}
160Summary: wxPython development files
161Group: Development/Libraries
162Requires: %{pkgname}%{ver2}-%{port}-%{chartype} = %{version}
163
164%description -n %{pkgname}%{ver2}-devel-%{port}-%{chartype}
5ccc0a56 165This packages contains the headers and etc. for building apps or
70934952 166Python extension modules that use the same wxWidgets shared libraries
5ccc0a56
RD
167that wxPython uses.
168
70934952
RD
169
170
171#----------------------------------------------------------------------
4726eec6 172%prep
357262e4 173%setup -q -n %{tarname}-%{version}
4726eec6
RD
174
175
70934952 176#----------------------------------------------------------------------
4726eec6 177%build
4726eec6 178
1e4a197e 179WXDIR=`pwd`
70934952
RD
180
181# Configure and build wxWidgets
59455c67
RD
182mkdir bld
183cd bld
70934952 184../configure --with-gtk \
5ccc0a56 185 --prefix=%{wxpref} \
70934952 186 --enable-monolithic \
8da2fe32 187 --disable-rpath \
4726eec6 188 --with-opengl \
1e4a197e 189 --enable-geometry \
4726eec6 190 --enable-optimise \
7f997e3f 191 --enable-sound --with-sdl \
96d37ab5 192 --enable-display \
70934952
RD
193%if %{using_gtk1}
194 --disable-gtk2 \
195%else
196 --enable-gtk2 \
197%endif
198%if %{unicode}
199 --enable-unicode \
200%endif
b817523b
RD
201%if %{debug_flag}
202 --enable-debug_flag \
203%endif
8c1a4666 204 --disable-debugreport \
1e4a197e 205%if %{builtin_libs}
4726eec6
RD
206 --with-libjpeg=builtin \
207 --with-libpng=builtin \
208 --with-libtiff=builtin \
209 --with-zlib=builtin \
1e4a197e 210%endif
5ccc0a56 211
357262e4 212
59455c67
RD
213make
214make -C contrib/src/gizmos
6a84cd6d 215##make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0"
59455c67 216make -C contrib/src/stc
59455c67
RD
217
218
70934952
RD
219
220# Build wxPython
1e4a197e 221cd $WXDIR/wxPython
4726eec6 222%{python} setup.py \
70934952 223 WXPORT=%{port} \
1e4a197e 224 UNICODE=%{unicode} \
70934952
RD
225 EP_ADD_OPTS=1 \
226 NO_SCRIPTS=1 \
8da2fe32
RD
227 WX_CONFIG="$WXDIR/bld/wx-config --no_rpath" \
228 build_ext --rpath=%{wxpref}/lib \
229 build
4726eec6 230
1e4a197e 231
1e4a197e 232
70934952 233#----------------------------------------------------------------------
978cadd0
RD
234%install
235
236WXDIR=`pwd`
978cadd0 237
70934952
RD
238# Install wxGTK and contribs
239cd bld
978cadd0
RD
240make prefix=$RPM_BUILD_ROOT%{wxpref} install
241make -C contrib/src/gizmos prefix=$RPM_BUILD_ROOT%{wxpref} install
6a84cd6d 242##make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" prefix=$RPM_BUILD_ROOT%{wxpref} install
978cadd0 243make -C contrib/src/stc prefix=$RPM_BUILD_ROOT%{wxpref} install
978cadd0
RD
244
245
70934952
RD
246
247# Install wxPython for wxGTK
1e4a197e 248cd $WXDIR/wxPython
4726eec6 249%{python} setup.py \
70934952 250 WXPORT=%{port} \
1e4a197e 251 UNICODE=%{unicode} \
70934952
RD
252 EP_ADD_OPTS=1 \
253 NO_SCRIPTS=1 \
8da2fe32
RD
254 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref} --no_rpath" \
255 build_ext --rpath=%{wxpref}/lib \
4726eec6
RD
256 install \
257 --root=$RPM_BUILD_ROOT
258
59455c67 259
70934952
RD
260# remove the wx-config symlink, we'll redo it when installing the -devel package
261rm $RPM_BUILD_ROOT%{wxpref}/bin/wx-config
262
263# make sure that debug info is stripped
264strip $RPM_BUILD_ROOT%{pref}/lib*/python%{pyver}/site-packages/wx-%{ver2}*-%{port}-%{chartype}/wx/*.so
59455c67 265
59455c67 266
cdc6a041 267# Since I want this RPM to be as generic as possible I won't let
59455c67
RD
268# distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
269# the #! line to use the real python pathname. Since some distros
270# install python 2.2 as python2 and others as python I can't let
271# distutils do that otherwise the dependencies will be fouled up.
70934952
RD
272# Copy them manually instead, leaving the #!/usr/bin/env line intact.
273cd $WXDIR/wxPython
8b9a4190 274mkdir -p $RPM_BUILD_ROOT%{pref}/bin
cdc6a041 275for s in \
1e4a197e 276 helpviewer \
cdc6a041
RD
277 img2png \
278 img2py \
279 img2xpm \
1fded56b
RD
280 pyalacarte \
281 pyalamode \
cdc6a041 282 pycrust \
1fded56b 283 pywrap \
cdc6a041 284 pyshell \
70934952 285 pywxrc \
cdc6a041 286 xrced; do
8b9a4190 287 cp scripts/$s $RPM_BUILD_ROOT%{pref}/bin
cdc6a041
RD
288done
289
290
8b9a4190 291
70934952 292# install KDE & GNOME menu items
bc59c206
RD
293mkdir -p $RPM_BUILD_ROOT%{_datadir}/applnk/Development
294mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
295for d in distrib/*.desktop; do
296 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applnk/Development
297 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applications
298done
299
300# install KDE icons
301mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32}/apps
302mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
303install -m 644 wx/py/PyCrust_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/PyCrust.png
304install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/PyCrust.png
305install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/PyCrust.png
306install -m 644 wx/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/XRCed.png
307install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/XRCed.png
308install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/XRCed.png
309
70934952 310# install Mandrake menu items
ea48a085 311mkdir -p $RPM_BUILD_ROOT%{_libdir}/menu
70934952
RD
312cat > $RPM_BUILD_ROOT%{_libdir}/menu/%{pkgname} <<EOF
313?package(%{pkgname}): \\
bc59c206
RD
314 command="%{_bindir}/pyshell" \\
315 needs="X11" \\
316 icon="PyCrust.png" \\
317 section="Applications/Development/Tools" \\
318 title="PyShell" \\
319 longtitle="GUI Python Shell"
70934952 320?package(%{pkgname}): \\
bc59c206
RD
321 command="%{_bindir}/pycrust" \\
322 needs="X11" \\
323 icon="PyCrust.png" \\
324 section="Applications/Development/Tools" \\
325 title="PyCrust" \\
326 longtitle="GUI Python Shell with Filling"
70934952 327?package(%{pkgname}): \\
bc59c206
RD
328 command="%{_bindir}/pyalamode" \\
329 needs="X11" \\
330 icon="PyCrust.png" \\
331 section="Applications/Development/Tools" \\
332 title="PyAlaMode" \\
333 longtitle="GUI Python Shell with Filling and editor windows"
70934952 334?package(%{pkgname}): \\
bc59c206
RD
335 command="%{_bindir}/xrced" \\
336 needs="X11" \\
337 icon="XRCed.png" \\
338 section="Applications/Development/Tools" \\
339 title="XRCed" \\
340 longtitle="wxPython XRC resource editor"
341EOF
1fded56b 342
63b1cb82 343
70934952 344#----------------------------------------------------------------------
bc59c206 345
70934952
RD
346%post -n %{pkgname}%{ver2}-%{port}-%{chartype}
347if [ ! -e %{wxprefbase} ]; then
348 ln -s %{pkgname}-%{version}-%{port}-%{chartype} %{wxprefbase}
63b1cb82 349fi
63b1cb82 350
70934952
RD
351%preun -n %{pkgname}%{ver2}-%{port}-%{chartype}
352if [ -L %{wxprefbase} ]; then
353 if [ `readlink %{wxprefbase}` == %{pkgname}-%{version}-%{port}-%{chartype} ]; then
354 rm -f %{wxprefbase}
355 fi
bc59c206 356fi
70934952
RD
357
358
359
360
361%post -n %{pkgname}-common-%{port}-%{chartype}
bc59c206
RD
362# This is done on Mandrake to update its menus:
363if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
364
70934952 365%postun -n %{pkgname}-common-%{port}-%{chartype}
bc59c206
RD
366# This is done on Mandrake to update its menus:
367if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
368
63b1cb82 369
70934952
RD
370
371%post -n %{pkgname}%{ver2}-devel-%{port}-%{chartype}
372cd %{wxpref}/bin
373ln -s ../lib/wx/config/%{port}-%{chartype}* wx-config
374
375%preun -n %{pkgname}%{ver2}-devel-%{port}-%{chartype}
376rm %{wxpref}/bin/wx-config
377
378
379#----------------------------------------------------------------------
bc59c206
RD
380%clean
381[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
4726eec6
RD
382
383
70934952 384#----------------------------------------------------------------------
1e4a197e 385
70934952 386%files -n %{pkgname}%{ver2}-%{port}-%{chartype}
5ccc0a56 387%defattr(-,root,root)
59455c67 388%doc docs/preamble.txt docs/licence.txt docs/lgpl.txt docs/readme.txt docs/changes.txt
1fded56b 389%doc wxPython/docs/*
70934952
RD
390%dir %{pref}/lib*/python%{pyver}/site-packages/wx-%{ver2}*-%{port}-%{chartype}
391%{pref}/lib*/python%{pyver}/site-packages/wx-%{ver2}*-%{port}-%{chartype}/*
a55bea57
RD
392%dir %{wxpref}
393%dir %{wxpref}/lib
70934952 394%{wxpref}/lib/libwx_gtk*
59455c67 395%{wxpref}/share
70934952
RD
396
397
398
399%files -n %{pkgname}-common-%{port}-%{chartype}
400%defattr(-,root,root)
401%{pref}/lib*/python%{pyver}/site-packages/wxversion.*
402%{pref}/lib*/python%{pyver}/site-packages/wx.pth
403%{_bindir}/*
bc59c206
RD
404%{_datadir}/applnk/Development/*
405%{_datadir}/applications/*
406%{_datadir}/icons/hicolor/*/apps/*
407%{_datadir}/pixmaps/*
408%{_libdir}/menu/*
409
5ccc0a56 410
4726eec6 411
70934952
RD
412
413
414%files -n %{pkgname}%{ver2}-devel-%{port}-%{chartype}
59455c67
RD
415%defattr(-,root,root)
416%{wxpref}/include
417%{wxpref}/lib/wx
70934952
RD
418%dir %{wxpref}/bin
419
4726eec6 420
70934952 421#----------------------------------------------------------------------
4726eec6 422# end of file