2 #----------------------------------------------------------------------
3 # Build an RPM containing both wxGTK and wxPython
5 spectemplate
=distrib
/wxPythonFull.spec.
in
7 if [ ! -d wxPython
-o ! -e ${spectemplate} ]; then
8 echo "Please run this script from the root wxPython directory."
13 #----------------------------------------------------------------------
18 distdir
=${wxpdir}/dist
19 builddir
=${wxpdir}/_build_rpm
20 rpmtop
=${builddir}/rpmtop
21 cvsroot
=:pserver
:anoncvs@cvs.wxwindows.org
:/pack
/cvsroots
/wxwindows
22 pythonbin
=/usr
/bin
/python
29 #----------------------------------------------------------------------
33 echo "Usage: $0 wx_version py_version [command flags...]"
34 echo " wx_version String to use for version in filenames, etc."
35 echo " py_version String to append to $pythonbin (which python"
36 echo " version to use.)"
39 echo " skipcopy Don't copy the files for the tarball from the workspace"
40 echo " skiptar Don't build the tarball"
41 echo " skiprpm Don't build the RPM (but why?)"
42 echo " skipclean Don't do the cleanup at the end"
43 echo " gtk2 Build using wxGTK2 and Unicode"
44 echo " x11 Build using wxX11"
45 echo " speconly Do nothing but write the RPM spec file"
46 echo " srpm Only make the SRPM"
47 # echo " smp Add SMP=2 to the envivonment to speed wxGTK build"
59 ver2
=`echo ${version} | cut -c 1,2,3`
60 tarver
=${tarname}-${version}
62 python
=${pythonbin}${pyver}
63 if [ ! -e ${python} ]; then
64 echo "${python} not found!"
70 echo "*** Writing ${distdir}/wxPython${port}.spec"
72 | sed s
:@PYTHON@
:${python}:g \
73 | sed s
:@PYVER@
:${pyver}:g \
74 | sed s
:@PORT@
:${port}:g \
75 | sed s
:@LCPORT@
:${lcport}:g \
76 | sed s
:@TARNAME@
:${tarname}:g \
77 | sed s
:@VERSION@
:${version}:g \
78 | sed s
:@VER2@
:${ver2}:g \
79 | sed s
:@UNICODE@
:${unicode}:g \
80 > ${distdir}/wxPython
${port}.spec
87 skipcopy
) skipcopy
=1 ;;
88 skipclean
) skipclean
=1 ;;
91 gtk2
) unicode
=1; port
=GTK2
; lcport
=gtk2
;;
92 x11
) port
=X11
; lcport
=x11
;;
94 speconly
) makespec
; exit 0 ;;
97 *) echo "Unknown flag \"${flag}\""
104 #----------------------------------------------------------------------
107 echo "*** Setting up"
109 if [ ! -d ${builddir} ]; then
113 if [ ! -d ${distdir} ]; then
117 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
118 if [ ! -d ${rpmtop}/${dir} ]; then
119 mkdir -p ${rpmtop}/${dir}
124 #----------------------------------------------------------------------
125 # Copy the sources from my CVS workspace
127 if [ -z "${skipcopy}" ]; then
128 echo "*** Copying CVS tree"
129 pushd ${builddir} > /dev
/null
130 if [ -e ${tarver} ]; then
135 # copy root dir contents
136 cp -pf --link ${wxdir}/* ${tarver} > /dev
/null
2>&1
138 # copy all top dirs except CVS, build, demos, utils, samples, and wxPython
139 for d
in art contrib debian distrib docs include lib locale misc patches src
; do
140 if [ -e ${wxdir}/$d ]; then
141 cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1
145 # now do the same thing for wxPython, skipping it's build dirs and such
146 mkdir ${tarver}/wxPython
147 cp -pf --link ${wxdir}/wxPython
/* ${tarver}/wxPython
> /dev
/null
2>&1
148 for d
in contrib demo distrib distutils docs licence samples scripts src wx wxPython
; do
149 cp -Rpf --link ${wxdir}/wxPython
/$d ${tarver}/wxPython
#> /dev/null 2>&1
153 echo "*** Removing uneeded stuff from copy of CVS tree"
154 pushd ${tarver} > /dev
/null
155 rm `find . -name .cvsignore`
156 rm -rf `find . -name CVS`
161 rm -rf contrib
/samples
163 rm `find . -name ".#*"`
164 rm `find . -name "*~"`
165 rm `find . -name "*.pyc"`
166 rm `find . -name "core"`
167 rm `find . -name "core.[0-9]*"`
169 rm -f wxPython
/wxPython
/* > /dev
/null
2>&1
170 rm wxPython
/demo
/.setup.sh
171 rm -rf wxPython
/contrib
/art2d
172 rm -rf wxPython
/contrib
/canvas
173 rm -rf wxPython
/contrib
/canvas2
174 rm -rf wxPython
/contrib
/gizmos
/contrib
175 rm -rf wxPython
/contrib
/ogl
/contrib
176 rm -rf wxPython
/contrib
/stc
/contrib
177 rm -rf wxPython
/contrib
/xrc
/contrib
184 #----------------------------------------------------------------------
185 # Make the spec file and copy to ${builddir}/${tarver} so it will be
186 # in the tar file when it's built
188 # TODO? Output all combinations of spec files to put in the tar file??
191 cp ${distdir}/wxPython
${port}.spec
${builddir}/${tarver}/wxPython
${port}.spec
194 #----------------------------------------------------------------------
197 if [ -z "${skiptar}" ]; then
198 echo "*** Creating language catalogs..."
199 pushd ${builddir}/${tarver}/locale
> /dev
/null
203 echo "*** Creating tarball..."
204 cp distrib
/README
.1st.txt
${builddir}/${tarver}
205 pushd ${builddir} > /dev
/null
206 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
208 echo "*** Compressing..."
209 if [ -e ${distdir}/${tarver}.
tar.gz
]; then
210 rm ${distdir}/${tarver}.
tar.gz
212 gzip --best ${distdir}/${tarver}.
tar
217 #----------------------------------------------------------------------
220 if [ -z "${skiprpm}" ]; then
221 echo "*** Building RPMs..."
222 cp ${distdir}/${tarver}.
tar.gz
${rpmtop}/SOURCES
223 rpmbuild
${rpmflag} \
224 --define "_topdir ${rpmtop}" \
225 --define "_tmppath ${builddir}" \
226 ${distdir}/wxPython
${port}.spec
227 if [ "$?" != "0" ]; then
228 echo "*** RPM failure, exiting."
231 echo "*** Moving RPMs to ${distdir}"
232 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
236 #----------------------------------------------------------------------
239 if [ -z ${skipclean} ]; then
240 echo "*** Cleaning up"