]> git.saurik.com Git - wxWidgets.git/blob - wxPython/b
use "..." instead of <...> for wx headers
[wxWidgets.git] / wxPython / b
1 #!/bin/sh
2
3 function 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
10 else
11 echo You must specify Python version as first parameter.
12 exit
13 fi
14 }
15
16 getpyver $1
17 shift
18
19 python$PYVER -c "import sys;print '\n', sys.version, '\n'"
20
21 WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
22 SETUP="python$PYVER -u setup.py"
23 FLAGS="USE_SWIG=1 IN_CVS_TREE=1"
24 OTHERFLAGS=""
25
26
27
28 # "c" --> clean
29 if [ "$1" = "c" ]; then
30 shift
31 CMD="$SETUP $FLAGS $OTHERFLAGS clean"
32 OTHERCMD="rm -f wxPython/*.so"
33
34 # "d" --> clean extension modules only
35 elif [ "$1" = "d" ]; then
36 shift
37 CMD="rm -f wxPython/*.so"
38
39 # "t" --> touch *.i files
40 elif [ "$1" = "t" ]; then
41 shift
42 #CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
43 CMD='find . -name "*.i" | xargs -l touch'
44
45 # "i" --> install
46 elif [ "$1" = "i" ]; then
47 shift
48 CMD="$SETUP build $OTHERFLAGS install"
49
50 # "s" --> source dist
51 elif [ "$1" = "s" ]; then
52 shift
53 CMD="$SETUP $OTHERFLAGS sdist"
54
55 # "r" --> rpm dist
56 elif [ "$1" = "r" ]; then
57
58 for VER in 15 20 21; do
59 getpyver $VER
60
61 echo "*****************************************************************"
62 echo "******* Building wxPython for Python $PYVER"
63 echo "*****************************************************************"
64
65 # NOTE: This assumes that /usr/local/bin is BEFORE /usr/bin on the PATH
66 # AND that you have write access to it.
67 rm -f /usr/local/bin/python
68 ln -s /usr/bin/python$PYVER /usr/local/bin/python
69 SETUP="/usr/local/bin/python -u setup.py"
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
77
78 # build wxPython-gl RPM
79 $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt
80 rm dist/wxPython-gl*.tar.gz
81
82 # Build wxPython RPM
83 cp setup.py setup.py.temp
84 sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
85 $SETUP $OTHERFLAGS bdist_rpm --binary-only
86
87 # put the oringal setup.py back
88 cp setup.py.save setup.py
89 rm setup.py.*
90
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
94
95 done
96 # rebuild the source dists without the munched up setup.py
97 $SETUP $OTHERFLAGS sdist
98 $SETUP $OTHERFLAGS bdist_rpm --source-only
99 exit 0
100
101
102 # "f" --> FINAL (no debug)
103 elif [ "$1" = "f" ]; then
104 shift
105 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
106
107 # (no command arg) --> normal build for development
108 else
109 CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
110 fi
111
112
113 echo $CMD
114 eval $CMD
115
116
117 if [ "$OTHERCMD" != "" ]; then
118 echo $OTHERCMD
119 $OTHERCMD
120 fi
121