File: b

package info (click to toggle)
wxwindows2.4 2.4.5.1.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 59,920 kB
  • ctags: 97,489
  • sloc: cpp: 610,307; ansic: 111,957; python: 103,357; makefile: 3,676; sh: 3,391; lex: 192; yacc: 128; xml: 95; pascal: 74
file content (125 lines) | stat: -rwxr-xr-x 2,964 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/sh

function getpyver {
    if [ "$1" = "15" ]; then
	PYVER=1.5
    elif [ "$1" = "20" ]; then
	PYVER=2.0
    elif [ "$1" = "21" ]; then
	PYVER=2.1
    elif [ "$1" = "22" ]; then
	PYVER=2.2
    elif [ "$1" = "23" ]; then
	PYVER=2.3
    elif [ "$1" = "24" ]; then
	PYVER=2.4
    else
	echo You must specify Python version as first parameter.
        exit
    fi
}

getpyver $1
shift

python$PYVER -c "import sys;print '\n', sys.version, '\n'"


SETUP="python$PYVER -u setup.py"
FLAGS="USE_SWIG=1 IN_CVS_TREE=1" # BUILD_GLCANVAS=0"
OTHERFLAGS=""



# "c" --> clean
if [ "$1" =  "c" ]; then
    shift
    CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
    OTHERCMD="rm -f wxPython/*.so"

# "d" --> clean extension modules only
elif [ "$1" = "d" ]; then
    shift
    CMD="rm -f wxPython/*.so"

# "t" --> touch *.i files
elif [ "$1" = "t" ]; then
    shift
    #CMD="set CMD=touch src\*.i; touch contrib\glcanvas\*.i; touch contrib\ogl\*.i; touch contrib\stc\*.i"
    CMD='find . -name "*.i" | xargs touch'

# "i" --> install
elif [ "$1" = "i" ]; then
    shift
    CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"

# "s" --> source dist
elif [ "$1" = "s" ]; then
    shift
    CMD="$SETUP $OTHERFLAGS sdist $*"

# "r" --> rpm dist
elif [ "$1" = "r" ]; then
    WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
    for VER in 21 22; do
	getpyver $VER

	echo "*****************************************************************"
	echo "*******      Building wxPython for Python $PYVER"
	echo "*****************************************************************"

	SETUP="python$PYVER -u setup.py"

	# save the original
	cp setup.py setup.py.save

	# fix up setup.py the way we want...
	sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
	sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py

	# build wxPython-gl RPM
	$SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
			### --requires=python$PYVER
	rm dist/wxPython-gl*.tar.gz

	# Build wxPython RPM
	cp setup.py setup.py.temp
	sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
	$SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
			### --requires=python$PYVER

	# put the oringal setup.py back
	cp setup.py.save setup.py
	rm setup.py.*

	# rename the binary RPM's
	mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
	mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm

    done

    # rebuild the source dists without the munched up setup.py
    $SETUP $OTHERFLAGS bdist_rpm --source-only
    exit 0


# "f" --> FINAL (no debug)
elif [ "$1" = "f" ]; then
    shift
    CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"

# (no command arg) --> normal build for development
else
    CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
fi


echo $CMD
eval $CMD


if [ "$OTHERCMD" != "" ]; then
    echo $OTHERCMD
    $OTHERCMD
fi