+ # copy all top dirs except CVS, build, demos, samples, utils, and wxPython
+ for d in art build 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
+
+# # and tex2rtf too
+# mkdir ${tarver}/utils
+# cp -Rpf --link ${wxdir}/utils/tex2rtf ${tarver}/utils
+# # tex2rtf needs these files
+# mkdir ${tarver}/samples
+# cp -Rpf --link ${wxdir}/samples/sample.* ${tarver}/samples
+
+ # now do the same thing for wxPython, skipping it's build dirs and such
+ for dir in `grep -v '#' ${wxdir}/wxPython/distrib/DIRLIST`; do
+ mkdir ${tarver}/${dir}
+ ##echo "cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir}"
+ cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir} > /dev/null 2>&1
+ done
+
+ # using DIRLIST as above will normally skip any files starting
+ # with a dot, but there are a few .files that we do want to
+ # copy...
+ for dir in wxPython/distrib/msw; do
+ cp -pf --link ${wxdir}/${dir}/.[a-zA-Z]* ${tarver}/${dir} > /dev/null 2>&1
+ done
+
+ echo "*** Removing uneeded stuff from copy of CVS tree"
+ pushd ${tarver} > /dev/null
+ cleanup .cvsignore
+ cleanup CVS
+ cleanup CVSROOT
+ rm BuildCVS.txt
+ rm -f ChangeLog
+ rm *.spec
+ rm -rf distrib/msw/tmake
+ rm -rf docs/html
+ rm -rf docs/latex
+ rm -rf contrib/docs
+ rm -rf contrib/samples
+ rm locale/*.mo
+ cleanup ".#*"
+ cleanup "#*#"
+ cleanup "*~"
+ cleanup "*.orig"
+ cleanup "*.rej"
+ cleanup "*.pyc"
+ cleanup core
+ cleanup "core.[0-9]*"
+
+ # ports that are not supported yet
+ cleanup cocoa
+ cleanup mgl
+ cleanup motif
+ cleanup os2
+ cleanup x11
+
+ rm -f wxPython/wx/* > /dev/null 2>&1
+
+ 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.spec ${builddir}/${tarver}/wxPython.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
+
+ if [ "${srpmonly}" = "1" ]; then
+ rpmbuild -bs \
+ --define "_topdir ${rpmtop}" \
+ --define "_tmppath ${builddir}" \
+ --define "release 1" \
+ ${distdir}/wxPython.spec
+ if [ "$?" != "0" ]; then
+ echo "*** RPM failure, exiting."
+ exit 1
+ fi
+
+ else
+ rpmbuild -ba \
+ --define "_topdir ${rpmtop}" \
+ --define "_tmppath ${builddir}" \
+ --define "port gtk" --define "unicode 0" \
+ --define "pyver ${pyver}" \
+ ${distdir}/wxPython.spec
+ if [ "$?" != "0" ]; then
+ echo "*** RPM failure, exiting."
+ exit 1
+ fi
+
+ rpmbuild -ba \
+ --define "_topdir ${rpmtop}" \
+ --define "_tmppath ${builddir}" \
+ --define "port gtk2" --define "unicode 1" \
+ --define "pyver ${pyver}" \
+ ${distdir}/wxPython.spec
+ if [ "$?" != "0" ]; then
+ echo "*** RPM failure, exiting."
+ exit 1
+ fi
+ fi
+
+ echo "*** Moving RPMs to ${distdir}"
+ mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
+fi
+
+#----------------------------------------------------------------------
+# Cleanup
+
+if [ -z ${skipclean} ]; then
+ echo "*** Cleaning up"
+ rm -rf ${rpmtop}
+ rm -rf ${builddir}
+fi