Index ¦ Archives

Debian

The Debian Project is an association of individuals who have made common cause to create a free operating system. This operating system that we have created is called Debian.

An operating system is the set of basic programs and utilities that make your computer run. At the core of an operating system is the kernel. The kernel is the most fundamental program on the computer and does all the basic housekeeping and lets you start other programs.

Debian systems currently use the Linux kernel or the FreeBSD kernel. Linux is a piece of software started by Linus Torvalds and supported by thousands of programmers worldwide. FreeBSD is an operating system including a kernel and other software.

However, work is in progress to provide Debian for other kernels, primarily for the Hurd. The Hurd is a collection of servers that run on top of a microkernel (such as Mach) to implement different features. The Hurd is free software produced by the GNU project.

A large part of the basic tools that fill out the operating system come from the GNU project; hence the names: GNU/Linux, GNU/kFreeBSD, and GNU/Hurd. These tools are also free.

Of course, the thing that people want is application software: programs to help them get what they want to do done, from editing documents to running a business to playing games to writing more software. Debian comes with over 51000 packages (precompiled software that is bundled up in a nice format for easy installation on your machine), a package manager (APT), and other utilities that make it possible to manage thousands of packages on thousands of computers as easily as installing a single application. All of it free.

It's a bit like a tower. At the base is the kernel. On top of that are all the basic tools. Next is all the software that you run on the computer. At the top of the tower is Debian — carefully organizing and fitting everything so it all works together.

Environment

Install
# apt install debootstrap sbuild schroot blhc devscripts dh-make \
    git-buildpackage git sbuild-debian-developer-setup

# apt install autopkgtest blhc dput-ng how-can-i-help locales quilt \
    renameutils spell splitpatch gnupg tree wget neovim 
~/.bashrc
export DEFAULT_USER="d4n1"
export EDITOR="nvim"
export TERM="xterm-256color"
export DEBFULLNAME="Daniel Pimentel"
export DEBEMAIL="d4n1@d4n1.org"
export LANG=C.UTF-8
export LANGUAGE=C.UTF-8
export LC_ALL=C.UTF-8
export QUILT_PATCHES=debian/patches

Show my dotfiles.

~/.gitconfig
[user]
    name = Daniel Pimentel
    email = d4n1@d4n1.org
/etc/devscripts.conf
DEBSIGN_KEYID="D9F9EADD6F26AC782CFCD8317FECE9042C7BFD45"
DEBUILD_DPKG_BUILDPACKAGE_OPTS="-us -uc -I -i"
DEBUILD_LINTIAN_OPTS="-i -I --show-overrides"
/etc/lintianrc
display-info = yes
pedantic = yes
display-experimental = yes
color = auto
~/.quitrc
display-info = yes
pedantic = yes
display-experimental = yes
color = auto
Sbuild
# sbuild-debian-developer-setup

# sbuild-adduser $USER

cp /usr/share/doc/sbuild/examples/example.sbuildrc ~/.sbuildrc
~/.sbuildrc
$build_arch_all = 1;
$distribution = 'unstable';
$build_source = 1;
$source_only_changes = 1;
$clean_source = 0;
$run_lintian = 1;
$lintian_opts = ['--info', '--display-info'];
~/.gbp.conf
[DEFAULT]
builder = sbuild
pristine-tar = True
Sbuild test
# sbuild --dist=unstable hello
Schroot
schroot --all-sessions
schroot --end-session --all-sessions

Update Debian Package

Init
gbp clone git@salsa.debian.org:d4n1/[package].git
cd [package]
git remote add debian git@salsa.debian.org:debian/[package].git
Build
gbp buildpackage --git-debian-branch=[branch]
gbp import-orig --uscan
Update
git add [file]
git commit -m 'd/folder: message'
Changelog
gbp dch --commit --ignore-branch

or for QA:

gbp dch --commit --ignore-branch
dch
add '* QA upload.'.
git add debian/changelog
git commit --amend
Lintian
lintian -EvIL +pedantic
Push
gbp push --debian-tag=''

Patch

Gbp
gbp pq import 
git rebase master
gbp pq export

nvim [file]
git add [file]
git commit -m '[message]'

gbp pq export
git add [files]
git commit -m '[message]'


gbp pq import
gbp pq switch [patch]
git add [file]
git commit -m "[message]"
gbp pq export
Quilt
quilt applied
quilt series
quit push -a

quilt new [package.patch]
quilt add [file]
nvim [file]
quilt refresh
quilt applied

quilt pop -a

Update new version Upstream to Debian package

Fetch new upstream release
wget [repo]/[version].tar.gz -O ../[package]_[version].orig.tar.gz
Import new upstream version with gbp
gbp import-orig --pristine-tar ../[package]_[version].orig.tar.gz
Update changelog
dch -v [version]-1 "New upstream release."
Update changelog
git add debian/changelog
git commit -m 'd/changelog: Release [version]-1'
Apply patches
quilt push -a
quilt refresh
Build tha package
sbuild
gbp buildpackage --git-builder="sbuild -A -s"
Push changes
git push --all
git push --tags

Upstream New Package to Debian

Source Package
git clone [upstream]
Binary Package
 ar -x [package].deb
License
licensecheck --deb-machine --merge-licenses -r *
egrep -sriA25 '(copyright|public dom)'
egrep '(@|\[)' <changelog>
Make
dh_make -f ../upstream-1.0.tar.xz -c <license>
dh_make --createorig -c <license> -s -p <package_1.0>
Packaging
cd debian
mv compat <upstream>.* manpage.* menu.* post* pre* \
    README.* watch* *.docs /tmp
vim changelog copyright control rules source/format \
    tests/control watch
Build
gbp buildpackage --git-ignore-new --git-no-pristine-tar
sbuild

or

cd ..
mk-build-deps -i -r debian/control
debuild
Check
lintian -i
Scan
uscan
Hardening
blhc --all --debian <upstream.build>
Install
debi
CI
autopkgtest . -- null
Test
apt install cowbuilder
cowbuilder create
cowbuilder build <upstream.dsc>
Check
debdiff <upstream-1.dsc> <upstream-2.dsc>
Pristine-tar
git checkout -b pristine-tar
pristine-tar commit ../[package.tar.xz]
git push origin pristine-tar

Contribute

Open an issue on Devel Team and create a MR (Merge Request) on Debian Salsa from your fork (repo/branch) to debian/master and follow proccess.

As alternative you can to send your package to The Menthors:

dput mentors <upstream.changes>

Debian

© 2000-2022 by Daniel Pimentel (d4n1). Under MIT.