Unfortunately I couldn't find a complete and working documentation on how to do this. But this steps succeeded (at least once).
-
Install build dependencies
$ sudo apt-get install pbuilder devscripts dpatch grep-dctrl debhelper
-
Add deb-src sources to apt sources list (if you don't have it yet)
deb-src http://security.ubuntu.com/ubuntu xenial-security main universe multiverse restricted
-
Start the process:
$ mkdir exim $ apt-get source exim4 $ cd exim4-4.86.2 $ fakeroot debian/rules unpack-configs $ export my_pkg_name=custom $ cp EDITME.exim4-heavy EDITME.exim4-$my_pkg_name # edit the configuration and add/remove the features you want or don't want $ vi EDITME.exim4-$my_pkg_name # uncomment the two blocks which define the exim4-daemon-custom packages $ vi debian/control # in debian/rules set extradaemonpackages=exim4-daemon-custom in line 39 # # also after this line: # # cp EDITME.exim4-custom $(<D)/Local/Makefile # # which is line 229 when I did this, add this line to debian/rules # # cp EDITME.eximon $(<D)/Local/eximon.conf # $ vi debian/rules # Without this step, the following command doesn't work $ cp -a exim_monitor/EDITME EDITME.eximon $ fakeroot debian/rules pack-configs $ debuild -us -uc # # perhaps you get an error due to your changes # then you have to commit these changes before you can run the debuild command $ dpkg-source --commit $ debuild -us -uc
-
Now you should have the build packages:
$ ls -l ../ total 7968 drwxr-xr-x 16 root root 4096 Sep 9 22:08 exim4-4.86.2 -rw-r--r-- 1 root root 7914 Sep 9 22:09 exim4_4.86.2-2ubuntu2.5_all.deb -rw-r--r-- 1 root root 140620 Sep 9 22:09 exim4_4.86.2-2ubuntu2.5_amd64.build -rw-r--r-- 1 root root 5251 Sep 9 22:09 exim4_4.86.2-2ubuntu2.5_amd64.changes -rw-r--r-- 1 root root 452428 Sep 9 22:07 exim4_4.86.2-2ubuntu2.5.debian.tar.xz -rw-r--r-- 1 root root 2160 Sep 9 22:07 exim4_4.86.2-2ubuntu2.5.dsc -rw-r--r-- 1 root root 1799316 Mar 16 2016 exim4_4.86.2.orig.tar.bz2 -rw-r--r-- 1 root root 1061780 Sep 9 22:09 exim4-base_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 372138 Sep 9 22:09 exim4-config_4.86.2-2ubuntu2.5_all.deb -rw-r--r-- 1 root root 585558 Sep 9 22:09 exim4-daemon-custom_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 1370962 Sep 9 22:09 exim4-daemon-custom-dbg_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 540776 Sep 9 22:09 exim4-daemon-light_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 1214298 Sep 9 22:09 exim4-daemon-light-dbg_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 358268 Sep 9 22:09 exim4-dbg_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 89000 Sep 9 22:09 exim4-dev_4.86.2-2ubuntu2.5_amd64.deb -rw-r--r-- 1 root root 119946 Sep 9 22:09 eximon4_4.86.2-2ubuntu2.5_amd64.deb
-
Install it:
$ dpkg -i ../exim4-daemon-custom_4.86.2-2ubuntu2.5_amd64.deb
-
Remove the build-dependencies:
$ apt-get remove pbuilder devscripts dpatch grep-dctrl debhelper $ apt-get autoremove
Sources: