[PATCH 4 of 5 remotefilelog-ext debs] contrib: new rules for building a debian package of remotefilelog

Augie Fackler raf at durin42.com
Thu Sep 10 10:34:22 CDT 2015


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1441897296 14400
#      Thu Sep 10 11:01:36 2015 -0400
# Node ID 9fec75539a1e42cee876b481f1e748dafc1f347c
# Parent  dbe55fd6989b767892e8cc1350f8d0d7197a361c
contrib: new rules for building a debian package of remotefilelog

To build it, simply do `bash contrib/builddeb`, which will build a
debian package for the current host system.

diff --git a/contrib/builddeb b/contrib/builddeb
new file mode 100755
--- /dev/null
+++ b/contrib/builddeb
@@ -0,0 +1,31 @@
+#!/bin/sh -eu
+#
+# Build a remotefilelog debian package from the current repo
+
+if [ ! -d .hg ]; then
+    echo 'You are not at the repository root!' 1>&2
+    exit 1
+fi
+
+cp -r contrib/debian debian
+trap "rm -r '$PWD/debian'" EXIT
+
+version=$(hg log -r . -T'{latesttag}-{latesttagdistance}-{node|short}')
+
+control=debian/control
+changelog=debian/changelog
+# This looks like sed -i, but sed -i behaves just differently enough
+# between BSD and GNU sed that I gave up and did the dumb thing.
+sed "s/__VERSION__/$version/" < $changelog > $changelog.tmp
+date=$(date --rfc-2822)
+sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
+rm $changelog.tmp
+
+debuild -us -uc -b || exit 1
+OUTPUTDIR=${OUTPUTDIR:=packages/debian-unknown}
+mkdir -p $OUTPUTDIR
+find ../remotefilelog*.deb ../remotefilelog_*.build \
+      ../remotefilelog_*.changes -type f -newer $control -print0 | \
+  xargs -Inarf -0 mv narf "$OUTPUTDIR"
+echo "Built packages for $version:"
+find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
diff --git a/contrib/debian/changelog b/contrib/debian/changelog
new file mode 100644
--- /dev/null
+++ b/contrib/debian/changelog
@@ -0,0 +1,5 @@
+remotefilelog (__VERSION__) unstable; urgency=medium
+
+  * Automated build performed by upstream.
+
+ -- Mercurial Devel <mercurial-devel at selenic.com>  __DATE__
diff --git a/contrib/debian/compat b/contrib/debian/compat
new file mode 100644
--- /dev/null
+++ b/contrib/debian/compat
@@ -0,0 +1,1 @@
+9
diff --git a/contrib/debian/control b/contrib/debian/control
new file mode 100644
--- /dev/null
+++ b/contrib/debian/control
@@ -0,0 +1,28 @@
+Source: remotefilelog
+Section: vcs
+Priority: optional
+Maintainer: Durham Goode <durham at fb.com>
+Build-Depends:
+ debhelper (>= 7),
+ dh-python,
+ python-all
+Standards-Version: 3.9.4
+X-Python-Version: >= 2.6
+
+Package: remotefilelog
+Depends:
+ python,
+ ${shlibs:Depends},
+ ${misc:Depends},
+ ${python:Depends},
+ mercurial,
+ python-lz4
+Architecture: any
+Description: allows Mercurial to clone shallow copies of a repository and
+ load files on demand.
+ .
+ The remotefilelog extension allows Mercurial to clone shallow copies
+ of a repository such that all file contents are left on the server
+ and only downloaded on demand by the client. This greatly speeds up
+ clone and pull performance for repositories that have long histories
+ or that are growing quickly.
diff --git a/contrib/debian/copyright b/contrib/debian/copyright
new file mode 100644
--- /dev/null
+++ b/contrib/debian/copyright
@@ -0,0 +1,27 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: remotefilelog
+Source: https://bitbucket.org/facebook/remotefilelog
+
+Files: *
+Copyright: 2013 Facebook, Inc.
+License: GPL-2+
+ This program is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE.  See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public
+ License along with this package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
diff --git a/contrib/debian/rules b/contrib/debian/rules
new file mode 100644
--- /dev/null
+++ b/contrib/debian/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+#
+# uncomment the next line for verbose mode
+#export DH_VERBOSE=1
+
+%:
+	dh $@ --with python2
+
+override_dh_auto_install:
+	python$(PYVERS) setup.py install --root $(CURDIR)/debian/remotefilelog --install-layout=deb
+	find $(CURDIR)/debian/remotefilelog -name '*.egg-info' -delete


More information about the Mercurial-devel mailing list