buildrpm: collect code for building local hg and using it in one place
authorMads Kiilerich <madski@unity3d.com>
Thu, 15 May 2014 01:48:37 +0200
changeset 21639 57e0f053e529
parent 21638 5337cb17fa1f
child 21640 4bfb721de6dd
buildrpm: collect code for building local hg and using it in one place
contrib/buildrpm
contrib/mercurial.spec
--- a/contrib/buildrpm	Tue May 20 03:57:21 2014 +0200
+++ b/contrib/buildrpm	Thu May 15 01:48:37 2014 +0200
@@ -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 @@
     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
--- a/contrib/mercurial.spec	Tue May 20 03:57:21 2014 +0200
+++ b/contrib/mercurial.spec	Thu May 15 01:48:37 2014 +0200
@@ -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 @@
 # 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.