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