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 String to append to $pythonbin (which python"
38 echo " version to use.)"
41 echo " skipcopy Don't copy the files for the tarball from the workspace"
42 echo " skiptar Don't build the tarball"
43 echo " skiprpm Don't build the RPM"
44 echo " skipclean Don't do the cleanup at the end"
45 echo " gtk2 Build using wxGTK2 and Unicode"
46 echo " x11 Build using wxX11"
47 echo " speconly Do nothing but write the RPM spec file"
48 echo " srpm Only make the SRPM"
49 # echo " smp Add SMP=2 to the envivonment to speed wxGTK build"
60 ver2
=`echo ${version} | cut -c 1,2,3`
61 tarver
=${tarname}-${version}
63 python
=${pythonbin}${pyver}
64 if [ ! -e ${python} ]; then
65 echo "${python} not found!"
71 echo "*** Writing ${distdir}/wxPython${port}.spec"
73 | sed s
:@PYTHON@
:${python}:g \
74 | sed s
:@PYVER@
:${pyver}:g \
75 | sed s
:@PORT@
:${port}:g \
76 | sed s
:@LCPORT@
:${lcport}:g \
77 | sed s
:@TARNAME@
:${tarname}:g \
78 | sed s
:@VERSION@
:${version}:g \
79 | sed s
:@VER2@
:${ver2}:g \
80 | sed s
:@UNICODE@
:${unicode}:g \
81 > ${distdir}/wxPython
${port}.spec
88 skipcopy
) skipcopy
=1 ;;
89 skipclean
) skipclean
=1 ;;
90 skiptar
) skiptar
=1; skipcopy
=1 ;;
92 gtk2
) unicode
=1; port
=GTK2
; lcport
=gtk2
;;
93 x11
) port
=X11
; lcport
=x11
;;
95 speconly
) makespec
; exit 0 ;;
98 *) echo "Unknown flag \"${flag}\""
105 #----------------------------------------------------------------------
108 echo "*** Setting up"
110 if [ ! -d ${builddir} ]; then
114 if [ ! -d ${distdir} ]; then
118 for dir
in SOURCES SPECS BUILD RPMS SRPMS
; do
119 if [ ! -d ${rpmtop}/${dir} ]; then
120 mkdir -p ${rpmtop}/${dir}
125 #----------------------------------------------------------------------
126 # Copy the sources from my CVS workspace
129 RMFILES
=`find . -name "$1"`
130 if [ "$RMFILES" != "" ]; then
136 if [ -z "${skipcopy}" ]; then
137 echo "*** Copying CVS tree"
138 pushd ${builddir} > /dev
/null
139 if [ -e ${tarver} ]; then
144 # copy root dir contents
145 cp -pf --link ${wxdir}/* ${tarver} > /dev
/null
2>&1
147 # copy all top dirs except CVS, build, demos, utils, samples, and wxPython
148 for d
in art build contrib debian distrib docs include lib locale misc patches src
; do
149 if [ -e ${wxdir}/$d ]; then
150 cp -Rpf --link ${wxdir}/$d ${tarver} #> /dev/null 2>&1
154 # mkdir ${tarver}/utils
155 # cp -Rpf --link ${wxdir}/utils/tex2rtf ${tarver}/utils
156 # # tex2rtf needs these files
157 # mkdir ${tarver}/samples
158 # cp -Rpf --link ${wxdir}/samples/sample.* ${tarver}/samples
160 # now do the same thing for wxPython, skipping it's build dirs and such
161 for dir
in `grep -v '#' ${wxdir}/wxPython/distrib/DIRLIST`; do
162 mkdir ${tarver}/${dir}
163 ##echo "cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir}"
164 cp -pf --link ${wxdir}/${dir}/* ${tarver}/${dir} > /dev
/null
2>&1
167 # using DIRLIST as above will normally skip any files starting
168 # with a dot, but there are a few .files that we do want to
170 for dir
in wxPython
/distrib
/msw
; do
171 cp -pf --link ${wxdir}/${dir}/.
[a
-zA-Z]* ${tarver}/${dir} > /dev
/null
2>&1
174 echo "*** Removing uneeded stuff from copy of CVS tree"
175 pushd ${tarver} > /dev
/null
184 rm -rf contrib
/samples
192 cleanup
"core.[0-9]*"
194 rm -f wxPython
/wx
/* > /dev
/null
2>&1
201 #----------------------------------------------------------------------
202 # Make the spec file and copy to ${builddir}/${tarver} so it will be
203 # in the tar file when it's built
205 # TODO? Output all combinations of spec files to put in the tar file??
208 cp ${distdir}/wxPython
${port}.spec
${builddir}/${tarver}/wxPython
${port}.spec
211 #----------------------------------------------------------------------
214 if [ -z "${skiptar}" ]; then
215 echo "*** Creating language catalogs..."
216 pushd ${builddir}/${tarver}/locale
> /dev
/null
220 echo "*** Creating tarball..."
221 cp distrib
/README
.1st.txt
${builddir}/${tarver}
222 pushd ${builddir} > /dev
/null
223 tar cvf
${distdir}/${tarver}.
tar ${tarver} > /dev
/null
225 echo "*** Compressing..."
226 if [ -e ${distdir}/${tarver}.
tar.gz
]; then
227 rm ${distdir}/${tarver}.
tar.gz
229 gzip --best ${distdir}/${tarver}.
tar
234 #----------------------------------------------------------------------
237 if [ -z "${skiprpm}" ]; then
238 echo "*** Building RPMs..."
239 cp ${distdir}/${tarver}.
tar.gz
${rpmtop}/SOURCES
240 rpmbuild
${rpmflag} \
241 --define "_topdir ${rpmtop}" \
242 --define "_tmppath ${builddir}" \
243 ${distdir}/wxPython
${port}.spec
244 if [ "$?" != "0" ]; then
245 echo "*** RPM failure, exiting."
248 echo "*** Moving RPMs to ${distdir}"
249 mv -f `find ${rpmtop} -name "wxPython*.rpm"` ${distdir}
253 #----------------------------------------------------------------------
256 if [ -z ${skipclean} ]; then
257 echo "*** Cleaning up"