[PATCH 02 of 22] buildrpm: collect code for building local hg and using it in one place

Mads Kiilerich mads at kiilerich.com
Mon May 19 21:09:57 CDT 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1400111317 -7200
#      Thu May 15 01:48:37 2014 +0200
# Node ID b00a1b8aec5c5891bbc23b5968887494cdf637c6
# Parent  0059b9f6f9623500ad64f860b45efe821a4da1b6
buildrpm: collect code for building local hg and using it in one place

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.


More information about the Mercurial-devel mailing list