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"
58 python
=${pythonbin}${pyver}
59 if [ ! -e ${python} ]; then
60 echo "${python} not found!"
66 echo "*** Writing ${distdir}/wxPython${port}.spec"
68 | sed s
:@PYTHON@
:${python}:g \
69 | sed s
:@PYVER@
:${pyver}:g \
70 | sed s
:@DEBUG@
:${debug}:g \
71 | sed s
:@PORT@
:${port}:g \
72 | sed s
:@LCPORT@
:${lcport}:g \
73 | sed s
:@TARNAME@
:${tarname}:g \
74 > ${distdir}/wxPython
${port}.spec
82 skipclean
) skipclean
=1 ;;
87 speconly
) makespec
; exit 0 ;;
89 *) echo "Unknown flag \"${flag}\""
96 tarver
=${tarname}-${version}
98 #----------------------------------------------------------------------
101 echo "*** Setting up"
103 if [ ! -d ${builddir} ]; then
107 if [ ! -d ${distdir} ]; then
111 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
112 if [ ! -d ${rpmtop}/${dir} ]; then
113 mkdir -p ${rpmtop}/${dir}
118 #----------------------------------------------------------------------
119 # Get the sources from CVS
121 if [ -z "${skipcvs}" ]; then
122 echo "*** Exporting CVS archive..."
123 pushd ${builddir} > /dev
/null
124 if [ -e ${tarver} ]; then
127 cvs
-d ${cvsroot} export -r ${cvs_tag} -d ${tarver} wxWindows
> /dev
/null
2>&1
128 if [ "$?" != "0" ]; then
129 echo "*** CVS failure, exiting."
133 echo "*** Removing unneeded stuff from CVS tree"
134 pushd ${tarver} > /dev
/null
135 rm `find . -name .cvsignore`
141 # rm -rf include/wx/mgl
142 # rm -rf include/wx/motif
143 # rm -rf include/wx/os2
147 rm -rf wxPython
/wxSWIG
154 #----------------------------------------------------------------------
155 # Make the spec file and copy to ${builddir}/${tarver}
157 #if [ -z "${skiptar}" ]; then
159 cp ${distdir}/wxPython
${port}.spec
${builddir}/${tarver}/wxPython
${port}.spec
163 #----------------------------------------------------------------------
166 if [ -z "${skiptar}" ]; then
167 echo "*** Creating tarball..."
168 pushd ${builddir} > /dev
/null
169 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
170 echo "*** Compressing..."
171 if [ -e ${distdir}/${tarver}.
tar.gz
]; then
172 rm ${distdir}/${tarver}.
tar.gz
174 gzip --best ${distdir}/${tarver}.
tar
179 #----------------------------------------------------------------------
182 if [ -z "${skiprpm}" ]; then
183 echo "*** Building RPMs..."
184 cp ${distdir}/${tarver}.
tar.gz
${rpmtop}/SOURCES
186 --define "_topdir ${rpmtop}" \
187 --define "_tmppath ${builddir}" \
188 ${distdir}/wxPython
${port}.spec
189 if [ "$?" != "0" ]; then
190 echo "*** RPM failure, exiting."
193 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
197 #----------------------------------------------------------------------
200 if [ -z ${skipclean} ]; then
201 echo "*** Cleaning up"