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 #---------------------------------------------------------------------- 
  17 builddir
=`pwd`/_build_rpm
 
  18 rpmtop
=${builddir}/rpmtop
 
  19 cvsroot
=:pserver
:anoncvs@cvs.wxwindows.org
:/home
/wxcvs
 
  20 pythonbin
=/usr
/bin
/python
 
  27 #---------------------------------------------------------------------- 
  31     echo "Usage: $0 cvs_tag wx_version py_version [command flags...]" 
  32     echo "   cvs_tag        Tag to use for CVS export" 
  33     echo "   wx_version     String to use for version in filenames, etc." 
  34     echo "   py_version     String to append to $pythonbin (which python" 
  35     echo "                  version to use.)" 
  38     echo "   skipcvs        Don't do the CVS export" 
  39     echo "   skiptar        Don't build the tarball" 
  40     echo "   skiprpm        Don't build the RPM (but why?)" 
  41     echo "   skipclean      Don't do the cleanup at the end" 
  42     echo "   speconly       Do nothing but write the RPM spec file" 
  43     echo "   debug          Make a __WXDEBUG__ version" 
  44     echo "   smp            Add SMP=2 to the envivonment to speed wxGTK build" 
  57 ver2
=`echo ${version} | cut -c 1,2,3` 
  58 tarver
=${tarname}-${version} 
  61 python
=${pythonbin}${pyver} 
  62 if [ ! -e ${python} ]; then 
  63     echo "${python} not found!" 
  69     echo "*** Writing ${distdir}/wxPython${port}.spec" 
  71         | sed s
:@PYTHON@
:${python}:g \
 
  72         | sed s
:@PYVER@
:${pyver}:g \
 
  73         | sed s
:@DEBUG@
:${debug}: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         > ${distdir}/wxPython
${port}.spec
 
  87         skipclean
) skipclean
=1      ;; 
  92         speconly
)  makespec
; exit 0 ;; 
  94         *)  echo "Unknown flag \"${flag}\"" 
 101 #---------------------------------------------------------------------- 
 104 echo "*** Setting up" 
 106 if [ ! -d ${builddir} ]; then 
 110 if [ ! -d ${distdir} ]; then 
 114 for dir 
in SOURCES SPECS BUILD RPMS SRPMS
; do 
 115     if [ ! -d ${rpmtop}/${dir} ]; then 
 116         mkdir -p ${rpmtop}/${dir} 
 121 #---------------------------------------------------------------------- 
 122 # Get the sources from CVS 
 124 if [ -z "${skipcvs}" ]; then 
 125     echo "*** Exporting CVS archive..." 
 126     pushd ${builddir} > /dev
/null
 
 127     if [ -e ${tarver} ]; then 
 130     cvs 
-d ${cvsroot} export -r ${cvs_tag} -d ${tarver} wxWindows 
> /dev
/null 
2>&1 
 131     if [ "$?" != "0" ]; then 
 132         echo "*** CVS failure, exiting." 
 136     echo "*** Removing unneeded stuff from CVS tree" 
 137     pushd ${tarver} > /dev
/null
 
 138     rm `find . -name .cvsignore` 
 146 #     rm -rf include/wx/mgl 
 147 #     rm -rf include/wx/motif 
 148 #     rm -rf include/wx/os2 
 152     rm -rf wxPython
/wxSWIG
 
 153     rm -rf wxPython
/tests
 
 160 #---------------------------------------------------------------------- 
 161 # Make the spec file and copy to ${builddir}/${tarver} so it will be 
 162 # in the tar file when it's built 
 164 # TODO?  Output all combinations of spec files to put in the tar file?? 
 167 cp ${distdir}/wxPython
${port}.spec 
${builddir}/${tarver}/wxPython
${port}.spec
 
 170 #---------------------------------------------------------------------- 
 173 if [ -z "${skiptar}" ]; then 
 174     echo "*** Creating tarball..." 
 175     pushd ${builddir} > /dev
/null
 
 176     tar cvf 
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
 
 177     echo "*** Compressing..." 
 178     if [ -e ${distdir}/${tarver}.
tar.gz 
]; then 
 179         rm ${distdir}/${tarver}.
tar.gz
 
 181     gzip --best ${distdir}/${tarver}.
tar 
 186 #---------------------------------------------------------------------- 
 189 if [ -z "${skiprpm}" ]; then 
 190     echo "*** Building RPMs..." 
 191     cp ${distdir}/${tarver}.
tar.gz 
${rpmtop}/SOURCES
 
 193         --define "_topdir ${rpmtop}" \
 
 194         --define "_tmppath ${builddir}" \
 
 195         ${distdir}/wxPython
${port}.spec
 
 196     if [ "$?" != "0" ]; then 
 197         echo "*** RPM failure, exiting." 
 200         echo "*** Moving RPMs to ${distdir}" 
 201         mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir} 
 205 #---------------------------------------------------------------------- 
 208 if [ -z ${skipclean} ]; then 
 209     echo "*** Cleaning up"