====== Building packages on Jenkins with pbuilder ====== pbuilder is the Debian build system for production packages. It uses a chroot environment to compile binary packages from source packages on a fresh Debian system. pbuilder is installed on the x86 and x86-64 Linux Jenkin slaves. To use it you must have a Debian source package mypackage.dsc and upstream's tarball, then you would for example use this command to compile for Debian Stretch amd64: DIST=stretch ARCH=amd64 sudo pbuilder build --buildresult $PWD *.dsc This will put the resulting binary packages in the current working directory. If your package depends on other packages not present in the Debian archive, you must copy them to /opt/pbuilder-local-repo/repo before the build. You can see example source package setups for qtox/libtoxcore here https://github.com/tux3/tox-pkgs You can also see example source package setups for toxic, along with some helper scripts for mass setup of builds and tar commands here https://github.com/optimumtact/tox-pkgs The source packages are ingested into pbuilder and it spits out nicely linked binary packages for shipping to the package server, this means you can do per distro versioning and other useful crud ====== Making Debian source packages ====== Please refer to the Debian manual. https://wiki.debian.org/IntroDebianPackaging https://www.debian.org/doc/manuals/maint-guide/ https://www.debian.org/doc/manuals/developers-reference/ https://www.debian.org/doc/debian-policy/ ====== How to make a cheap ass poor man's home-rolled package ====== Use this skeleton script for your deb package. #!/bin/bash -e ## Needful things # Compute Installed-Size. # It sums up the byte size of the directory tree given, then returns # kilos. # ex: # $ size_of_tree package/ size_of_tree() { python3 - "$1" < package/DEBIAN/control cat < Installed-Size: $INSTALLED_SIZE Depends: < Dependencies go here, if you have any. > Conflicts: < Packages that you conflict with, if any. > Section: default Priority: extra Homepage: https://tox.chat Description: The best Tox client. EOF md5_walk_dir package/* >> package/DEBIAN/md5sums fakeroot dpkg-deb -b package && mv package.deb "$PACKAGE_NAME" echo "$PACKAGE_NAME ready."