]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/wxPythonFull.spec.in
Compilation fix for MSVC 6 and wxUSE_STL=1.
[wxWidgets.git] / wxPython / distrib / wxPythonFull.spec.in
CommitLineData
357262e4
RD
1%define pref %{_prefix}
2%define python @PYTHON@
3%define pyver @PYVER@
357262e4
RD
4%define port @PORT@
5%define lcport @LCPORT@
1e4a197e 6%define unicode @UNICODE@
4726eec6 7%define tarname @TARNAME@
357262e4 8%define version @VERSION@
b817523b 9%define ver2 @VER2@
357262e4 10%define release 1
63b1cb82 11%define wxprefbase %{pref}/lib/wxPython
8b9a4190 12%define wxpref %{wxprefbase}-%{version}
1e4a197e 13%define name wxPython%{port}-py%{pyver}
4726eec6 14
b817523b 15
1e4a197e
RD
16# Should the builtin image and etc. libs be used, or system libs?
17# Distro specific RPMs should probably set this to 0, generic ones
18# should use 1
19%define builtin_libs 1
b817523b 20
4726eec6 21
1e4a197e
RD
22# Should --enable-debug_flag be used in release builds? Using it
23# defines __WXDEBUG__ and gives us runtime diagnostics that are turned
24# into Python exceptions starting with 2.3.4. (So turning it on is a
25# very helpful thing IMO and is recommended.)
26%define debug_flag 1
4726eec6 27
1e4a197e
RD
28
29# build the name of the real wx-config from the port, flags, etc.
30%define dbgflg %(if [ "%{debug_flag}" = "1" ]; then echo d; fi)
31%define uniflg %(if [ "%{unicode}" = "1" ]; then echo u; fi)
1fded56b
RD
32%define DBGFLG %(if [ "%{debug_flag}" = "1" ]; then echo D; fi)
33%define UNIFLG %(if [ "%{unicode}" = "1" ]; then echo U; fi)
1e4a197e 34%define wxconfigname %{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
b817523b 35
1fded56b
RD
36# turn off the generation of debuginfo rpm (RH9)
37%define debug_package %{nil}
b817523b 38
5ccc0a56
RD
39#----------------------------------------------------------------
40Summary: Cross platform GUI toolkit for Python using wx%{port}
41Name: %{name}
42Version: %{version}
43Release: %{release}
44Source0: %{tarname}-%{version}.tar.gz
45License: wxWindows Library Licence, Version 3
46URL: http://wxPython.org/
ba201fa4 47Packager: Robin Dunn <robin@alldunn.com>
5ccc0a56 48Group: Development/Python
4726eec6 49BuildRoot: %{_tmppath}/%{name}-buildroot
5ccc0a56 50Prefix: %{pref}
4726eec6 51
4726eec6 52Provides: wxPython = %{version}
1e4a197e 53Provides: wxPython%{port} = %{version}
4726eec6 54
59455c67
RD
55# Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so
56# Provides: libwx_%{lcport}%{uniflg}%{dbgflg}-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
57# Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so
58# Provides: libwx_%{lcport}%{uniflg}%{dbgflg}_gl-%{ver2}.so(WX%{port}%{UNIFLG}%{DBGFLG}_%{ver2})
1fded56b
RD
59
60
5ccc0a56 61# old wxPython packages
1fded56b 62Obsoletes: wxPython wxPython%{port}
4726eec6
RD
63
64
65%description
66wxPython is a GUI toolkit for Python that is a wrapper around the
67wxWindows C++ GUI library. wxPython provides a large variety of
68window types and controls, all implemented with a native look and feel
69(and native runtime speed) on the platforms it is supported on.
70
5ccc0a56 71This package is implemented using the %{port} port of wxWindows, and
4726eec6
RD
72includes the wx%{port} shared libs and etc.
73
74
1e4a197e 75%package -n wxPython%{port}-devel
5ccc0a56
RD
76Summary: wxPython%{port} development files
77Group: Development/Libraries
78Requires: wxPython%{port} = %{version}
79
80
1e4a197e 81%description -n wxPython%{port}-devel
5ccc0a56
RD
82This packages contains the headers and etc. for building apps or
83Python extension modules that use the same wx%{port} shared libraries
84that wxPython uses.
85
86#----------------------------------------------------------------
4726eec6 87%prep
357262e4 88%setup -q -n %{tarname}-%{version}
4726eec6
RD
89
90
5ccc0a56 91#----------------------------------------------------------------
4726eec6 92%build
4726eec6 93
1e4a197e 94WXDIR=`pwd`
59455c67
RD
95mkdir bld
96cd bld
4726eec6 97
1e4a197e 98# Configure, trying to reduce external dependencies
59455c67 99../configure --with-%{lcport} \
5ccc0a56
RD
100 --prefix=%{wxpref} \
101 --disable-soname \
59455c67 102 --disable-monolithic \
73c7ae5a 103 --enable-rpath=%{wxpref}/lib \
4726eec6 104 --with-opengl \
1e4a197e
RD
105%if %{unicode}
106 --enable-gtk2 \
107 --enable-unicode \
108%endif
109 --enable-geometry \
4726eec6 110 --enable-optimise \
b817523b
RD
111%if %{debug_flag}
112 --enable-debug_flag \
113%endif
1e4a197e 114%if %{builtin_libs}
4726eec6
RD
115 --with-libjpeg=builtin \
116 --with-libpng=builtin \
117 --with-libtiff=builtin \
118 --with-zlib=builtin \
1e4a197e 119%endif
5ccc0a56 120
357262e4 121
59455c67
RD
122# Build wxWindows and some contrib libs
123make
124make -C contrib/src/gizmos
125make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0"
126make -C contrib/src/stc
127make -C contrib/src/xrc
128
129
130# Install wxWindows and the contribs so the wxPython build can find
131# all the headers it needs
132make prefix=$RPM_BUILD_ROOT%{wxpref} install
133make -C contrib/src/gizmos prefix=$RPM_BUILD_ROOT%{wxpref} install
134make -C contrib/src/ogl CXXFLAGS="-DwxUSE_DEPRECATED=0" prefix=$RPM_BUILD_ROOT%{wxpref} install
135make -C contrib/src/stc prefix=$RPM_BUILD_ROOT%{wxpref} install
136make -C contrib/src/xrc prefix=$RPM_BUILD_ROOT%{wxpref} install
4726eec6 137
4726eec6
RD
138
139# Now build wxPython
1e4a197e 140cd $WXDIR/wxPython
4726eec6 141%{python} setup.py \
cdc6a041 142 NO_SCRIPTS=1 \
1e4a197e
RD
143 WXPORT=%{lcport} \
144 UNICODE=%{unicode} \
59455c67 145 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
4726eec6
RD
146 build
147
59455c67 148## $WXDIR/bld/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/bld"
1e4a197e 149
59455c67
RD
150# Build wxrc (XRC resource tool)
151cd $WXDIR/bld/contrib/utils/wxrc
152make
1e4a197e
RD
153strip wxrc
154
4726eec6 155
1e4a197e
RD
156# install wxPython
157cd $WXDIR/wxPython
4726eec6 158%{python} setup.py \
cdc6a041 159 NO_SCRIPTS=1 \
1e4a197e
RD
160 WXPORT=%{lcport} \
161 UNICODE=%{unicode} \
5ccc0a56 162 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
4726eec6
RD
163 install \
164 --root=$RPM_BUILD_ROOT
165
59455c67
RD
166
167#----------------------------------------------------------------
168%install
59455c67
RD
169
170# Other "install" tasks...
bc59c206 171WXDIR=`pwd`
59455c67
RD
172cd $WXDIR/wxPython
173
174# install the wxPython headers
175cp -R include $RPM_BUILD_ROOT%{wxpref}
176mkdir -p $RPM_BUILD_ROOT%{wxpref}/include/wx/wxPython/i_files
177cp src/*.i $RPM_BUILD_ROOT%{wxpref}/include/wx/wxPython/i_files
178
179
cdc6a041 180# Since I want this RPM to be as generic as possible I won't let
59455c67
RD
181# distutils copy the scripts (NO_SCRIPTS=1 above) since it will mangle
182# the #! line to use the real python pathname. Since some distros
183# install python 2.2 as python2 and others as python I can't let
184# distutils do that otherwise the dependencies will be fouled up.
185# Copy them manually instead, leaving the #!/bin/env line intact.
186# TODO: Should this be dependent on %{builtin_libs} or something like
187# it?
cdc6a041 188
8b9a4190 189mkdir -p $RPM_BUILD_ROOT%{pref}/bin
cdc6a041 190for s in \
1e4a197e 191 helpviewer \
cdc6a041
RD
192 img2png \
193 img2py \
194 img2xpm \
1fded56b
RD
195 pyalacarte \
196 pyalamode \
cdc6a041 197 pycrust \
1fded56b 198 pywrap \
cdc6a041
RD
199 pyshell \
200 xrced; do
8b9a4190 201 cp scripts/$s $RPM_BUILD_ROOT%{pref}/bin
cdc6a041
RD
202done
203
204
1e4a197e 205# Install wxrc
59455c67 206cp $WXDIR/bld/contrib/utils/wxrc/wxrc $RPM_BUILD_ROOT%{pref}/bin
8b9a4190
RD
207
208
209# link specific name to generic name
bc59c206 210##ln -s wxPython-%{version} $RPM_BUILD_ROOT%{wxprefbase}
4726eec6
RD
211
212
bc59c206
RD
213# install KDE & GNOME menus
214mkdir -p $RPM_BUILD_ROOT%{_datadir}/applnk/Development
215mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
216for d in distrib/*.desktop; do
217 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applnk/Development
218 install -m 644 $d $RPM_BUILD_ROOT%{_datadir}/applications
219done
220
221# install KDE icons
222mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/{16x16,32x32}/apps
223mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
224install -m 644 wx/py/PyCrust_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/PyCrust.png
225install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/PyCrust.png
226install -m 644 wx/py/PyCrust_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/PyCrust.png
227install -m 644 wx/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/XRCed.png
228install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/32x32/apps/XRCed.png
229install -m 644 wx/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/XRCed.png
230
231# install Mandrake menu
232mkdir -p $RPM_BUILD_ROOT/%{_libdir}/menu
233cat > $RPM_BUILD_ROOT%{_libdir}/menu/%{name} <<EOF
234?package(%{name}): \\
235 command="%{_bindir}/pyshell" \\
236 needs="X11" \\
237 icon="PyCrust.png" \\
238 section="Applications/Development/Tools" \\
239 title="PyShell" \\
240 longtitle="GUI Python Shell"
241?package(%{name}): \\
242 command="%{_bindir}/pycrust" \\
243 needs="X11" \\
244 icon="PyCrust.png" \\
245 section="Applications/Development/Tools" \\
246 title="PyCrust" \\
247 longtitle="GUI Python Shell with Filling"
248?package(%{name}): \\
249 command="%{_bindir}/pyalamode" \\
250 needs="X11" \\
251 icon="PyCrust.png" \\
252 section="Applications/Development/Tools" \\
253 title="PyAlaMode" \\
254 longtitle="GUI Python Shell with Filling and editor windows"
255?package(%{name}): \\
256 command="%{_bindir}/xrced" \\
257 needs="X11" \\
258 icon="XRCed.png" \\
259 section="Applications/Development/Tools" \\
260 title="XRCed" \\
261 longtitle="wxPython XRC resource editor"
262EOF
1fded56b 263
63b1cb82 264
bc59c206
RD
265#----------------------------------------------------------------
266
8b9a4190 267%pre
63b1cb82 268if [ -e %{wxprefbase} ]; then
bc59c206 269 # in case there are old dirs from an old install
8b9a4190 270 rm -r %{wxprefbase}
63b1cb82 271fi
63b1cb82 272
bc59c206
RD
273
274%post
275if [ ! -e %{wxprefbase} ]; then
276 ln -s wxPython-%{version} %{wxprefbase}
277fi
278# This is done on Mandrake to update its menus:
279if [ -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
280
281
63b1cb82
RD
282%postun
283if [ -e %{wxprefbase} ]; then
284 rm %{wxprefbase}
285fi
bc59c206
RD
286# This is done on Mandrake to update its menus:
287if [ "$1" = "0" -a -x /usr/bin/update-menus ]; then /usr/bin/update-menus || true ; fi
288
63b1cb82 289
5ccc0a56 290#----------------------------------------------------------------
bc59c206
RD
291%clean
292[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
4726eec6
RD
293
294
5ccc0a56 295#----------------------------------------------------------------
1e4a197e 296
59455c67 297%files
5ccc0a56 298%defattr(-,root,root)
59455c67 299%doc docs/preamble.txt docs/licence.txt docs/lgpl.txt docs/readme.txt docs/changes.txt
1fded56b 300%doc wxPython/docs/*
59455c67
RD
301%{_bindir}/*
302%{_libdir}/python%{pyver}/site-packages/*
303%{wxpref}/lib/libwx*
304%{wxpref}/share
bc59c206
RD
305%{_datadir}/applnk/Development/*
306%{_datadir}/applications/*
307%{_datadir}/icons/hicolor/*/apps/*
308%{_datadir}/pixmaps/*
309%{_libdir}/menu/*
310
311##%{wxprefbase}
5ccc0a56 312
4726eec6 313
59455c67
RD
314%files -n wxPython%{port}-devel
315%defattr(-,root,root)
316%{wxpref}/include
317%{wxpref}/lib/wx
318%{wxconfigname}
319%{wxpref}/bin/wx-config
4726eec6 320
5ccc0a56 321#----------------------------------------------------------------
4726eec6 322# end of file