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
32 #----------------------------------------------------------------------
36 echo "Usage: $0 py_version [command flags...]"
37 echo " py_version which python version to use."
40 echo " skipcopy Don't copy the files for the tarball from the workspace"
41 echo " skiptar Don't build the tarball"
42 echo " skiprpm Don't build the RPM"
43 echo " skipclean Don't do the cleanup at the end"
44 echo " speconly Do nothing but write the RPM spec file"
45 echo " srpm Only make the SRPM"
56 ver2
=`echo ${version} | cut -c 1,2,3`
57 tarver
=${tarname}-${version}
59 python
=${pythonbin}${pyver}
60 if [ ! -e ${python} ]; then
61 echo "${python} not found!"
67 echo "*** Writing ${distdir}/wxPython.spec"
69 | sed s
:@PYTHON@
:${python}:g \
70 | sed s
:@PYVER@
:${pyver}:g \
71 | sed s
:@TARNAME@
:${tarname}:g \
72 | sed s
:@VERSION@
:${version}:g \
73 | sed s
:@VER2@
:${ver2}:g \
74 > ${distdir}/wxPython.spec
81 skipcopy
) skipcopy
=1 ;;
82 skipclean
) skipclean
=1 ;;
83 skiptar
) skiptar
=1; skipcopy
=1 ;;
85 speconly
) makespec
; exit 0 ;;
88 *) echo "Unknown flag \"${flag}\""
95 #----------------------------------------------------------------------
100 if [ ! -d ${builddir} ]; then
104 if [ ! -d ${distdir} ]; then
108 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
109 if [ ! -d ${rpmtop}/${dir} ]; then
110 mkdir -p ${rpmtop}/${dir}
115 #----------------------------------------------------------------------
116 # Copy the sources from my CVS workspace
119 RMFILES
=`find . -name "$1"`
120 if [ "$RMFILES" != "" ]; then
126 if [ -z "${skipcopy}" ]; then
127 echo "*** Copying CVS tree"
128 pushd ${builddir} > /dev
/null
129 if [ -e ${tarver} ]; then
134 # copy root dir contents
135 cp -pf --link ${wxdir}/* ${tarver} > /dev
/null
2>&1
137 # copy all top dirs except CVS, demos, samples, and wxPython
138 for d
in art build contrib debian docs include lib locale patches samples src utils
; do
139 if [ -e ${wxdir}/$d ]; then
140 cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1
144 # now do the same thing for wxPython, but use the DIRLIST to select dirs to copy
145 for dir
in `grep -v '#' ${wxdir}/wxPython/distrib/DIRLIST`; do
146 mkdir ${tarver}/${dir}
147 ##echo "cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir}"
148 cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir} > /dev
/null
2>&1
151 # using DIRLIST as above will normally skip any files starting
152 # with a dot, but there are a few .files that we do want to
154 for dir
in wxPython
/distrib
/msw
; do
155 cp -pf --link ${wxdir}/${dir}/.
[a
-zA-Z]* ${tarver}/${dir} > /dev
/null
2>&1
158 echo "*** Removing uneeded stuff from copy of CVS tree"
159 pushd ${tarver} > /dev
/null
166 rm -rf distrib
/msw
/tmake
170 #rm -rf contrib/samples
179 cleanup
"core.[0-9]*"
181 # ports that are not supported yet
190 rm -f wxPython
/wx
/* > /dev
/null
2>&1
197 #----------------------------------------------------------------------
198 # Make the spec file and copy to ${builddir}/${tarver} so it will be
199 # in the tar file when it's built
201 # TODO? Output all combinations of spec files to put in the tar file??
204 cp ${distdir}/wxPython.spec
${builddir}/${tarver}/wxPython.spec
207 #----------------------------------------------------------------------
210 if [ -z "${skiptar}" ]; then
211 echo "*** Creating language catalogs..."
212 pushd ${builddir}/${tarver}/locale
> /dev
/null
216 echo "*** Creating tarball..."
217 cp distrib
/README
.1st.txt
${builddir}/${tarver}
218 pushd ${builddir} > /dev
/null
219 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
221 echo "*** Compressing..."
222 if [ -e ${distdir}/${tarver}.
tar.bz2
]; then
223 rm ${distdir}/${tarver}.
tar.bz2
225 bzip2 --best ${distdir}/${tarver}.
tar
230 #----------------------------------------------------------------------
233 if [ -z "${skiprpm}" ]; then
234 echo "*** Building RPMs..."
235 cp ${distdir}/${tarver}.
tar.bz2
${rpmtop}/SOURCES
237 if [ "${srpmonly}" = "1" ]; then
239 --define "_topdir ${rpmtop}" \
240 --define "_tmppath ${builddir}" \
241 --define "release 1" \
242 ${distdir}/wxPython.spec
243 if [ "$?" != "0" ]; then
244 echo "*** RPM failure, exiting."
250 --define "_topdir ${rpmtop}" \
251 --define "_tmppath ${builddir}" \
252 --define "port gtk" --define "unicode 0" \
253 --define "pyver ${pyver}" \
254 ${distdir}/wxPython.spec
255 if [ "$?" != "0" ]; then
256 echo "*** RPM failure, exiting."
261 --define "_topdir ${rpmtop}" \
262 --define "_tmppath ${builddir}" \
263 --define "port gtk2" --define "unicode 1" \
264 --define "pyver ${pyver}" \
265 ${distdir}/wxPython.spec
266 if [ "$?" != "0" ]; then
267 echo "*** RPM failure, exiting."
272 echo "*** Moving RPMs to ${distdir}"
273 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
276 #----------------------------------------------------------------------
279 if [ -z ${skipclean} ]; then
280 echo "*** Cleaning up"