Building a package from source
This article describes the general procedure for building DANOS packages from source. Packages must be built on a Debian host that corresponds to the version of Debian for the given DANOS release. The 2005 release is based on Debian 10 so you will need a Debian 10 environment of some kind to get started. The particular flavor of Debian environment is up to you, VM, container, chroot, etc.
These instructions have been automated using a Docker based environment in the following tool GitHub - jsouthworth/danos-buildpackage: Use containers to build DANOS packages. If you have Docker installed this tool may be run from the root of a package directory to build the package. It supports advanced build modes such as building against other local packages that have previously been built. Binaries for Linux (.elf), macOS (.mach-o), and Windows 10 (.exe) are available in the Releases tab for the tool.
Instructions
Setup a Debian environment for development with the “devscripts” package from buster-backports installed.
Example
$ apt-get -y install devscripts
Add the Debian repos and signing keys for the given DANOS Release
Example
$ sudo tee /etc/apt/sources.list.d/danos.list << EOF deb http://repos.danosproject.org.s3-website-us-west-1.amazonaws.com/repo/ 2005 main EOF $ wget -q -O- https://s3-us-west-1.amazonaws.com/repos.danosproject.org/Release.key | sudo apt-key add -
Use ‘apt-get update’ to update the package cache
Example
$ sudo apt-get update
Configure required package pinning priorities so that DANOS package are preferred over Debian packages
Example
$ sudo tee /etc/apt/preferences.d/998danos << EOF Package: * Pin: release o=DANOS Pin-Priority: 998 EOF
Install the following necessary build packages
Example
$ sudo apt install lintian-profile-vyatta base-files-vyatta
Clone the package source
Example
$ git clone https://github.com/danos/configd $ cd configd
Install the build dependencies for the package you will be working on using the mk-build-deps script
Example
$ sudo mk-build-deps --install --remove debian/control
Build the package using the Debian build tools
Example
$ debuild -uc -us -i -b
Note that you may see lintian warnings (W:) or non-fatal errors (E:). Before assuming your build has failed, check whether any ‘.deb’ files have been created / updated in the parent directory.
Make your changes to the source
Rebuild the package using the Debian build tools again
Related articles
'