2 #---------------------------------------------------------------------- 
   3 # Build an RPM containing both wxGTK and wxPython 
   7 spectemplate
=distrib
/wxPythonFull.spec.
in 
   9 if [ ! -d wxPython 
-o ! -e ${spectemplate} ]; then 
  10     echo "Please run this script from the root wxPython directory." 
  15 #---------------------------------------------------------------------- 
  18 version
=`python -c "import setup;print setup.VERSION"` 
  21 distdir
=${wxpdir}/dist
 
  22 builddir
=${wxpdir}/_build_rpm
 
  23 rpmtop
=${builddir}/rpmtop
 
  24 cvsroot
=:pserver
:anoncvs@cvs.wxwindows.org
:/pack
/cvsroots
/wxwindows
 
  25 pythonbin
=/usr
/bin
/python
 
  33 #---------------------------------------------------------------------- 
  37     echo "Usage: $0 py_version [command flags...]" 
  38     echo "   py_version     which python version to use." 
  41     echo "   skipcopy       Don't copy the files for the tarball from the workspace" 
  42     echo "   skiptar        Don't build the tarball" 
  43     echo "   skiprpm        Don't build the RPM" 
  44     echo "   skipclean      Don't do the cleanup at the end" 
  45     echo "   speconly       Do nothing but write the RPM spec file" 
  46     echo "   srpm           Only make the SRPM" 
  57 ver2
=`echo ${version} | cut -c 1,2,3` 
  58 tarver
=${tarname}-${version} 
  60 python
=${pythonbin}${pyver} 
  61 if [ ! -e ${python} ]; then 
  62     echo "${python} not found!" 
  68     echo "*** Writing ${distdir}/wxPython.spec" 
  70         | sed s
:@PYTHON@
:${python}:g \
 
  71         | sed s
:@PYVER@
:${pyver}:g \
 
  72         | sed s
:@TARNAME@
:${tarname}:g \
 
  73         | sed s
:@VERSION@
:${version}:g \
 
  74         | sed s
:@VER2@
:${ver2}:g \
 
  75         > ${distdir}/wxPython.spec
 
  82         skipcopy
)  skipcopy
=1                          ;; 
  83         skipclean
) skipclean
=1                         ;; 
  84         skiptar
)   skiptar
=1; skipcopy
=1               ;; 
  86         speconly
)  makespec
; exit 0                    ;; 
  89         *)  echo "Unknown flag \"${flag}\"" 
  96 #---------------------------------------------------------------------- 
 101 if [ ! -d ${builddir} ]; then 
 105 if [ ! -d ${distdir} ]; then 
 109 for dir 
in SOURCES SPECS BUILD RPMS SRPMS
; do 
 110     if [ ! -d ${rpmtop}/${dir} ]; then 
 111         mkdir -p ${rpmtop}/${dir} 
 116 #---------------------------------------------------------------------- 
 117 # Copy the sources from my CVS workspace 
 120     RMFILES
=`find . -name "$1"` 
 121     if [ "$RMFILES" != "" ]; then 
 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, demos, samples, and wxPython 
 139     for d 
in art build contrib debian docs include lib locale patches samples src utils
; do 
 140         if [ -e ${wxdir}/$d ]; then 
 141             cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1 
 144     mkdir ${tarver}/distrib
 
 145     cp -Rpf --link ${wxdir}/distrib
/scripts 
${tarver}/distrib
 
 148     # now do the same thing for wxPython, but use the DIRLIST to select dirs to copy 
 149     for dir 
in `grep -v '#' ${wxdir}/wxPython/distrib/DIRLIST`; do 
 150         mkdir ${tarver}/${dir} 
 151         ##echo "cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir}" 
 152         cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir} > /dev
/null 
2>&1 
 155     # using DIRLIST as above will normally skip any files starting 
 156     # with a dot, but there are a few .files that we do want to 
 158     for dir 
in wxPython
/distrib
/msw
; do 
 159         cp -pf --link ${wxdir}/${dir}/.
[a
-zA-Z]* ${tarver}/${dir}  > /dev
/null 
2>&1 
 162     echo "*** Removing uneeded stuff from copy of CVS tree" 
 163     pushd ${tarver} > /dev
/null
 
 170     rm -rf distrib
/msw
/tmake
 
 174     #rm -rf contrib/samples 
 183     cleanup 
"core.[0-9]*" 
 184     rm -f wxPython
/samples
/embedded
/embedded
 
 185     rm -f wxPython
/samples
/embedded
/embedded.o
 
 187     # ports that are not supported yet 
 188     #cleanup cocoa    # wxMac needs some cocoa headers 
 196     rm -f wxPython
/wx
/*  > /dev
/null 
2>&1 
 203 #---------------------------------------------------------------------- 
 204 # Make the spec file and copy to ${builddir}/${tarver} so it will be 
 205 # in the tar file when it's built 
 207 # TODO?  Output all combinations of spec files to put in the tar file?? 
 210 cp ${distdir}/wxPython.spec 
${builddir}/${tarver}/wxPython.spec
 
 213 #---------------------------------------------------------------------- 
 216 if [ -z "${skiptar}" ]; then 
 217     echo "*** Creating language catalogs..." 
 218     pushd ${builddir}/${tarver}/locale 
> /dev
/null
 
 222     echo "*** Creating tarball..." 
 223     cp distrib
/README
.1st.txt 
${builddir}/${tarver} 
 224     pushd ${builddir} > /dev
/null
 
 225     tar cvf 
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
 
 227     echo "*** Compressing..." 
 228     if [ -e ${distdir}/${tarver}.
tar.bz2 
]; then 
 229         rm ${distdir}/${tarver}.
tar.bz2
 
 231     bzip2 --best ${distdir}/${tarver}.
tar 
 236 #---------------------------------------------------------------------- 
 239 if [ -z "${skiprpm}" ]; then 
 240     echo "*** Building RPMs..." 
 241     cp ${distdir}/${tarver}.
tar.bz2 
${rpmtop}/SOURCES
 
 243     if [ "${srpmonly}" = "1" ]; then 
 245             --define "_topdir ${rpmtop}" \
 
 246             --define "_tmppath ${builddir}" \
 
 247             --define "release 1" \
 
 248             ${distdir}/wxPython.spec
 
 249         if [ "$?" != "0" ]; then 
 250             echo "*** RPM failure, exiting." 
 256             --define "_topdir ${rpmtop}" \
 
 257             --define "_tmppath ${builddir}" \
 
 258             --define "port gtk" --define "unicode 0" \
 
 259             --define "pyver ${pyver}" \
 
 260             ${distdir}/wxPython.spec
 
 261         if [ "$?" != "0" ]; then 
 262             echo "*** RPM failure, exiting." 
 267             --define "_topdir ${rpmtop}" \
 
 268             --define "_tmppath ${builddir}" \
 
 269             --define "port gtk2" --define "unicode 1" \
 
 270             --define "pyver ${pyver}" \
 
 271             ${distdir}/wxPython.spec
 
 272         if [ "$?" != "0" ]; then 
 273             echo "*** RPM failure, exiting." 
 278     echo "*** Moving RPMs to ${distdir}" 
 279     mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir} 
 282 #---------------------------------------------------------------------- 
 285 if [ "${skipclean}" = "0" ]; then 
 286     echo "*** Cleaning up"