]> git.saurik.com Git - wxWidgets.git/blame - wxPython/distrib/wxPythonFull.spec.in
SourceForge patch #654210 to fix naming/numbering shared libs under OS X
[wxWidgets.git] / wxPython / distrib / wxPythonFull.spec.in
CommitLineData
357262e4
RD
1%define pref %{_prefix}
2%define python @PYTHON@
3%define pyver @PYVER@
4%define debug @DEBUG@
5%define port @PORT@
6%define lcport @LCPORT@
4726eec6 7%define tarname @TARNAME@
357262e4 8%define version @VERSION@
b817523b 9%define ver2 @VER2@
357262e4 10%define release 1
5ccc0a56 11%define wxpref %{pref}/lib/wxPython
4726eec6 12
b817523b
RD
13# Should --enable-debug_flag be used in release builds?
14%define debug_flag 1
15
16
4726eec6 17%if %{debug}
357262e4
RD
18 %define name wxPython%{port}-py%{pyver}-dbg
19 %define othername wxPython%{port}-py%{pyver}
4726eec6 20%else
357262e4
RD
21 %define name wxPython%{port}-py%{pyver}
22 %define othername wxPython%{port}-py%{pyver}-dbg
4726eec6 23%endif
4726eec6
RD
24
25
b817523b
RD
26%if %{debug} || %{debug_flag}
27 %define wxconfigname %{wxpref}/bin/wx%{lcport}d-%{ver2}-config
28%else
29 %define wxconfigname %{wxpref}/bin/wx%{lcport}-%{ver2}-config
30%endif
31
32
5ccc0a56
RD
33#----------------------------------------------------------------
34Summary: Cross platform GUI toolkit for Python using wx%{port}
35Name: %{name}
36Version: %{version}
37Release: %{release}
38Source0: %{tarname}-%{version}.tar.gz
39License: wxWindows Library Licence, Version 3
40URL: http://wxPython.org/
ba201fa4 41Packager: Robin Dunn <robin@alldunn.com>
5ccc0a56 42Group: Development/Python
4726eec6 43BuildRoot: %{_tmppath}/%{name}-buildroot
5ccc0a56
RD
44Prefix: %{pref}
45#BuildRequires: %{python}
4726eec6 46
4726eec6
RD
47Provides: wxwin
48Provides: wx%{port} = %{version}
49Provides: wxPython = %{version}
50
51
357262e4
RD
52# They conflict with each other, so let them replace each other
53Obsoletes: %{othername}
5ccc0a56
RD
54# old wxPython packages
55Obsoletes: wxPython
4726eec6
RD
56
57
58%description
59wxPython is a GUI toolkit for Python that is a wrapper around the
60wxWindows C++ GUI library. wxPython provides a large variety of
61window types and controls, all implemented with a native look and feel
62(and native runtime speed) on the platforms it is supported on.
63
5ccc0a56 64This package is implemented using the %{port} port of wxWindows, and
4726eec6
RD
65includes the wx%{port} shared libs and etc.
66
67
5ccc0a56
RD
68%package devel
69Summary: wxPython%{port} development files
70Group: Development/Libraries
71Requires: wxPython%{port} = %{version}
72
73
74%description devel
75This packages contains the headers and etc. for building apps or
76Python extension modules that use the same wx%{port} shared libraries
77that wxPython uses.
78
79#----------------------------------------------------------------
4726eec6 80%prep
357262e4 81%setup -q -n %{tarname}-%{version}
4726eec6
RD
82
83
5ccc0a56 84#----------------------------------------------------------------
4726eec6
RD
85%build
86if [ "$SMP" != "" ]; then
87 MAKE="make -j$SMP"
88else
89 MAKE="make"
90fi
91
92mkdir build
93cd build
94
95# Configure, trying to reduce dependencies
5ccc0a56
RD
96../configure --with-%{lcport} \
97 --prefix=%{wxpref} \
98 --disable-soname \
73c7ae5a 99 --enable-rpath=%{wxpref}/lib \
4726eec6
RD
100 --with-opengl \
101%if %{debug}
102 --enable-debug \
103%else
104 --enable-optimise \
b817523b
RD
105%if %{debug_flag}
106 --enable-debug_flag \
107%endif
4726eec6
RD
108%endif
109 --with-libjpeg=builtin \
110 --with-libpng=builtin \
111 --with-libtiff=builtin \
112 --with-zlib=builtin \
113
357262e4 114## --enable-debug_flag \
5ccc0a56
RD
115## --with-odbc \
116
357262e4 117
4726eec6
RD
118# Build wxWindows
119$MAKE
120
121cd ../locale
122make allmo
123
124
125# ** Unfortunately we have to do a bit of installation here so wxPython
126# can be built. Perhaps wx-config should be changed to be able to be
127# used from the build dir, maybe with an --inplace flag... Move these
128# three lines to %install if/when that happens.
129[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
130cd ../build
5ccc0a56 131make prefix=$RPM_BUILD_ROOT%{wxpref} install
4726eec6
RD
132
133
134# Now build wxPython
135cd ../wxPython
136%{python} setup.py \
137 IN_CVS_TREE=1 \
cdc6a041 138 NO_SCRIPTS=1 \
5ccc0a56 139 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
4726eec6
RD
140 build
141
142
5ccc0a56 143#----------------------------------------------------------------
4726eec6 144%install
4726eec6
RD
145%find_lang wxstd
146cd wxPython
147%{python} setup.py \
148 IN_CVS_TREE=1 \
cdc6a041 149 NO_SCRIPTS=1 \
5ccc0a56 150 WX_CONFIG="$RPM_BUILD_ROOT%{wxpref}/bin/wx-config --prefix=$RPM_BUILD_ROOT%{wxpref}" \
4726eec6
RD
151 install \
152 --root=$RPM_BUILD_ROOT
153
cdc6a041
RD
154# Since I want this RPM to be as generic as possible I won't let
155# distutils copy the scripts, since it will mangle the #! line
156# to use the real python pathname. Since some distros install
157# python 2.2 as python2 and others as python, then I can't let
158# it do that otherwise the dependencies will be fouled up. Copy
159# them manually instead:
160
161mkdir -p $RPM_BUILD_ROOT/usr/bin
162for s in \
163 img2png \
164 img2py \
165 img2xpm \
166 pycrust \
167 pyshell \
168 xrced; do
169 cp scripts/$s $RPM_BUILD_ROOT/usr/bin
170done
171
172
4726eec6
RD
173
174
5ccc0a56 175#----------------------------------------------------------------
4726eec6 176%clean
ba201fa4 177[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
4726eec6
RD
178
179
5ccc0a56 180#----------------------------------------------------------------
4726eec6
RD
181%post
182/sbin/ldconfig
183
184
5ccc0a56 185#----------------------------------------------------------------
4726eec6
RD
186%postun
187/sbin/ldconfig
188
189
190
5ccc0a56 191#----------------------------------------------------------------
4726eec6 192%files
5ccc0a56
RD
193%doc docs/preamble.txt
194%doc docs/licence.txt
195%doc docs/readme.txt
196%doc docs/changes.txt
197%doc wxPython/README.txt
198%doc wxPython/CHANGES.txt
199%defattr(-,root,root)
200%{wxpref}/lib/libwx*
201%{pref}/lib/python*
202%{wxpref}/share/
b817523b 203%{pref}/bin/*
5ccc0a56
RD
204
205
206%files devel
4726eec6 207%defattr(-,root,root)
5ccc0a56
RD
208%{wxpref}/include/wx
209%{wxpref}/lib/wx
b817523b 210%{wxconfigname}
5ccc0a56 211%{wxpref}/bin/wx-config
4726eec6
RD
212
213
5ccc0a56 214#----------------------------------------------------------------
4726eec6
RD
215%changelog
216
217# end of file