From b86490633b279f96126d73472c70df136890ab88 Mon Sep 17 00:00:00 2001 From: yrajukurapati Date: Thu, 28 May 2026 14:10:07 -0700 Subject: [PATCH] Add Noble debian packaging for birdwatcher 2.2.2-1ubuntu1 --- .gitignore | 8 +++++++- Makefile.packaging | 14 ++++++++++++++ README.md | 10 ++++++++++ build-debian-package.sh | 6 ++++++ debian/.gitignore | 3 +++ debian/changelog | 11 +++++++++++ debian/compat | 1 + debian/control | 12 ++++++++++++ debian/copyright | 15 +++++++++++++++ debian/install | 1 + debian/postinst | 6 ++++++ debian/rules | 11 +++++++++++ debian/source/format | 1 + docker-compose.yml | 19 +++++++++++++++++++ noble/Dockerfile | 11 +++++++++++ 15 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 Makefile.packaging create mode 100755 build-debian-package.sh create mode 100644 debian/.gitignore 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/postinst create mode 100755 debian/rules create mode 100644 debian/source/format create mode 100644 docker-compose.yml create mode 100644 noble/Dockerfile diff --git a/.gitignore b/.gitignore index 653cb5a..6a1f010 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,10 @@ birdwatcher-* DIST/ *.local.* -debug.test \ No newline at end of file +debug.test + +# Debian package build outputs +birdwatcher_*_amd64.deb +birdwatcher_*_amd64.buildinfo +birdwatcher_*_amd64.changes +noble/dist/ diff --git a/Makefile.packaging b/Makefile.packaging new file mode 100644 index 0000000..89d7382 --- /dev/null +++ b/Makefile.packaging @@ -0,0 +1,14 @@ +build-image: + docker compose build +.PHONY: build-image + +noble: build-image + docker compose run --rm noble + mkdir -p noble/dist + mv birdwatcher_*_amd64.deb noble/dist/ +.PHONY: noble + +clean: + rm -f birdwatcher_*_amd64.deb birdwatcher_*_amd64.buildinfo birdwatcher_*_amd64.changes + rm -rf noble/dist +.PHONY: clean diff --git a/README.md b/README.md index 6d70056..59967a2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,16 @@ Our version also has a few more capabilities, as you will discover when looking at [the modules section](https://github.com/alice-lg/birdwatcher/blob/master/etc/birdwatcher/birdwatcher.conf) of the config. +## Debian package (Noble) + +Build a `.deb` for Ubuntu 24.04 using Docker (same pattern as `bird-debian` / `frr_exporter-debian`): + +```bash +make -f Makefile.packaging noble +``` + +The package installs `/usr/sbin/birdwatcher`. Chef still manages systemd units via the l3mpls cookbook. + ## Installation You will need to have go installed to build the package. diff --git a/build-debian-package.sh b/build-debian-package.sh new file mode 100755 index 0000000..c58627a --- /dev/null +++ b/build-debian-package.sh @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +cd "$(dirname "$0")" +debuild -us -uc -b +# debuild writes artifacts one directory above the source tree; keep them in-repo. +mv ../birdwatcher_*_amd64.deb ../birdwatcher_*_amd64.buildinfo ../birdwatcher_*_amd64.changes . 2>/dev/null || true diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000..c7fb37d --- /dev/null +++ b/debian/.gitignore @@ -0,0 +1,3 @@ +birdwatcher.debhelper.log +birdwatcher.substvars +files diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..7834ba2 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,11 @@ +birdwatcher (2.2.2-1ubuntu1) noble; urgency=medium + + * Build birdwatcher for Ubuntu 24.04 (Noble). + + -- CNS-VPC-GATEWAYS Thu, 28 May 2026 14:00:00 +0000 + +birdwatcher (2.2.2-1ubuntu3) jammy; urgency=medium + + * Jammy speaker build (historical reference). + + -- CNS-VPC-GATEWAYS Tue, 31 Jan 2023 16:00:00 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..0af3204 --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: birdwatcher +Maintainer: CNS-VPC-GATEWAYS +Section: net +Priority: optional +Standards-Version: 3.9.5 +Build-Depends: debhelper (>= 9), golang-go (>= 2:1.13~) + +Package: birdwatcher +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, adduser +Description: JSON API service for alice-lg. + Birdwatcher exposes BIRD routing state over HTTP for monitoring and tooling. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..df3eef2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,15 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: birdwatcher +Source: https://github.com/alice-lg/birdwatcher + +Files: * +Copyright: 2016 Alice LG contributors +License: GPL-3.0+ + This package 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. + +Files: debian/* +Copyright: 2026 DigitalOcean, LLC +License: GPL-3.0+ diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..1e8fb24 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +birdwatcher usr/sbin/ diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..7fdc0e9 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +# System user for the birdwatcher service when run outside Chef-managed units. +(id birdwatcher >/dev/null 2>&1) || + adduser --system --group --no-create-home --home /nonexistent birdwatcher diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..fb832e3 --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +%: + dh $@ + +# Build the Go binary; modules are fetched during the docker build. +override_dh_auto_build: + GO111MODULE=on GOARCH=amd64 GOOS=linux go build -o birdwatcher . + +override_dh_auto_test: + @echo "Skipping tests during package build" diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..50626f4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,19 @@ +--- +x-mount: &mount + volumes: + - .:/code + working_dir: /code + +x-env: &env + environment: + DEBFULLNAME: ${DEBFULLNAME:-CNS-VPC-GATEWAYS} + DEBEMAIL: ${DEBEMAIL:-cns-vpc-gateways@digitalocean.com} + +services: + noble: + image: birdwatcher-noble + build: + context: noble + <<: [*mount, *env] + entrypoint: ./build-debian-package.sh + platform: linux/amd64 diff --git a/noble/Dockerfile b/noble/Dockerfile new file mode 100644 index 0000000..86efd67 --- /dev/null +++ b/noble/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:24.04 + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update && \ + apt-get install --yes \ + devscripts \ + debhelper \ + golang-go \ + build-essential \ + git && \ + rm -rf /var/lib/apt/lists/*