]>
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 | |
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 | ||
20 | getpyver $1 | |
21 | shift | |
22 | ||
23 | python$PYVER -c "import sys;print '\n', sys.version, '\n'" | |
24 | ||
b6e5c445 | 25 | |
c368d904 | 26 | SETUP="python$PYVER -u setup.py" |
1c2accfc | 27 | FLAGS="USE_SWIG=1 SWIG=/opt/swig/bin/swig" |
c368d904 | 28 | OTHERFLAGS="" |
1c2accfc RD |
29 | PORTFLAGS="" |
30 | ||
31 | ||
32 | if [ "$1" = "gtk1" ]; then | |
33 | PORTFLAGS="" | |
34 | shift | |
35 | elif [ "$1" = "gtk2" ]; then | |
36 | PORTFLAGS="WXPORT=gtk2 UNICODE=1" | |
37 | shift | |
38 | fi | |
39 | ||
40 | FLAGS="$FLAGS $PORTFLAGS" | |
41 | ||
42 | ||
c368d904 RD |
43 | |
44 | ||
c368d904 RD |
45 | # "c" --> clean |
46 | if [ "$1" = "c" ]; then | |
47 | shift | |
1e4a197e | 48 | CMD="$SETUP $FLAGS $OTHERFLAGS clean $*" |
d14a1e28 | 49 | OTHERCMD="rm -f wx/*.so" |
c368d904 | 50 | |
9e689c06 RD |
51 | # "d" --> clean extension modules only |
52 | elif [ "$1" = "d" ]; then | |
53 | shift | |
d14a1e28 | 54 | CMD="rm -f wx/*.so" |
9e689c06 | 55 | |
4dfaa61e RD |
56 | # "t" --> touch *.i files |
57 | elif [ "$1" = "t" ]; then | |
58 | shift | |
ca31b3da | 59 | CMD='find . -name "*.i" | xargs touch' |
4dfaa61e | 60 | |
c368d904 RD |
61 | # "i" --> install |
62 | elif [ "$1" = "i" ]; then | |
63 | shift | |
1e4a197e | 64 | CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*" |
c368d904 RD |
65 | |
66 | # "s" --> source dist | |
67 | elif [ "$1" = "s" ]; then | |
68 | shift | |
1e4a197e | 69 | CMD="$SETUP $OTHERFLAGS sdist $*" |
c368d904 RD |
70 | |
71 | # "r" --> rpm dist | |
72 | elif [ "$1" = "r" ]; then | |
b6e5c445 | 73 | WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"` |
52ad59c2 | 74 | for VER in 21 22; do |
cfe766c3 RD |
75 | getpyver $VER |
76 | ||
77 | echo "*****************************************************************" | |
78 | echo "******* Building wxPython for Python $PYVER" | |
79 | echo "*****************************************************************" | |
80 | ||
52ad59c2 | 81 | SETUP="python$PYVER -u setup.py" |
cfe766c3 RD |
82 | |
83 | # save the original | |
84 | cp setup.py setup.py.save | |
85 | ||
86 | # fix up setup.py the way we want... | |
87 | sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp | |
88 | sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py | |
1b62f00d | 89 | |
cfe766c3 | 90 | # build wxPython-gl RPM |
52ad59c2 RD |
91 | $SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER |
92 | ### --requires=python$PYVER | |
cfe766c3 | 93 | rm dist/wxPython-gl*.tar.gz |
1b62f00d | 94 | |
cfe766c3 RD |
95 | # Build wxPython RPM |
96 | cp setup.py setup.py.temp | |
97 | sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py | |
52ad59c2 RD |
98 | $SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER |
99 | ### --requires=python$PYVER | |
1b62f00d | 100 | |
cfe766c3 RD |
101 | # put the oringal setup.py back |
102 | cp setup.py.save setup.py | |
103 | rm setup.py.* | |
1b62f00d | 104 | |
cfe766c3 RD |
105 | # rename the binary RPM's |
106 | mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm | |
107 | mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm | |
1b62f00d | 108 | |
cfe766c3 | 109 | done |
52ad59c2 | 110 | |
cfe766c3 | 111 | # rebuild the source dists without the munched up setup.py |
cfe766c3 | 112 | $SETUP $OTHERFLAGS bdist_rpm --source-only |
1b62f00d RD |
113 | exit 0 |
114 | ||
c368d904 | 115 | |
8366ae93 RD |
116 | # "f" --> FINAL (no debug) |
117 | elif [ "$1" = "f" ]; then | |
118 | shift | |
119 | CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*" | |
120 | ||
c368d904 RD |
121 | # (no command arg) --> normal build for development |
122 | else | |
8366ae93 | 123 | CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*" |
c368d904 RD |
124 | fi |
125 | ||
126 | ||
127 | echo $CMD | |
0e947004 | 128 | eval $CMD |
0b9c9522 | 129 | RC=$? |
c368d904 | 130 | |
0b9c9522 | 131 | if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then |
c368d904 RD |
132 | echo $OTHERCMD |
133 | $OTHERCMD | |
0b9c9522 | 134 | RC=$? |
c368d904 RD |
135 | fi |
136 | ||
0b9c9522 | 137 | exit $RC |