[PATCH 4 of 6] Make contrib/buildrpm work on Fedora 9

Mads Kiilerich mads at kiilerich.com
Wed Sep 17 14:06:21 CDT 2008


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1221678136 -7200
# Node ID 6705a291b078fe07f4edf187d84d64e2f05d59e2
# Parent  a25ada4f695e0f51840c64d44b1f066cbb0d4a9e
Make contrib/buildrpm work on Fedora 9.
mercurial.spec had bitrotted. These changes makes it possible to build an rpm that is usable.
Only minimal changes has been made, and there is plenty of room for improvement.

diff -r a25ada4f695e -r 6705a291b078 contrib/buildrpm
--- a/contrib/buildrpm	Wed Sep 17 21:01:11 2008 +0200
+++ b/contrib/buildrpm	Wed Sep 17 21:02:16 2008 +0200
@@ -1,6 +1,8 @@
 #!/bin/sh
 #
 # Build a Mercurial RPM in place.
+# Known to work on:
+# - Fedora 9
 #
 # Bryan O'Sullivan <bos at serpentine.com>
 
@@ -12,7 +14,7 @@
     exit 1
 fi
 
-rpmdir=/tmp/"`basename $root | sed 's/ /_/'`"-rpm
+rpmdir=/tmp/"`basename $root | sed 's/ /_/'`"-rpm # FIXME: Insecure /tmp handling
 
 cd "$root"
 rm -rf $rpmdir
@@ -24,7 +26,7 @@
     exit 1
 fi
 
-tmpspec=/tmp/`basename "$specfile"`.$$
+tmpspec=/tmp/`basename "$specfile"`.$$ # FIXME: Insecure /tmp handling
 # Use the most recent tag as the version.
 version=`hg tags | perl -e 'while(<STDIN>){if(/^(\d\S+)/){print$1;exit}}'`
 # Compute the release number as the difference in revision numbers
@@ -58,5 +60,6 @@
     rm -rf $tmpspec $rpmdir/BUILD
     mv $rpmdir/RPMS/*/* $rpmdir && rm -r $rpmdir/RPMS
     echo
-    echo "Packages are in $rpmdir"
+    echo "Packages are in $rpmdir:"
+    ls -l $rpmdir/*.rpm
 fi
diff -r a25ada4f695e -r 6705a291b078 contrib/mercurial.spec
--- a/contrib/mercurial.spec	Wed Sep 17 21:01:11 2008 +0200
+++ b/contrib/mercurial.spec	Wed Sep 17 21:02:16 2008 +0200
@@ -55,6 +55,9 @@
 mkdir -p $lisp_dir
 install contrib/mercurial.el $lisp_dir
 
+# We don't want this, do we?
+rm -f $RPM_BUILD_ROOT%{pythonlib}/../mercurial-*-py2.5.egg-info
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -69,7 +72,6 @@
 %{_datadir}/emacs/site-lisp/mercurial.el
 %{_bindir}/hg
 %{_bindir}/hgk
-%{_bindir}/hgmerge
 %{_bindir}/hg-ssh
 %{_bindir}/hg-viz
 %{_bindir}/git-rev-tree
@@ -80,3 +82,6 @@
 %{pythonlib}/*.so
 %{hgext}/*.py*
 %{hgext}/convert/*.py*
+%{hgext}/inotify/*.py*
+%{hgext}/highlight/*.py*
+%{hgext}/inotify/linux/


More information about the Mercurial-devel mailing list