summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-09-29 15:34:07 +0300
committerLars Wirzenius <liw@liw.fi>2023-09-29 16:11:00 +0300
commitbbe5a68c46db83c83f531e225d946676c8b67ed8 (patch)
tree8b2fafe21b0ab97ed9eb6ca4131750a6de70ba16
parent4e6baf15da98931e97aeff4ac2379c3eb57395f8 (diff)
downloadambient-build-vm-bbe5a68c46db83c83f531e225d946676c8b67ed8.tar.gz
chore: Debian packaging
Sponsored-by: author
-rwxr-xr-xambient-build-vm2
-rwxr-xr-xdebian/build-deb17
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/control21
-rw-r--r--debian/copyright23
-rwxr-xr-xdebian/rules27
-rw-r--r--debian/source/format1
8 files changed, 96 insertions, 1 deletions
diff --git a/ambient-build-vm b/ambient-build-vm
index 68ac9e9..124c6d6 100755
--- a/ambient-build-vm
+++ b/ambient-build-vm
@@ -12,7 +12,7 @@ import yaml
PROG = "ambient-build-vm"
DESC = "build virtual machine image with Debian for Ambient"
-VERSION = "0.0"
+VERSION = "0.1.0"
CACHE = os.path.expanduser("~/.cache/ambient")
BASE_VMDB = "base.vmdb"
BASE_PLAYBOOK = "playbook.yml"
diff --git a/debian/build-deb b/debian/build-deb
new file mode 100755
index 0000000..c4cbe53
--- /dev/null
+++ b/debian/build-deb
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+set -eu
+
+rm -f ../subplot*_*
+git clean -fdx
+
+# Get name and version of source package.
+name="$(dpkg-parsechangelog -SSource)"
+version="$(dpkg-parsechangelog -SVersion)"
+
+# Get upstream version: everythin before the last dash.
+uv="$(echo "$version" | sed 's/-[^-]*$//')"
+orig="${name}_${uv}.orig.tar.xz"
+
+git archive HEAD | xz >"../$orig"
+dpkg-buildpackage -us -uc
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..eebc0cf
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+ambient-build-vm (0.1.0-1) unstable; urgency=medium
+
+ * First release.
+
+ -- Lars Wirzenius <liw@liw.fi> Fri, 29 Sep 2023 15:28:59 +0300
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..96018bb
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,21 @@
+Source: ambient-build-vm
+Homepage: https://ambient.liw.fi/
+Maintainer: Lars Wirzenius <liw@liw.fi>
+Section: devel
+Priority: optional
+Standards-Version: 3.9.8
+Build-Depends: debhelper (>= 9),
+ dh-python,
+ python3-all-dev
+
+Package: ambient-build-vm
+Architecture: all
+Depends: ${misc:Depends},
+ python3,
+ ansible,
+ debootstrap,
+ qemu-utils,
+ vmdb2
+Description: create a virtual machine image for ambient-run
+ Ambient is a CI system. ambient-run runs a built in a VM,
+ ambient-build-vm builds a Debian VM for ambient-run.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..254d10a
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,23 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: vmdb2
+Upstream-Contact: Lars Wirzenius <liw@liw.fi>
+Source: https://ambient.liw.fi/
+
+Files: *
+Copyright: 2023, Lars Wirzenius
+License: GPL-3+
+ 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 3 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 program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On a Debian system, you can find a copy of GPL version 3 at
+ /usr/share/common-licenses/GPL-3 .
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..26678c8
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,27 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=ambient-build-vm
+NAME = ambient-build-vm
+export PYBUILD_SYSTEM=custom
+
+%:
+ dh $@ --with=python3 --buildsystem=pybuild
+
+override_dh_auto_build:
+ true
+
+override_dh_auto_test:
+ true
+
+override_dh_auto_install:
+ install -d debian/$(NAME)/usr/bin
+ install ambient-build-vm debian/$(NAME)/usr/bin
+
+ install -d debian/$(NAME)/usr/share/doc//$(NAME)
+ install README.md debian/$(NAME)/usr/share/doc//$(NAME)
+
+ install -d debian/$(NAME)/usr/share/$(NAME)
+ install ambient-build.service ambient-run-script base.vmdb playbook.yml \
+ debian/$(NAME)/usr/share/$(NAME)
+
+ find debian
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)