5
1
Fork
You've already forked nbuilder.deb
0
Package Builder for Debian & Ubuntu
  • Shell 100%
2026年07月08日 14:52:40 +02:00
keys update Go repo key 2026年05月20日 11:19:33 +02:00
.gitignore refactor builder 2024年03月16日 20:43:53 +01:00
__build.sh delete unreferenced files from pools 2026年06月07日 18:49:19 +02:00
__download.sh Revert "fail build if download fails" 2024年06月05日 08:44:37 +02:00
__run.sh refactor builder 2024年03月16日 20:43:53 +01:00
__sign.sh Revert "add "Origin" to the "Release" files" 2026年07月08日 14:52:40 +02:00
__upload.sh refactor builder 2024年03月16日 20:43:53 +01:00
create_update_chroots.config.default update the default list of distros 2026年05月26日 15:51:37 +02:00
create_update_chroots.sh use trixie go backports 2026年06月07日 18:14:26 +02:00
destroy_all_chroots.sh fix permission 2024年04月19日 10:49:04 +02:00
eduvpn_v3-dev.config.default drop ubuntu+22.04 from eduvpn_v3-dev 2026年05月26日 15:53:02 +02:00
eduvpn_v3-dev.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3-dev_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3-dev_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3-dev_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3-dev_upload.sh switch eduvpn_v2-dev and eduvpn_v3_dev 2022年11月30日 12:00:32 +01:00
eduvpn_v3.config.default add Ubuntu 26.04 targets 2026年04月24日 08:07:02 +02:00
eduvpn_v3.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
eduvpn_v3_upload.sh switch eduvpn_v3 2022年11月30日 12:26:36 +01:00
enable_golang_ubuntu_ppa.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
enable_golang_v1_repo.sh enable correct suite 2026年05月27日 08:49:44 +02:00
filesender_v1-dev.config.default add filesender build config 2026年05月11日 13:04:55 +02:00
filesender_v1-dev.sh add filesender build config 2026年05月11日 13:04:55 +02:00
filesender_v1-dev_build.sh add filesender build config 2026年05月11日 13:04:55 +02:00
filesender_v1-dev_download.sh add filesender build config 2026年05月11日 13:04:55 +02:00
filesender_v1-dev_sign.sh add filesender build config 2026年05月11日 13:04:55 +02:00
filesender_v1-dev_upload.sh add filesender build config 2026年05月11日 13:04:55 +02:00
GO.md there is a trixie golang backport now 2026年06月07日 18:27:22 +02:00
golang_v1-dev.config.default add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1-dev.sh add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1-dev_build.sh add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1-dev_download.sh add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1-dev_sign.sh add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1-dev_upload.sh add golang v1-dev target 2026年05月19日 15:22:25 +02:00
golang_v1.config.default use trixie go backports 2026年06月07日 18:14:26 +02:00
golang_v1.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
golang_v1_build.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
golang_v1_download.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
golang_v1_sign.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
golang_v1_upload.sh add build scripts for newer Go versions 2024年04月18日 13:08:28 +02:00
php-openid-op_v1-dev.config.default add php-yubitwee.deb and php-ldap.deb 2025年04月28日 21:25:30 +02:00
php-openid-op_v1-dev.sh add initial files for php-openid-op 2025年04月28日 17:00:46 +02:00
php-openid-op_v1-dev_build.sh add initial files for php-openid-op 2025年04月28日 17:00:46 +02:00
php-openid-op_v1-dev_download.sh add initial files for php-openid-op 2025年04月28日 17:00:46 +02:00
php-openid-op_v1-dev_sign.sh add initial files for php-openid-op 2025年04月28日 17:00:46 +02:00
php-openid-op_v1-dev_upload.sh add initial files for php-openid-op 2025年04月28日 17:00:46 +02:00
php-saml-sp_v2-dev.config.default add Ubuntu 26.04 targets 2026年04月24日 08:07:02 +02:00
php-saml-sp_v2-dev.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2-dev_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2-dev_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2-dev_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2-dev_upload.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2.config.default add Ubuntu 26.04 targets 2026年04月24日 08:07:02 +02:00
php-saml-sp_v2.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
php-saml-sp_v2_upload.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4-dev.config.default remove plucky, EOL 2026年03月02日 12:36:37 +01:00
python-eduvpn-client_v4-dev.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4-dev_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4-dev_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4-dev_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4-dev_upload.sh add python-eduvpn-client_v4-dev target 2023年03月07日 15:12:16 +01:00
python-eduvpn-client_v4.config.default remove plucky, EOL 2026年03月02日 12:36:37 +01:00
python-eduvpn-client_v4.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4_build.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4_download.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4_sign.sh refactor builder 2024年03月16日 20:43:53 +01:00
python-eduvpn-client_v4_upload.sh make buildscripts symlinks again 2023年03月07日 15:09:31 +01:00
README.md also install/use aptitude 2026年05月12日 09:15:45 +02:00
show_golang_version.sh make script executable 2024年04月19日 13:28:23 +02:00
TODO.md update TODO 2024年04月29日 13:49:20 +02:00

Builder

An introduction to Debian packaging (in general) can be found here.

Requirements

We recommend you use a clean Debian as your build machine. Currently we recommend you to use Debian 13.

$ sudo apt install \
 debian-archive-keyring \
 ubuntu-archive-keyring \
 devscripts \
 rsync \
 aptitude \
 build-essential \
 debootstrap \
 apt-cacher-ng \
 sbuild \
 pkg-php-tools \
 golang-go \
 dh-golang \
 dh-sysuser \
 dh-python \
 python3-setuptools \
 python3-wheel \
 python3-sphinx \
 apache2-dev \
 reprepro \
 git-buildpackage \
 dh-make

Make sure your user is a member of the sbuild group:

$ sudo usermod -a -G sbuild $(whoami)
$ newgrp sbuild

Make sure you have a PGP key, .e.g.:

$ gpg \
 --batch \
 --passphrase '' \
 --quick-generate-key "Repository Signing Key <me+repo@example.org>" \
 default \
 sign \
 10y

Clone Repository

$ git clone https://codeberg.org/eduVPN/nbuilder.deb

All commands below are executed inside the nbuilder.deb folder.

Create Chroots

The script create_update_chroots.sh can be used to create the chroots and update them.

If you want to update the suites, you can copy create_update_chroots.config.default to create_update_chroots.config and modify it as needed.

Then run the script:

$ ./create_update_chroots.sh

sbuild

The new sbuild backend will be unshare, see #6. The sbuild command will inform us about that quite loudly, we can silence this. Until such time we areable to adopt unshare, you need to update your sbuild configuration:

$ mkdir -p ${HOME}/.config/sbuild
$ cat << 'EOF' > ${HOME}/.config/sbuild/config.pl
$chroot_mode = "schroot";
$schroot = "schroot";
$clean_source=0;
$build_dep_resolver = "aptitude";
EOF

The clean_source option is because of this issue which prevents build dependencies from being installed, or something.

We also switch to aptitude as a dependency resolver, which works better than the default apt.

Configuration

To start building packages, know which one you want to run. We'll use eduVPN 3.x as the example below.

Copy eduvpn_v3.config.default to eduvpn_v3.config. Modify the file by setting the KEY_ID to the Key ID of your PGP key you generated above, e.g.:

KEY_ID=me+repo@example.org

You can also modify DISTRO_SUITE_LIST, REPO_URL_BRANCH_LIST if necessary. You will need to update UPLOAD_SERVER_PATH_LIST to specify the account, server and path where you want to upload the package repository. It is recommended to configure SSH keys for authenticating to the SSH server.

Export your public key to the keys/ folder so it can be found by the builder and uploader:

$ gpg --export -a me+repo@example.org > keys/me+repo@example.org.asc

Updated Go Compiler

If you are building Go software, you may benefit from using the latest Go compiler. Look here on how to enable that.

Building

The builder performs 4 steps:

  1. Download the current repository from the remote server (UPLOAD_SERVER_PATH_LIST), if there is >1 listed, e.g. mirrors, only the first one is used;
  2. Build the packages that are not yet in the repository;
  3. Sign the repository;
  4. Upload the repository.

To run the builder:

$ ./eduvpn_v3.sh

Updating Packages

NOTE: only do this if you want to package newer versions of the software, NOT run the builder.

Environment

Make sure the variables DEBFULLNAME and DEBEMAIL are set. This makes sure dch below uses this information to update the debian/changelog file. Add this to the bottom of ${HOME}/.profile:

export DEBFULLNAME="François Kooman"
export DEBEMAIL=fkooman@deic.dk

After this make sure you logout and in again.

Updating

In order to update a package, you can use the following commands, if necessary first fork the repository to a place where you can "push" to:

$ git clone git@codeberg.org:eduVPN/vpn-user-portal.deb

We need to make the upstream branch available locally, not sure how to do that properly, but this works:

$ git checkout upstream
$ git checkout v3

Download the latest upstream tar release and verify the signature:

$ uscan

Import the new release in the Git repository:

$ gbp import-orig ../vpn-user-portal_3.0.5.orig.tar.xz

Update the debian/changelog file. Your editor will be opened.

$ dch -v 3.0.5-1

The update message could be "update to 3.0.5". If you make any other changes to the package, note them here as well. Finalize the changes:

$ dch -r --distribution unstable

Review the changes:

$ git diff

If all looks good, commit and push the changes:

$ git commit -a -m 'update to 3.0.5'

Now push all branches/tags to the server:

$ git push origin --all
$ git push origin --tags

New Package

It is not so easy to create a new package. Especially when starting from scratch. Even using an existing package to get it under version control is not trivial. I'm making notes now where I am creating a new package. This is not really a complete instruction on how to create a package from scratch. It involves some random stuff that is very hard to document, but this is sort of the basics.

First install dh-make package. You can then use it to create a new package.

$ curl -O https://codeberg.org/fkooman/php-radius/releases/download/2.0.0/php-radius-2.0.0.tar.xz
$ tar -xJf php-radius-2.0.0.tar.xz
$ cd php-radius-2.0.0
$ dh_make -i --createorig

This will create the debian/ folder where the packaging instructions are at. You can modify them, or better, copy the contents from another similar package over and modify it.

Once done, try to create a package, it may complain and ask you to install some additional dependencies though:

$ debuild

Once this succeeds, we can use gbp to get the package under source control. We need to .dsc file for this.

$ cd ${HOME}/Projects/eduVPN-v3/deb
$ gbp import-dsc --debian-branch=main /path/to/php-radius_0.1.0-1.dsc
$ mv php-radius php-radius.deb
$ cd php-radius.deb

Test if all is good, by running uscan:

$ uscan --download-current-version
uscan: Newest version of php-radius on remote site is 0.1.0, specified download version is 0.1.0
gpgv: Signature made Mo 02 Okt 2023 12:12:44 CEST
gpgv: using RSA key 6237BAF1418A907DAA98EAA79C5EDD645A571EB2
gpgv: Good signature from "François Kooman <fkooman@tuxed.net>"
Successfully symlinked ../0.1.0.tar.gz to ../php-radius_0.1.0.orig.tar.xz.

Now we have everything we should have to feed this package to nbuilder.deb, but first upload it to a remote git repository:

$ git remote add origin git@codeberg.org:fkooman/php-radius.deb
$ git push --all
$ git push --tags

uscan

The format of debian/watch file as used by uscan is very very crazy. With lots of trial and error we made it work. I do not pretend to 100% understand, nor whether this is the best/simplest way to go.

Codeberg

For releases hosted on codeberg.org, you can use the following in debian/watch:

version=4
opts="pgpmode=auto" \
	https://codeberg.org/eduVPN/@PACKAGE@/releases \
	https://codeberg.org/eduVPN/@PACKAGE@/releases/download/(?:.*)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@

SourceHut

For releases hosted on sr.ht, you can use the following in debian/watch:

version=4
opts="pgpmode=auto,downloadurlmangle=s%/~fkooman/@PACKAGE@/archive/@ANY_VERSION@@ARCHIVE_EXT@%/~fkooman/@PACKAGE@/refs/download/1ドル/@PACKAGE@-1ドル.tar.xz%" \
	https://git.sr.ht/~fkooman/@PACKAGE@/refs \
	/~fkooman/@PACKAGE@/archive/@ANY_VERSION@@ARCHIVE_EXT@