summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2018-08-21 21:26:18 -0400
committerAndrew Gallant <jamslam@gmail.com>2018-08-21 23:05:52 -0400
commit5c80e4adb69c618e458cfc70a8502a497604825c (patch)
treeb67b9781845888a61693cd4db7fb079e3954b340 /ci
parentfcd185303198f9a6c8026e0a632c84bacf36e779 (diff)
release: better support for binary Debian package
This commit beefs up the package metadata used by the 'cargo deb' tool to produce a binary dpkg. In particular, we now include ripgrep's man page. This commit includes a new script, 'ci/build_deb.sh', which will handle the build process for a dpkg, which has become a bit more nuanced than just running 'cargo deb'. We don't (yet) run this script in CI. Fixes #842
Diffstat (limited to 'ci')
-rwxr-xr-xci/build_deb.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/ci/build_deb.sh b/ci/build_deb.sh
new file mode 100755
index 00000000..eb516191
--- /dev/null
+++ b/ci/build_deb.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+set -e
+
+# This script builds a binary dpkg for Debian based distros. It does not
+# currently run in CI, and is instead run manually and the resulting dpkg is
+# uploaded to GitHub via the web UI.
+#
+# Note that this requires 'cargo deb', which can be installed with
+# 'cargo install cargo-deb'.
+#
+# This should be run from the root of the ripgrep repo.
+
+if ! command -V cargo-deb > /dev/null 2>&1; then
+ echo "cargo-deb command missing" >&2
+ exit 1
+fi
+
+# 'cargo deb' does not seem to provide a way to specify an asset that is
+# created at build time, such as ripgrep's man page. To work around this,
+# we force a debug build, copy out the man page produced from that build, put
+# it into a predictable location and then build the deb, which knows where to
+# look.
+
+mkdir -p deployment
+cargo build
+manpage="$(find ./target/debug -name rg.1 -print0 | xargs -0 ls -t | head -n1)"
+cp "$manpage" deployment/
+# Since we're distributing the dpkg, we don't know whether the user will have
+# PCRE2 installed, so just do a static build.
+PCRE2_SYS_STATIC=1 cargo deb