This session will cover a Hands-on to pack some small modules of nodejs for Debian and make a .deb out of it, I will also cover some tools like npm2deb and other tools like lintian.
2. Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
3.
4. Agenda
● What is meant by Debian packaging ?
● Packaging workflow
● How to get started.
- Requirements
● Packaging a simple Nodejs module
5. What is Debian packaging
We all do is sudo apt install <package name>
Wondered how apt install works and what file it fetches and how the file gets
auto installed ??
So , here comes the Debian Packaging task.
The aim of packaging is to allow the automation of installing, upgrading,
configuring, and removing computer programs for Debian in a consistent
manner.
To be simple , its like making .deb of any software or module like in windows we
have .exe file
6. The packaging work flow is usually like this:
● Step 1: Rename the upstream tarball
● Step 2: Unpack the upstream tarball
● Step 3: Add the Debian packaging files
● Step 4: Build the package
● Step 5: Install the package
Then you can test your package on your computer.
Packaging workflow
7. What are we going to do Today ?
So Today , we will be focusing on learning the basic structure of packages as
well as knowing the tools used for this purpose.
A handson of making a package from scratch .
I will be using a simple nodejs module for the work today.
Enough of this knowledge , get me to the coding part and lets do the
packaging
8. Requirements
So , To start with Debian packaging , we need a Debian SID environment .
I have an ubuntu/arch/gentoo/mac machine and installing another OS , nah , not ready for a new
OS - its that's what you are thinking now , don’t worry we have Docker , lxc or virtual machine for
you .
Today i will be using Docker container to do the same.
Install packaging tools inside the container
dh-make-golang ,gem2deb ,npm2deb (These tools depend on module to module which we want to
package , But dh-make is a generic one)
Essential tools :-
git-buildpackage ,sbuild ,dh-buildinfo, quilt,
9. installation of Docker SID environment
Pull Debian Sid image from docker hub using the following command docker pull debian:sid
Create a container with it and start bash on it using docker run - -privileged - -name “sid” -it
debian:sid /bin/bash
Update and upgrade to latest versions of packages using apt-get update && apt-get upgrade
If you need to connect to it later, use the following commands which will take you to the bash
prompt.
“sudo docker start sid && sudo docker attach sid”