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
159 #----------------------------------------------------------------------
160 # Make the spec file and copy to ${builddir}/${tarver} so it will be
161 # in the tar file when it's built
163 # TODO? Output all combinations of spec files to put in the tar file??
166 cp ${distdir}/wxPython
${port}.spec
${builddir}/${tarver}/wxPython
${port}.spec
169 #----------------------------------------------------------------------
172 if [ -z "${skiptar}" ]; then
173 echo "*** Creating tarball..."
174 pushd ${builddir} > /dev
/null
175 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
176 echo "*** Compressing..."
177 if [ -e ${distdir}/${tarver}.
tar.gz
]; then
178 rm ${distdir}/${tarver}.
tar.gz
180 gzip --best ${distdir}/${tarver}.
tar
185 #----------------------------------------------------------------------
188 if [ -z "${skiprpm}" ]; then
189 echo "*** Building RPMs..."
190 cp ${distdir}/${tarver}.
tar.gz
${rpmtop}/SOURCES
192 --define "_topdir ${rpmtop}" \
193 --define "_tmppath ${builddir}" \
194 ${distdir}/wxPython
${port}.spec
195 if [ "$?" != "0" ]; then
196 echo "*** RPM failure, exiting."
199 echo "*** Moving RPMs to ${distdir}"
200 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
204 #----------------------------------------------------------------------
207 if [ -z ${skipclean} ]; then
208 echo "*** Cleaning up"