]>
Commit | Line | Data |
---|---|---|
c368d904 RD |
1 | #!/bin/sh |
2 | ||
3 | if [ "$1" = "15" ]; then | |
4 | PYVER=1.5 | |
5 | shift | |
6 | elif [ "$1" = "20" ]; then | |
7 | PYVER=2.0 | |
8 | shift | |
9e689c06 RD |
9 | elif [ "$1" = "21" ]; then |
10 | PYVER=2.1 | |
11 | shift | |
9df61a29 RD |
12 | else |
13 | echo You must specify Python version as first parameter. | |
14 | exit | |
c368d904 RD |
15 | fi |
16 | ||
17 | ||
18 | SETUP="python$PYVER -u setup.py" | |
19 | FLAGS="USE_SWIG=1 IN_CVS_TREE=1" | |
20 | OTHERFLAGS="" | |
21 | ||
22 | ||
23 | ||
24 | # "c" --> clean | |
25 | if [ "$1" = "c" ]; then | |
26 | shift | |
27 | CMD="$SETUP $FLAGS $OTHERFLAGS clean" | |
28 | OTHERCMD="rm -f wxPython/*.so" | |
29 | ||
9e689c06 RD |
30 | # "d" --> clean extension modules only |
31 | elif [ "$1" = "d" ]; then | |
32 | shift | |
33 | CMD="rm -f wxPython/*.so" | |
34 | ||
4dfaa61e RD |
35 | # "t" --> touch *.i files |
36 | elif [ "$1" = "t" ]; then | |
37 | shift | |
38 | CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i" | |
39 | ||
c368d904 RD |
40 | # "i" --> install |
41 | elif [ "$1" = "i" ]; then | |
42 | shift | |
43 | CMD="$SETUP build $OTHERFLAGS install" | |
44 | ||
45 | # "s" --> source dist | |
46 | elif [ "$1" = "s" ]; then | |
47 | shift | |
48 | CMD="$SETUP $OTHERFLAGS sdist" | |
49 | ||
50 | # "r" --> rpm dist | |
51 | elif [ "$1" = "r" ]; then | |
1b62f00d RD |
52 | |
53 | # save the original | |
54 | cp setup.py setup.py.save | |
55 | ||
56 | # fix up setup.py the way we want... | |
57 | sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp | |
58 | sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py | |
59 | ||
60 | # build wxPython-gl RPM | |
61 | $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt | |
62 | rm dist/wxPython-gl*.tar.gz | |
63 | ||
64 | # Build wxPython RPM | |
65 | cp setup.py setup.py.temp | |
66 | sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py | |
67 | $SETUP $OTHERFLAGS bdist_rpm | |
68 | ||
69 | # put the oringal back | |
70 | cp setup.py.save setup.py | |
71 | rm setup.py.* | |
72 | ||
73 | # rebuild the source dist without the munched up setup.py | |
74 | $SETUP $OTHERFLAGS sdist | |
75 | exit 0 | |
76 | ||
c368d904 RD |
77 | |
78 | # (no command arg) --> normal build for development | |
79 | else | |
80 | CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*" | |
81 | fi | |
82 | ||
83 | ||
84 | echo $CMD | |
85 | $CMD | |
86 | ||
87 | ||
88 | if [ "$OTHERCMD" != "" ]; then | |
89 | echo $OTHERCMD | |
90 | $OTHERCMD | |
91 | fi | |
92 |