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 tarver
=${tarname}-${version}
60 python
=${pythonbin}${pyver}
61 if [ ! -e ${python} ]; then
62 echo "${python} not found!"
68 echo "*** Writing ${distdir}/wxPython${port}.spec"
70 | sed s
:@PYTHON@
:${python}:g \
71 | sed s
:@PYVER@
:${pyver}:g \
72 | sed s
:@DEBUG@
:${debug}:g \
73 | sed s
:@PORT@
:${port}:g \
74 | sed s
:@LCPORT@
:${lcport}:g \
75 | sed s
:@TARNAME@
:${tarname}:g \
76 | sed s
:@VERSION@
:${version}:g \
77 > ${distdir}/wxPython
${port}.spec
85 skipclean
) skipclean
=1 ;;
90 speconly
) makespec
; exit 0 ;;
92 *) echo "Unknown flag \"${flag}\""
99 #----------------------------------------------------------------------
102 echo "*** Setting up"
104 if [ ! -d ${builddir} ]; then
108 if [ ! -d ${distdir} ]; then
112 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
113 if [ ! -d ${rpmtop}/${dir} ]; then
114 mkdir -p ${rpmtop}/${dir}
119 #----------------------------------------------------------------------
120 # Get the sources from CVS
122 if [ -z "${skipcvs}" ]; then
123 echo "*** Exporting CVS archive..."
124 pushd ${builddir} > /dev
/null
125 if [ -e ${tarver} ]; then
128 cvs
-d ${cvsroot} export -r ${cvs_tag} -d ${tarver} wxWindows
> /dev
/null
2>&1
129 if [ "$?" != "0" ]; then
130 echo "*** CVS failure, exiting."
134 echo "*** Removing unneeded stuff from CVS tree"
135 pushd ${tarver} > /dev
/null
136 rm `find . -name .cvsignore`
142 # rm -rf include/wx/mgl
143 # rm -rf include/wx/motif
144 # rm -rf include/wx/os2
148 rm -rf wxPython
/wxSWIG
155 #----------------------------------------------------------------------
156 # Make the spec file and copy to ${builddir}/${tarver} so it will be
157 # in the tar file when it's built
159 # TODO? Output all combinations of spec files to put in the tar file??
162 cp ${distdir}/wxPython
${port}.spec
${builddir}/${tarver}/wxPython
${port}.spec
165 #----------------------------------------------------------------------
168 if [ -z "${skiptar}" ]; then
169 echo "*** Creating tarball..."
170 pushd ${builddir} > /dev
/null
171 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
172 echo "*** Compressing..."
173 if [ -e ${distdir}/${tarver}.
tar.gz
]; then
174 rm ${distdir}/${tarver}.
tar.gz
176 gzip --best ${distdir}/${tarver}.
tar
181 #----------------------------------------------------------------------
184 if [ -z "${skiprpm}" ]; then
185 echo "*** Building RPMs..."
186 cp ${distdir}/${tarver}.
tar.gz
${rpmtop}/SOURCES
188 --define "_topdir ${rpmtop}" \
189 --define "_tmppath ${builddir}" \
190 ${distdir}/wxPython
${port}.spec
191 if [ "$?" != "0" ]; then
192 echo "*** RPM failure, exiting."
195 echo "*** Moving RPMs to ${distdir}"
196 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
200 #----------------------------------------------------------------------
203 if [ -z ${skipclean} ]; then
204 echo "*** Cleaning up"