2 #----------------------------------------------------------------------
3 # Build an RPM containing both wxGTK and wxPython
8 spectemplate
=distrib
/wxPythonFull.spec.
in
10 if [ ! -d wxPython
-o ! -e ${spectemplate} ]; then
11 echo "Please run this script from the root wxPython directory."
16 #----------------------------------------------------------------------
19 version
=`python -c "import setup;print setup.VERSION"`
22 distdir
=${wxpdir}/dist
23 builddir
=${wxpdir}/_build_rpm
24 rpmtop
=${builddir}/rpmtop
25 cvsroot
=:pserver
:anoncvs@cvs.wxwindows.org
:/pack
/cvsroots
/wxwindows
26 pythonbin
=/usr
/bin
/python
34 #----------------------------------------------------------------------
38 echo "Usage: $0 py_version [command flags...]"
39 echo " py_version which python version to use."
42 echo " skipcopy Don't copy the files for the tarball from the workspace"
43 echo " skiptar Don't build the tarball"
44 echo " skiprpm Don't build the RPM"
45 echo " skipclean Don't do the cleanup at the end"
46 echo " speconly Do nothing but write the RPM spec file"
47 echo " srpm Only make the SRPM"
58 ver2
=`echo ${version} | cut -c 1,2,3`
59 tarver
=${tarname}-${version}
61 python
=${pythonbin}${pyver}
62 if [ ! -e ${python} ]; then
63 echo "${python} not found!"
69 echo "*** Writing ${distdir}/wxPython.spec"
71 | sed s
:@PYTHON@
:${python}:g \
72 | sed s
:@PYVER@
:${pyver}:g \
73 | sed s
:@TARNAME@
:${tarname}:g \
74 | sed s
:@VERSION@
:${version}:g \
75 | sed s
:@VER2@
:${ver2}:g \
76 > ${distdir}/wxPython.spec
83 skipcopy
) skipcopy
=1 ;;
84 skipclean
) skipclean
=1 ;;
85 skiptar
) skiptar
=1; skipcopy
=1 ;;
87 speconly
) makespec
; exit 0 ;;
90 *) echo "Unknown flag \"${flag}\""
97 #----------------------------------------------------------------------
100 echo "*** Setting up"
102 if [ ! -d ${builddir} ]; then
106 if [ ! -d ${distdir} ]; then
110 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
111 if [ ! -d ${rpmtop}/${dir} ]; then
112 mkdir -p ${rpmtop}/${dir}
117 #----------------------------------------------------------------------
118 # Copy the sources from my CVS workspace
121 RMFILES
=`find . -name "$1"`
122 if [ "$RMFILES" != "" ]; then
128 if [ -z "${skipcopy}" ]; then
129 echo "*** Copying CVS tree"
130 pushd ${builddir} > /dev
/null
131 if [ -e ${tarver} ]; then
136 # copy root dir contents
137 cp -pf --link ${wxdir}/* ${tarver} > /dev
/null
2>&1
139 # copy all top dirs except CVS, demos, samples, and wxPython
140 for d
in art build contrib debian docs include lib locale patches samples src utils
; do
141 if [ -e ${wxdir}/$d ]; then
142 cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1
145 mkdir ${tarver}/distrib
146 cp -Rpf --link ${wxdir}/distrib
/scripts
${tarver}/distrib
149 # now do the same thing for wxPython, but use the DIRLIST to select dirs to copy
150 for dir
in `grep -v '#' ${wxdir}/wxPython/distrib/DIRLIST`; do
151 mkdir ${tarver}/${dir}
152 ##echo "cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir}"
153 cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir} > /dev
/null
2>&1
156 # using DIRLIST as above will normally skip any files starting
157 # with a dot, but there are a few .files that we do want to
159 for dir
in wxPython
/distrib
/msw
; do
160 cp -pf --link ${wxdir}/${dir}/.
[a
-zA-Z]* ${tarver}/${dir} > /dev
/null
2>&1
163 echo "*** Removing uneeded stuff from copy of CVS tree"
164 pushd ${tarver} > /dev
/null
171 rm -rf distrib
/msw
/tmake
175 #rm -rf contrib/samples
184 cleanup
"core.[0-9]*"
185 rm -f wxPython
/samples
/embedded
/embedded
186 rm -f wxPython
/samples
/embedded
/embedded.o
188 # ports that are not supported yet
189 #cleanup cocoa # wxMac needs some cocoa headers
197 rm -f wxPython
/wx
/* > /dev
/null
2>&1
204 #----------------------------------------------------------------------
205 # Make the spec file and copy to ${builddir}/${tarver} so it will be
206 # in the tar file when it's built
208 # TODO? Output all combinations of spec files to put in the tar file??
211 cp ${distdir}/wxPython.spec
${builddir}/${tarver}/wxPython.spec
214 #----------------------------------------------------------------------
217 if [ -z "${skiptar}" ]; then
218 echo "*** Creating language catalogs..."
219 pushd ${builddir}/${tarver}/locale
> /dev
/null
223 echo "*** Creating tarball..."
224 cp distrib
/README
.1st.txt
${builddir}/${tarver}
225 pushd ${builddir} > /dev
/null
226 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
228 echo "*** Compressing..."
229 if [ -e ${distdir}/${tarver}.
tar.bz2
]; then
230 rm ${distdir}/${tarver}.
tar.bz2
232 bzip2 --best ${distdir}/${tarver}.
tar
237 #----------------------------------------------------------------------
240 if [ "${skiprpm}" != "1" ]; then
241 echo "*** Building RPMs..."
242 cp ${distdir}/${tarver}.
tar.bz2
${rpmtop}/SOURCES
244 if [ "${srpmonly}" = "1" ]; then
246 --define "_topdir ${rpmtop}" \
247 --define "_tmppath ${builddir}" \
248 --define "release 1" \
249 ${distdir}/wxPython.spec
250 if [ "$?" != "0" ]; then
251 echo "*** RPM failure, exiting."
257 --define "_topdir ${rpmtop}" \
258 --define "_tmppath ${builddir}" \
259 --define "port gtk" --define "unicode 0" \
260 --define "pyver ${pyver}" \
261 ${distdir}/wxPython.spec
262 if [ "$?" != "0" ]; then
263 echo "*** RPM failure, exiting."
268 --define "_topdir ${rpmtop}" \
269 --define "_tmppath ${builddir}" \
270 --define "port gtk2" --define "unicode 1" \
271 --define "pyver ${pyver}" \
272 ${distdir}/wxPython.spec
273 if [ "$?" != "0" ]; then
274 echo "*** RPM failure, exiting."
279 echo "*** Moving RPMs to ${distdir}"
280 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
283 #----------------------------------------------------------------------
286 if [ "${skipclean}" = "0" ]; then
287 echo "*** Cleaning up"