]> git.saurik.com Git - wxWidgets.git/blame - wxPython/b
Added compatibility file
[wxWidgets.git] / wxPython / b
CommitLineData
c368d904
RD
1#!/bin/sh
2
cfe766c3
RD
3function getpyver {
4 if [ "$1" = "15" ]; then
5 PYVER=1.5
6 elif [ "$1" = "20" ]; then
7 PYVER=2.0
8 elif [ "$1" = "21" ]; then
9 PYVER=2.1
e6056257
RD
10 elif [ "$1" = "22" ]; then
11 PYVER=2.2
cfe766c3
RD
12 else
13 echo You must specify Python version as first parameter.
14 exit
15 fi
16}
17
18getpyver $1
19shift
20
21python$PYVER -c "import sys;print '\n', sys.version, '\n'"
22
b6e5c445 23
c368d904 24SETUP="python$PYVER -u setup.py"
b6e5c445 25FLAGS="USE_SWIG=1 IN_CVS_TREE=1" # BUILD_GLCANVAS=0"
c368d904
RD
26OTHERFLAGS=""
27
28
29
30# "c" --> clean
31if [ "$1" = "c" ]; then
32 shift
33 CMD="$SETUP $FLAGS $OTHERFLAGS clean"
34 OTHERCMD="rm -f wxPython/*.so"
35
9e689c06
RD
36# "d" --> clean extension modules only
37elif [ "$1" = "d" ]; then
38 shift
39 CMD="rm -f wxPython/*.so"
40
4dfaa61e
RD
41# "t" --> touch *.i files
42elif [ "$1" = "t" ]; then
43 shift
0e947004 44 #CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
ca31b3da 45 CMD='find . -name "*.i" | xargs touch'
4dfaa61e 46
c368d904
RD
47# "i" --> install
48elif [ "$1" = "i" ]; then
49 shift
50 CMD="$SETUP build $OTHERFLAGS install"
51
52# "s" --> source dist
53elif [ "$1" = "s" ]; then
54 shift
55 CMD="$SETUP $OTHERFLAGS sdist"
56
57# "r" --> rpm dist
58elif [ "$1" = "r" ]; then
b6e5c445 59 WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
52ad59c2 60 for VER in 21 22; do
cfe766c3
RD
61 getpyver $VER
62
63 echo "*****************************************************************"
64 echo "******* Building wxPython for Python $PYVER"
65 echo "*****************************************************************"
66
52ad59c2 67 SETUP="python$PYVER -u setup.py"
cfe766c3
RD
68
69 # save the original
70 cp setup.py setup.py.save
71
72 # fix up setup.py the way we want...
73 sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
74 sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
1b62f00d 75
cfe766c3 76 # build wxPython-gl RPM
52ad59c2
RD
77 $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
78 ### --requires=python$PYVER
cfe766c3 79 rm dist/wxPython-gl*.tar.gz
1b62f00d 80
cfe766c3
RD
81 # Build wxPython RPM
82 cp setup.py setup.py.temp
83 sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
52ad59c2
RD
84 $SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
85 ### --requires=python$PYVER
1b62f00d 86
cfe766c3
RD
87 # put the oringal setup.py back
88 cp setup.py.save setup.py
89 rm setup.py.*
1b62f00d 90
cfe766c3
RD
91 # rename the binary RPM's
92 mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
93 mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
1b62f00d 94
cfe766c3 95 done
52ad59c2 96
cfe766c3 97 # rebuild the source dists without the munched up setup.py
cfe766c3 98 $SETUP $OTHERFLAGS bdist_rpm --source-only
1b62f00d
RD
99 exit 0
100
c368d904 101
8366ae93
RD
102# "f" --> FINAL (no debug)
103elif [ "$1" = "f" ]; then
104 shift
105 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
106
c368d904
RD
107# (no command arg) --> normal build for development
108else
8366ae93 109 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
c368d904
RD
110fi
111
112
113echo $CMD
0e947004 114eval $CMD
c368d904
RD
115
116
117if [ "$OTHERCMD" != "" ]; then
118 echo $OTHERCMD
119 $OTHERCMD
120fi
121