]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/wxPythonFull.spec.in
use alpha channel in Blit() as well and not only in DrawBitmap()
[wxWidgets.git] / wxPython / distrib / wxPythonFull.spec.in
1 %define pref %{_prefix}
2 %define python @PYTHON@
3 %define pyver @PYVER@
4 %define port @PORT@
5 %define lcport @LCPORT@
6 %define unicode @UNICODE@
7 %define tarname @TARNAME@
8 %define version @VERSION@
9 %define ver2 @VER2@
10 %define release 1
11 %define wxpref %{pref}/lib/wxPython
12 %define name wxPython%{port}-py%{pyver}
13
14
15 # Should the builtin image and etc. libs be used, or system libs?
16 # Distro specific RPMs should probably set this to 0, generic ones
17 # should use 1
18 %define builtin_libs 1
19
20
21 # Should --enable-debug_flag be used in release builds? Using it
22 # defines __WXDEBUG__ and gives us runtime diagnostics that are turned
23 # into Python exceptions starting with 2.3.4. (So turning it on is a
24 # very helpful thing IMO and is recommended.)
25 %define debug_flag 1
26
27
28 # build the name of the real wx-config from the port, flags, etc.
29 %define dbgflg %(if [ "%{debug_flag}" = "1" ]; then echo d; fi)
30 %define uniflg %(if [ "%{unicode}" = "1" ]; then echo u; fi)
31 %define wxconfigname %{wxpref}/bin/wx%{lcport}%{uniflg}%{dbgflg}-%{ver2}-config
32
33
34 #----------------------------------------------------------------
35 Summary: Cross platform GUI toolkit for Python using wx%{port}
36 Name: %{name}
37 Version: %{version}
38 Release: %{release}
39 Source0: %{tarname}-%{version}.tar.gz
40 License: wxWindows Library Licence, Version 3
41 URL: http://wxPython.org/
42 Packager: Robin Dunn <robin@alldunn.com>
43 Group: Development/Python
44 BuildRoot: %{_tmppath}/%{name}-buildroot
45 Prefix: %{pref}
46 #BuildRequires: %{python}
47
48 Provides: wxPython = %{version}
49 Provides: wxPython%{port} = %{version}
50
51 # old wxPython packages
52 Obsoletes: wxPython
53
54
55 %description
56 wxPython is a GUI toolkit for Python that is a wrapper around the
57 wxWindows C++ GUI library. wxPython provides a large variety of
58 window types and controls, all implemented with a native look and feel
59 (and native runtime speed) on the platforms it is supported on.
60
61 This package is implemented using the %{port} port of wxWindows, and
62 includes the wx%{port} shared libs and etc.
63
64
65 %package -n wxPython%{port}-devel
66 Summary: wxPython%{port} development files
67 Group: Development/Libraries
68 Requires: wxPython%{port} = %{version}
69
70
71 %description -n wxPython%{port}-devel
72 This packages contains the headers and etc. for building apps or
73 Python extension modules that use the same wx%{port} shared libraries
74 that wxPython uses.
75
76 #----------------------------------------------------------------
77 %prep
78 %setup -q -n %{tarname}-%{version}
79
80
81 #----------------------------------------------------------------
82 %build
83 if [ "$SMP" != "" ]; then
84 MAKE="make -j$SMP"
85 else
86 MAKE="make"
87 fi
88
89 WXDIR=`pwd`
90 mkdir build
91 cd build
92
93 # Configure, trying to reduce external dependencies
94 $WXDIR/configure --with-%{lcport} \
95 --prefix=%{wxpref} \
96 --disable-soname \
97 --enable-rpath=%{wxpref}/lib \
98 --with-opengl \
99 %if %{unicode}
100 --enable-gtk2 \
101 --enable-unicode \
102 %endif
103 --enable-geometry \
104 --enable-optimise \
105 %if %{debug_flag}
106 --enable-debug_flag \
107 %endif
108 %if %{builtin_libs}
109 --with-libjpeg=builtin \
110 --with-libpng=builtin \
111 --with-libtiff=builtin \
112 --with-zlib=builtin \
113 %endif
114
115
116 # Build wxWindows
117 $MAKE
118
119
120 # Now build wxPython
121 cd $WXDIR/wxPython
122 %{python} setup.py \
123 IN_CVS_TREE=1 \
124 NO_SCRIPTS=1 \
125 WXPORT=%{lcport} \
126 UNICODE=%{unicode} \
127 WX_CONFIG="$WXDIR/build/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/build" \
128 build
129
130 ## WX_CONFIG="$WXDIR/build/wx-config --inplace --prefix=$RPM_BUILD_ROOT%{wxpref}" \
131
132
133
134 # Build wxrc (XRC resource tool) but don't use the makefiles since they expect
135 # a shared version of the xrc lib to have been built...
136 cd $WXDIR/contrib/utils/wxrc
137 WX_CONFIG="$WXDIR/build/wx-config --prefix=$WXDIR --exec-prefix=$WXDIR/build"
138 wCC=`$WX_CONFIG --cc`
139 wCXX=`$WX_CONFIG --cxx`
140
141 for f in wxrc.cpp ../../src/xrc/*.cpp; do
142 echo $f
143 $wCXX `$WX_CONFIG --cxxflags` -I ../../include -I ../../src/xrc/expat/xmlparse -I ../../src/xrc/expat/xmltok -c $f
144 done
145 for f in ../../src/xrc/expat/xmlparse/xmlparse.c ../../src/xrc/expat/xmltok/xmlrole.c ../../src/xrc/expat/xmltok/xmltok.c; do
146 echo $f
147 $wCC `$WX_CONFIG --cxxflags` -I ../../include -I ../../src/xrc/expat/xmlparse -I ../../src/xrc/expat/xmltok -c $f
148 done
149
150 # the handlers are not needed
151 rm xh_*.o xmlrsall.o
152
153 $wCXX `$WX_CONFIG --libs` *.o -o wxrc
154 strip wxrc
155
156
157 #----------------------------------------------------------------
158 %install
159 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
160
161 # install wxWindows
162 WXDIR=`pwd`
163 cd build
164 make prefix=$RPM_BUILD_ROOT%{wxpref} install
165
166 # install wxPython
167 cd $WXDIR/wxPython
168 %{python} setup.py \
169 IN_CVS_TREE=1 \
170 NO_SCRIPTS=1 \
171 WXPORT=%{lcport} \
172 UNICODE=%{unicode} \
173 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
174 install \
175 --root=$RPM_BUILD_ROOT
176
177 # Since I want this RPM to be as generic as possible I won't let
178 # distutils copy the scripts since it will mangle the #! line to use
179 # the real python pathname. Since some distros install python 2.2 as
180 # python2 and others as python, then I can't let distutils do that
181 # otherwise the dependencies will be fouled up. Copy them manually
182 # instead, leaving the #!/bin/env line intact.
183 #
184 # TODO: Should this be dependent on %{builtin_libs} or something like it?
185
186 mkdir -p $RPM_BUILD_ROOT/usr/bin
187 for s in \
188 helpviewer \
189 img2png \
190 img2py \
191 img2xpm \
192 pycrust \
193 pycwrap \
194 pyshell \
195 xrced; do
196 cp scripts/$s $RPM_BUILD_ROOT/%{pref}/bin
197 done
198
199
200 # Install wxrc
201 cp $WXDIR/contrib/utils/wxrc/wxrc $RPM_BUILD_ROOT/%{pref}/bin
202
203
204 # Generate the filelists. For some reason the %defattr below is still
205 # resulting in many (but not all) files not owned by root when just
206 # specifying directories and wildcards to be included in each package.
207 # So instead we'll build some explicit filelists here and use %attr on
208 # each entry.
209 cd $WXDIR
210 mkdir -p $RPM_BUILD_ROOT%{pref}/share/doc
211 GFL="%{python} wxPython/distrib/genfilelist.py"
212 $GFL $RPM_BUILD_ROOT %{pref} > FILELIST
213 $GFL -r $RPM_BUILD_ROOT %{pref}/bin >> FILELIST
214 $GFL $RPM_BUILD_ROOT %{pref}/lib >> FILELIST
215 $GFL -r $RPM_BUILD_ROOT %{pref}/lib/python%{pyver} >> FILELIST
216 $GFL -r $RPM_BUILD_ROOT %{pref}/share >> FILELIST
217 $GFL $RPM_BUILD_ROOT %{wxpref} >> FILELIST
218 $GFL $RPM_BUILD_ROOT %{wxpref}/lib >> FILELIST
219 $GFL $RPM_BUILD_ROOT "%{wxpref}/lib/libwx*" >> FILELIST
220 $GFL -r $RPM_BUILD_ROOT %{wxpref}/share >> FILELIST
221
222 $GFL $RPM_BUILD_ROOT %{wxpref}/include > DEVELLIST
223 $GFL -r $RPM_BUILD_ROOT %{wxpref}/include/wx >> DEVELLIST
224 $GFL -r $RPM_BUILD_ROOT %{wxpref}/lib/wx >> DEVELLIST
225 $GFL $RPM_BUILD_ROOT %{wxconfigname} >> DEVELLIST
226 $GFL $RPM_BUILD_ROOT %{wxpref}/bin/wx-config >> DEVELLIST
227
228
229 #----------------------------------------------------------------
230 %clean
231 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
232
233
234 #----------------------------------------------------------------
235
236 %files -f FILELIST
237 %defattr(-,root,root)
238 %doc docs/preamble.txt docs/licence.txt docs/readme.txt docs/changes.txt
239 %doc wxPython/README.txt wxPython/CHANGES.txt
240
241
242 %files -n wxPython%{port}-devel -f DEVELLIST
243 %defattr(-,root,root)
244
245
246 #----------------------------------------------------------------
247 # end of file