From d67f9ea9bbce819072d430209343b1387d136805 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 25 Sep 2023 08:36:39 +0300 Subject: [PATCH] Add rudimentary Debian packaging for binaries This is very much not up to the standards of an official Debian package. To make a proper package of Radicle will require packaging all the dependencies first, and the Radicle crates need to be published to crates.io, among other things. This is just a lazy first cut to see if there's any interest in a .deb. --- debian/build-deb | 34 ++++++++++++++++++++++++++++++++++ debian/cargo-checksum.json | 1 + debian/changelog | 5 +++++ debian/compat | 2 ++ debian/control | 18 ++++++++++++++++++ debian/copyright | 10 ++++++++++ debian/install | 1 + debian/lintian-overrides | 1 + debian/rules | 17 +++++++++++++++++ debian/source/format | 1 + git-remote-rad.1.adoc | 26 ++++++++++++++++++++++++++ radicle-httpd.1.adoc | 25 +++++++++++++++++++++++++ radicle-node.1.adoc | 25 +++++++++++++++++++++++++ 13 files changed, 166 insertions(+) create mode 100755 debian/build-deb create mode 100644 debian/cargo-checksum.json create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100644 debian/lintian-overrides create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 git-remote-rad.1.adoc create mode 100644 radicle-httpd.1.adoc create mode 100644 radicle-node.1.adoc diff --git a/debian/build-deb b/debian/build-deb new file mode 100755 index 00000000..6f9ff8bc --- /dev/null +++ b/debian/build-deb @@ -0,0 +1,34 @@ +#!/bin/bash + +set -euo pipefail + +rm -f ../radicle*_* +git clean -fdx + +# Get name and version of source package. +name="$(dpkg-parsechangelog -SSource)" +version="$(dpkg-parsechangelog -SVersion)" + +# Get upstream version: everything before the last dash. +uv="$(echo "$version" | sed 's/-[^-]*$//')" +orig="${name}_${uv}.orig.tar.xz" + +# Create a tar ball without the Debian packaging. +tmp="$(mktemp -d)" +trap 'rm -rf "$tmp"' EXIT +git archive HEAD | tar -C "$tmp" -xf - +rm -rf "$tmp/debian" +tar -C "$tmp" -cf - . | xz >"../$orig" + +# Actually build the package, without signing the .changes file. +dpkg-buildpackage -us -uc + +# Dump some information to make it easier to visually verify +# everything looks OK. Also, test the package with the lintian tool. +arch="$(dpkg --print-architecture)" +deb="../${name}_${version}_${arch}.deb" +changes="../${name}_${version}_${arch}.changes" + +ls -l "$deb" +dpkg -c "$deb" +lintian -i "$changes" diff --git a/debian/cargo-checksum.json b/debian/cargo-checksum.json new file mode 100644 index 00000000..6852d00f --- /dev/null +++ b/debian/cargo-checksum.json @@ -0,0 +1 @@ +/* This file needs to exist, but can be empty. */ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..a4efdeb5 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +radicle (0.8.0-1) unstable; urgency=medium + + * New release. + + -- Lars Wirzenius Mon, 25 Sep 2023 08:34:08 +0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..021ea30c --- /dev/null +++ b/debian/compat @@ -0,0 +1,2 @@ +10 + diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..11174039 --- /dev/null +++ b/debian/control @@ -0,0 +1,18 @@ +Source: radicle +Maintainer: The Radicle Team +Uploaders: Lars Wirzenius +Section: vcs +Priority: optional +Standards-Version: 4.6.2 +Build-Depends: debhelper (>= 10~), + dh-cargo, + asciidoctor +Homepage: https://radicle.xyz/ + +Package: radicle +Architecture: any +Depends: ${misc:Depends}, ${shlibs:Depends}, git +Description: peer-to-peer, distributed git hosting + Radicle is a secure, decentralized and powerful alternative to code + forges such as GitHub and GitLab that preserves user sovereignty and + freedom. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..05a9fff6 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,10 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: heartwood +Upstream-Contact: https://radicle.xyz/ +Source: https://app.radicle.xyz/seeds/seed.radicle.xyz + +Files: * +Copyright: 2019-2021, The Radicle Foundation +License: Apache-2 or Expat + License texts omitted, see LICENSE-APACHE and LICENSE-MIT in the + source tree. diff --git a/debian/install b/debian/install new file mode 100644 index 00000000..7e79e07c --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +*.1 usr/share/man/man1 diff --git a/debian/lintian-overrides b/debian/lintian-overrides new file mode 100644 index 00000000..a9c3f999 --- /dev/null +++ b/debian/lintian-overrides @@ -0,0 +1 @@ +radicle binary: initial-upload-closes-no-bugs diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..df501664 --- /dev/null +++ b/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +%: + dh $@ --buildsystem cargo + +override_dh_auto_build: + scripts/build-man-pages.sh . *.adoc + +override_dh_auto_install: + cargo install --locked --path=radicle-cli --root=debian/radicle + cargo install --locked --path=radicle-node --root=debian/radicle + cargo install --locked --path=radicle-remote-helper --root=debian/radicle + cargo install --locked --path=radicle-httpd --root=debian/radicle + rm -f debian/*/.crates*.* + +override_dh_auto_test: + echo tests are disabled, for now diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/git-remote-rad.1.adoc b/git-remote-rad.1.adoc new file mode 100644 index 00000000..ca8c75ae --- /dev/null +++ b/git-remote-rad.1.adoc @@ -0,0 +1,26 @@ += git-remote-rad(1) +The Radicle Team +:doctype: manpage +:revnumber: 0.8.0 +:revdate: 2023-10-12 +:mansource: rad {revnumber} +:manmanual: Radicle CLI Manual + +== Name + +git-remote-rad - Git remote helper for Radicle + +== Synopsis + +*git-remote-rad* * + +== Description + +**git-remote-rad** is a **git**(1) remote helper program to allow git +to interact with the local Radicle storage. git will use this program +automatically, when using a remote repository with the "rad" protocol. +It is never invoked directly. + +== SEE ALSO == + +*git-remote-helpers*(1), *rad*(1) diff --git a/radicle-httpd.1.adoc b/radicle-httpd.1.adoc new file mode 100644 index 00000000..95ecece2 --- /dev/null +++ b/radicle-httpd.1.adoc @@ -0,0 +1,25 @@ += radicle-httpd(1) +The Radicle Team +:doctype: manpage +:revnumber: 0.8.0 +:revdate: 2023-10-12 +:mansource: rad {revnumber} +:manmanual: Radicle CLI Manual + +== Name + +radicle-httpd - Radicle HTTP daemon + +== Synopsis + +*radicle-httpd* --help + +== Description + +A Radicle HTTP daemon exposing a JSON HTTP API that allows someone to browse local +repositories on a Radicle node via their web browser. This manual page is a +placeholder to point you at the *--help* option. + +== SEE ALSO == + +*rad*(1) diff --git a/radicle-node.1.adoc b/radicle-node.1.adoc new file mode 100644 index 00000000..aa83c560 --- /dev/null +++ b/radicle-node.1.adoc @@ -0,0 +1,25 @@ += radicle-node(1) +The Radicle Team +:doctype: manpage +:revnumber: 0.8.0 +:revdate: 2023-10-12 +:mansource: rad {revnumber} +:manmanual: Radicle CLI Manual + +== Name + +radicle-node - Radicle node + +== Synopsis + +*radicle-node* --help + +== Description + +A Radicle node synchronizes its Git repositories with other nodes. +This manual page is a placeholder to point you at the *--help** +option. + +== SEE ALSO == + +*rad*(1)