An Easy to Use Boilerplate 'debuild' Project

DevOps Engineer | Kubernetes | Python | Terraform | AWS | GCP
"dpkg-deb-boilerplate" is an easy to use boilerplate debuild project for building debian package using Lanuchpad or other services.
Why do I need it? Isn't dpkg --build dirname enough?
dpkg --build dirname is good, but debian packaging policy provides a solid build system to easily install application binaries, libraries, service scripts, launchers, manuals etc. Also for automated build systems like ubuntu launchpad or opensuse build service you need to provide a source archive, not prebuild binaries. This boilerplate might come handy in such circumstance.
What do I need to make it working?
Install build-essentials which will automatically install make, gcc, g++, dpkg-dev etc. packages.
How do I make it working?
- Download the repository.
cdtoproject-1.0directory and rundpkg-buildpackage -us -uc.- Several files including
project_1.0_amd64.debwill be built at parent directory.
So, how does it work actually?
Basically the boilerplate does
- Compile and build a demo library and executable from source, and install them to
builddirectory. - Debian packaging system takes the files from
builddirectory, and packs them intodebfile.
Umm, can you be more specific?
src/projectcontains the source. Runningmake -c src/projectbuildsproject,project.handlibproject.so. Thenmake -c src/project installcopies them tobuilddirectory.debian/rulescreates a shadow directory tree underdebian/project, and copies files frombuildto there.debian/controlis used to specify package name, architecture, dependecy, version, maintainer etc inforamtion.postrmis used to cleanup when package is uninstalled.postinstis used to reload library database after install (helps the commandprojecteasily findlibproject.so.
Can I add my own init.d script, launcher icon, manual pages etc?
Yup, you surely can. Check out Debian Policy Manual and you are good to go.




