+ # copy root dir contents
+ cp -pf --link ${wxdir}/* ${tarver} > /dev/null 2>&1
+
+ # copy all top dirs except CVS, build, demos, utils, samples, and wxPython
+ for d in art contrib debian distrib docs include lib locale misc patches src; do
+ if [ -e ${wxdir}/$d ]; then
+ cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1
+ fi
+ done
+
+ # now do the same thing for wxPython, skipping it's build dirs and such
+ mkdir ${tarver}/wxPython
+ cp -pf --link ${wxdir}/wxPython/* ${tarver}/wxPython > /dev/null 2>&1
+ for d in contrib demo distrib distutils docs licence samples scripts src wx wxPython; do
+ cp -Rpf --link ${wxdir}/wxPython/$d ${tarver}/wxPython #> /dev/null 2>&1
+ done
+
+
+ echo "*** Removing uneeded stuff from copy of CVS tree"
+ pushd ${tarver} > /dev/null
+ rm `find . -name .cvsignore`
+ rm -rf `find . -name CVS`
+ rm *.spec
+ rm -rf docs/html
+ rm -rf docs/latex
+ rm -rf contrib/docs
+ rm -rf contrib/samples
+ rm locale/*.mo
+ rm `find . -name ".#*"`
+ rm `find . -name "*~"`
+ rm `find . -name "*.pyc"`
+ rm `find . -name "core"`
+ rm `find . -name "core.[0-9]*"`
+
+ rm -f wxPython/wxPython/* > /dev/null 2>&1
+ rm wxPython/demo/.setup.sh
+ rm -rf wxPython/contrib/art2d
+ rm -rf wxPython/contrib/canvas
+ rm -rf wxPython/contrib/canvas2
+ rm -rf wxPython/contrib/gizmos/contrib
+ rm -rf wxPython/contrib/ogl/contrib
+ rm -rf wxPython/contrib/stc/contrib
+ rm -rf wxPython/contrib/xrc/contrib
+
+ popd > /dev/null
+ popd > /dev/null
+fi
+
+
+#----------------------------------------------------------------------
+# Make the spec file and copy to ${builddir}/${tarver} so it will be
+# in the tar file when it's built
+
+# TODO? Output all combinations of spec files to put in the tar file??
+
+makespec
+cp ${distdir}/wxPython${port}.spec ${builddir}/${tarver}/wxPython${port}.spec
+
+
+#----------------------------------------------------------------------
+# Build the tar file
+
+if [ -z "${skiptar}" ]; then
+ echo "*** Creating language catalogs..."
+ pushd ${builddir}/${tarver}/locale > /dev/null
+ make allmo
+ popd > /dev/null
+
+ echo "*** Creating tarball..."
+ cp distrib/README.1st.txt ${builddir}/${tarver}
+ pushd ${builddir} > /dev/null
+ tar cvf ${distdir}/${tarver}.tar ${tarver} > /dev/null
+
+ echo "*** Compressing..."
+ if [ -e ${distdir}/${tarver}.tar.gz ]; then
+ rm ${distdir}/${tarver}.tar.gz
+ fi
+ gzip --best ${distdir}/${tarver}.tar
+ popd > /dev/null
+fi
+
+
+#----------------------------------------------------------------------
+# build the RPM
+
+if [ -z "${skiprpm}" ]; then
+ echo "*** Building RPMs..."
+ cp ${distdir}/${tarver}.tar.gz ${rpmtop}/SOURCES
+ rpmbuild ${rpmflag} \
+ --define "_topdir ${rpmtop}" \
+ --define "_tmppath ${builddir}" \
+ ${distdir}/wxPython${port}.spec
+ if [ "$?" != "0" ]; then
+ echo "*** RPM failure, exiting."
+ exit 1
+ else
+ echo "*** Moving RPMs to ${distdir}"
+ mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
+ fi
+fi
+
+#----------------------------------------------------------------------
+# Cleanup
+
+if [ -z ${skipclean} ]; then
+ echo "*** Cleaning up"
+ rm -rf ${rpmtop}
+ rm -rf ${builddir}
+fi