Skip to content

Commit

Permalink
fpf: Add instructions on how to build a package
Browse files Browse the repository at this point in the history
Add instructions on how to build an Ubuntu Jammy package for `conmon`.
Also, add an explanation of why does FPF needs to create an Ubuntu Jammy
package for this project

Refs freedomofpress/dangerzone#685
  • Loading branch information
apyrgio committed Feb 13, 2024
1 parent cfde52d commit 166e9f4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
_Maintained by Freedom of the Press Foundation for the project Dangerzone.
For more details, read `fpf/README.md`._

[![Total alerts](https://img.shields.io/lgtm/alerts/g/containers/conmon.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/containers/conmon/alerts/)

# conmon
Expand Down
1 change: 1 addition & 0 deletions fpf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.deb
9 changes: 9 additions & 0 deletions fpf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:jammy

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
dpkg-dev debhelper-compat go-md2man golang-go \
libglib2.0-dev libseccomp-dev libsystemd-dev

RUN mkdir -p /builder/conmon

WORKDIR /builder/conmon
14 changes: 14 additions & 0 deletions fpf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Background

The purpose of this repo is to build an Ubuntu Jammy package for `conmon`, that
contains a fix that is necessary for Dangerzone to function. For more details,
see https://github.com/freedomofpress/dangerzone/issues/685.

## Build instructions

You can build conmon by changing into this directory and running `./build.sh`.
This script should be an Ubuntu Jammy container image, with all the necessary
build dependencies in order to produce a `conmon` Debian package for Ubuntu
Jammy. The `.deb` files will be copied in this directory.

If you prefer Podman, you can use `./build.sh podman` instead.
15 changes: 15 additions & 0 deletions fpf/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -ex

GIT_ROOT=$(git rev-parse --show-toplevel)
RUNTIME=${1:-docker}

$RUNTIME build --pull -t fpf/builder-conmon .
$RUNTIME run --rm -v ${GIT_ROOT}:/builder/conmon \
fpf/builder-conmon sh -c 'dpkg-buildpackage -b && mv ../conmon_*\.deb fpf/'

set +x

echo "Debian package built successfully. You can find it under:"
ls -l ${GIT_ROOT}/fpf/conmon*

0 comments on commit 166e9f4

Please sign in to comment.