Template:Build Documentation Build Package Easy

From Kicksecure
Revision as of 08:17, 18 November 2019 by imported>Patrick
Jump to navigation Jump to search


Get Build Dependencies

Update your package lists.

Click = Copy Copied to clipboard! sudo apt-get update

Install from Debian repository.

Click = Copy Copied to clipboard! sudo apt-get install build-essential devscripts git

Change Directory to Build Folder

This chapter is recommended for better usability, but is not strictly required. [1]

Create folder ~/{{{package}}}-build.

Click = Copy Copied to clipboard! mkdir -p ~/{{{package}}}-build

Change directory to folder ~/{{{package}}}-build.

Click = Copy Copied to clipboard! cd ~/{{{package}}}-build

Get the Source Code

Get the the package's source code.

Click = Copy Copied to clipboard! 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.

Click = Copy Copied to clipboard! cd {{{package}}}

Choose Version

Click = Copy Copied to clipboard! git checkout {{{version}}}

Build the Package

Click = Copy Copied to clipboard! 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.

Click = Copy Copied to clipboard! ls ../

Should show something like this.

lkrg lkrg_{{{version}}}-1_amd64.buildinfo lkrg_{{{version}}}-1_amd64.changes lkrg-dkms_{{{version}}}-1_amd64.deb

Installation

Click = Copy Copied to clipboard! 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.

Click = Copy Copied to clipboard! git clean -ffdn

Clean up temporary files debhelper files in package source folder. Actually remove.

Click = Copy Copied to clipboard! git clean -ffd

Remove .deb file etc. in parent folder.

TODO: document

  1. 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 ..archive.org iconarchive.today icon