Build from Source: The Toolchain, Source Repository, User Privilege, Build Directory, Example, Download Source, Build Source, Examine Directory, Install Result
Developer Script: debcheckout, Build Dependency, Build Package, Lintian, Source Compile, debi, Deb Checksums, Show Source
Conclusion
Build from Source
APT has the capability to build the source code,
not just download the package.
I actually have cover this last year.
I just need to recompile the material,
to fit this package management (in docker) series articles.
Preparing the toolchain is as simply as install apt-src.
What you need to know is,
this toolchain is a lot of packages in number as this message said
“_ 10 upgraded, 80 newly installed_ “, “ Need to get 145 MB of archives “.
Source Repository
Make sure that source repository
is enabled in your /etc/apt/sources.list.
Add the deb-src and apt-src update.
Now sources.list
seems like an appropriate name.
User Privilege
Build require regular user, non root one. Consider make one first.
If you wish you can also setup sudoers.
Build Directory
Make any directory as a working directory
for your compilation process
Example
Again, consider apt package as our guinea pig example.
Simply issue one of this command below to check package version.
It is going to be a good idea to upgrade system
to latest version to avoid missing libraries.
Since we are going to modify system package, this is a must do part.
Or you may end up with something similar as message below
Download Source
Building a package could be as simple as this.
This above is the most important part of the process.
You can also unbundling this process into two steps.
The first one, will also install the needed package,
such as code and al its dependencies.
Now we have this files our working directory.
Build Source
Consider Build the package. Let’s do it.
This is the most interesting part.
This is going to takes time.
Examine Directory
Check your directoy,
your apt_1.5~rc1_amd64.deb package should already be there.
Install Result
Install package using dpkg command
Does it work?
You can check your apt version now
After a few days, you will feels like compiling is not difficult.
Developer Script
There are other way though,
more elegant to build package from source.
If you are a developer there are few goodies
you can have from devscripts.
Note that as usual, consider be as user and enable source repository.
debi
debcheckout
debcheckout
Or
Or
Build Dependency
Or:
Build Package
Go to build tree directory first.
And you will have the result similar as below:
Lintian
Check for possible issue.
Source Compile
This is even shorter.
Debi
Debuild
debuild is a convenient way,
if you want to build your own package.
Since we do not have our very own source,
consider use the newly downloaded herbstluftwm.
Go to build directory first.
Of course we do not have secret key for herbstuftwm.
This is a part of Debian security model.