]>
Commit | Line | Data |
---|---|---|
c368d904 RD |
1 | #!/bin/sh |
2 | ||
cfe766c3 RD |
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 | ||
085f07e2 | 21 | WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"` |
c368d904 RD |
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 | ||
9e689c06 RD |
34 | # "d" --> clean extension modules only |
35 | elif [ "$1" = "d" ]; then | |
36 | shift | |
37 | CMD="rm -f wxPython/*.so" | |
38 | ||
4dfaa61e RD |
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 | ||
c368d904 RD |
44 | # "i" --> install |
45 | elif [ "$1" = "i" ]; then | |
46 | shift | |
47 | CMD="$SETUP build $OTHERFLAGS install" | |
48 | ||
49 | # "s" --> source dist | |
50 | elif [ "$1" = "s" ]; then | |
51 | shift | |
52 | CMD="$SETUP $OTHERFLAGS sdist" | |
53 | ||
54 | # "r" --> rpm dist | |
55 | elif [ "$1" = "r" ]; then | |
1b62f00d | 56 | |
cfe766c3 RD |
57 | for VER in 15 20 21; do |
58 | getpyver $VER | |
59 | ||
60 | echo "*****************************************************************" | |
61 | echo "******* Building wxPython for Python $PYVER" | |
62 | echo "*****************************************************************" | |
63 | ||
64 | # NOTE: This assumes that /usr/local/bin is BEFORE /usr/bin on the PATH | |
65 | # AND that you have write access to it. | |
66 | rm -f /usr/local/bin/python | |
67 | ln -s /usr/bin/python$PYVER /usr/local/bin/python | |
68 | SETUP="/usr/local/bin/python -u setup.py" | |
69 | ||
70 | # save the original | |
71 | cp setup.py setup.py.save | |
72 | ||
73 | # fix up setup.py the way we want... | |
74 | sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp | |
75 | sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py | |
1b62f00d | 76 | |
cfe766c3 RD |
77 | # build wxPython-gl RPM |
78 | $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt | |
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 | |
84 | $SETUP $OTHERFLAGS bdist_rpm --binary-only | |
1b62f00d | 85 | |
cfe766c3 RD |
86 | # put the oringal setup.py back |
87 | cp setup.py.save setup.py | |
88 | rm setup.py.* | |
1b62f00d | 89 | |
cfe766c3 RD |
90 | # rename the binary RPM's |
91 | mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm | |
92 | mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm | |
1b62f00d | 93 | |
cfe766c3 RD |
94 | done |
95 | # rebuild the source dists without the munched up setup.py | |
1b62f00d | 96 | $SETUP $OTHERFLAGS sdist |
cfe766c3 | 97 | $SETUP $OTHERFLAGS bdist_rpm --source-only |
1b62f00d RD |
98 | exit 0 |
99 | ||
c368d904 RD |
100 | |
101 | # (no command arg) --> normal build for development | |
102 | else | |
103 | CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*" | |
104 | fi | |
105 | ||
106 | ||
107 | echo $CMD | |
108 | $CMD | |
109 | ||
110 | ||
111 | if [ "$OTHERCMD" != "" ]; then | |
112 | echo $OTHERCMD | |
113 | $OTHERCMD | |
114 | fi | |
115 |