Template:Build Documentation Build Package Easy
Get Build Dependencies
Update your package lists.
sudo apt-get update
Install from Debian repository.
sudo apt-get install build-essential devscripts git
Get the Signing Key
Get the Signing Key
This chapter is recommended for better security, but it is not strictly required. (See Trust)
1. Download {{{fullname}}} OpenPGP key.
{{{link}}}
Note: If Kicksecure is already being used, this process can be simplified. See the footnotes. [1]
2. Store it as {{{shortname}}}.asc
.
3. Import the key.
gpg --import {{{shortname}}}.asc
4. Verify the key using this fingerprint.
gpg --fingerprint {{{longfingerprint}}}
The output should show.
{{{gpgfingerprintparam}}}
5. This only retrieves the signing key from one source. For better security, learn more about the Kicksecure Signing Key.
Change Directory to Build Folder
This chapter is recommended for better usability, but is not strictly required. [2]
Create folder ~/{{{package}}}-build
.
mkdir -p ~/{{{package}}}-build
Change directory to folder ~/{{{package}}}-build
.
cd ~/{{{package}}}-build
Get the Source Code
Get the the package's source code.
git clone https://github.com/Kicksecure/{{{package}}}.git
Remember it is Kicksecure, not kicksecure! If you are prompted for a username for github, it means you have mistyped the web address.
Change Directory to Source Code Folder
Get into the package's source code folder because later on package build commands are expected to be run from the root of the source folder.
cd {{{package}}}
OpenPGP Verify the Source Code
OpenPGP Verify the Source Code
This chapter is recommended for better security, but is not strictly required.[3]
Retrieve a list of available git tags.
git --no-pager tag
Verify the tag you want to build. Replace it with the tag chosen to build.
git tag -v {{{version}}}
The output should look similar to this.
object 1844108109a5f2f8bddcf2257b9f3675be5cfb22 type commit tag {{{version}}} tagger Patrick Schleizer <adrelanos@whonix.org> 1392320095 +0000 . gpg: Signature made Thu 13 Feb 2014 07:34:55 PM UTC using RSA key ID 77BB3C48 gpg: Good signature from "Patrick Schleizer <adrelanos@whonix.org>" [ultimate]
The warning.
gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner.
Is explained on the Kicksecure Signing Key page and can be safely ignored.
Choose Version
1. Retrieve a list of available git tags.
git --no-pager tag
2. Use git checkout to select the preferred version to build.
Note: Replace {{{version}}}
with the actual version chosen for the build: the stable, testers-only or developers version. Common sense is required when choosing the right version number. For example, the latest available version number is not necessarily the most stable or suitable. Follow the Kicksecure News Blog as it might contain information.
git checkout {{{version}}}
3. Digital signature verification.
Optional. If you choose to perform digital signature verification above, you could verify the currently chosen commit ("HEAD
") yet again for extra security.
git verify-commit HEAD
4. Done.
Version selection has been completed.
Build the Package
dpkg-buildpackage -b
Build Result
When a package is build using dpkg-buildpackage
the resulting packages will be created in the parent folder. I.e. in this case in the ~/{{{package}}}-build
folder.
ls ../
Should show something like this.
lkrg lkrg_{{{version}}}-1_amd64.buildinfo lkrg_{{{version}}}-1_amd64.changes lkrg-dkms_{{{version}}}-1_amd64.deb
Installation
sudo dpkg -i ../lkrg-dkms_{{{version}}}-1_amd64.deb
Clean Up
Clean up temporary files debhelper files in package source folder. Show files to remove.
git clean -ffdn
Clean up temporary files debhelper files in package source folder. Actually remove.
git clean -ffd
Remove .deb file etc. in parent folder.
TODO: document
- ↑ Steps 1-3 can be completed with just one command. gpg --import /usr/share/whonix/whonix-keys.d/derivative.asc
- ↑
When a package is build using
dpkg-buildpackage
the resulting packages will be created in the parent folder. It's better for usability if this is not the user's home folder since many other files may already reside there. Thereby making the build result files more difficult to find or delete. This is a missing Debian feature. See: dpkg-buildpackage: support output directory other than .. - ↑ See Trust.