diff --git a/contrib/buildrpm b/contrib/buildrpm --- a/contrib/buildrpm +++ b/contrib/buildrpm @@ -8,9 +8,6 @@ # - centOS 6 cd "`dirname $0`/.." -HG="$PWD/hg" -PYTHONPATH="$PWD/mercurial/pure" -export PYTHONPATH specfile=contrib/mercurial.spec if [ ! -f $specfile ]; then @@ -31,13 +28,17 @@ if $HG id -i | grep '+$' > /dev/null 2>& fi fi +# build local hg and use it +python setup.py build_py -c -d . +HG="$PWD/hg" +PYTHONPATH="$PWD/mercurial/pure" +export PYTHONPATH + rpmdir="$PWD/rpmbuild" rm -rf $rpmdir mkdir -p $rpmdir/SOURCES $rpmdir/SPECS $rpmdir/RPMS $rpmdir/SRPMS $rpmdir/BUILD -# make setup.py build the version string -python setup.py build_py -c -d . hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'` if echo $hgversion | grep -- '-' > /dev/null 2>&1; then diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec --- a/contrib/mercurial.spec +++ b/contrib/mercurial.spec @@ -1,3 +1,6 @@ +%global emacs_lispdir %{_datadir}/emacs/site-lisp +%global pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))') + Summary: A fast, lightweight Source Control Management system Name: mercurial Version: snapshot @@ -14,9 +17,6 @@ Requires: python >= 2.4 # The hgk extension uses the wish tcl interpreter, but we don't enforce it #Requires: tk -%define pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))') -%define emacs_lispdir %{_datadir}/emacs/site-lisp - %description Mercurial is a fast, lightweight source control management system designed for efficient handling of very large distributed projects.