Differences between revisions 1 and 79 (spanning 78 versions)
Revision 1 as of 2011-02-06 14:17:09
Size: 1001
Comment:
Revision 79 as of 2021-01-22 11:36:02
Size: 3204
Comment: Add parameter in case of build error
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Simple Backport Creation = #language en
##
~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: English - [[es/SimpleBackportCreation|Español]] - [[fr/SimpleBackportCreation|Français]] - [[it/SimpleBackportCreation|Italiano]] - [[ru/SimpleBackportCreation|Русский]] -~
----
Line 3: Line 6:
Here we takes the example of the package libmpfr1ldbl, whihc exists in Debian Sid, but not in the stable release. Please keep in mind that this is meant as a quick howto for how to build private backports and is not the way we expect from official backports for [[https://backports.debian.org/|backports.debian.org]]. For official backports, see [[BuildingFormalBackports|this wiki page]].
Line 5: Line 8:
We don't need to be root ! Here we take the example of the package coreutils, from which we want to install a newer release availaible in testing. If the package you're looking for not available in Testing, but in a Ubuntu PPA, you can have a look at [[CreatePackageFromPPA]].
Line 7: Line 10:
1. Download the .dsc file from the sid release We don't need to be root here except the first and last steps.

<<TableOfContents()>>

===== Install Debian packaging tools =====
Line 9: Line 17:
dget http://ftp.de.debian.org/debian/pool/main/m/mpfr/mpfr_2.4.2-3.dsc sudo apt-get install packaging-dev debian-keyring devscripts equivs
Line 11: Line 19:
1. Install dependencies as found in debian/control
===== Find out which version is available in the Debian archive =====
Line 13: Line 23:
cd mpfr-2.4.2
grep Build-Depend debian/control
Build-Depends: debhelper (>= 7), libgmp3-dev (>= 4.2.dfsg)
Build-Depends-Indep: texinfo, texlive-latex-base
sudo apt-get install debhelper libgmp3-dev texinfo texlive-latex-base
$ rmadison coreutils --architecture amd64
coreutils | 8.23-4 | oldstable | amd64
coreutils | 8.26-3 | stable | amd64
coreutils | 8.30-3 | testing | amd64
coreutils | 8.30-3 | unstable | amd64
Line 19: Line 29:
# Test if we can build successfully the package ===== Add source package entries for the testing distribution =====

Add a testing '''deb-src''' entries to your [[SourcesList|apt sources]]:

{{{
# Debian testing packages sources
deb-src http://deb.debian.org/debian/ testing main
}}}

Update your packages index:

{{{
apt update
}}}

Download the package source:

{{{
apt source coreutils/testing
}}}

===== Install build dependencies =====

{{{
cd coreutils-*/
sudo mk-build-deps --install --remove
}}}

This will install a package named `coreutils-build-deps` depending on the listed build dependencies. If you remove this package later, the actual build dependencies will be marked as "automatically installed and no longer needed" and can be cleared with `apt autoremove`.

===== Indicate in the changelog a backport revision number =====

{{{
dch --bpo
}}}

This will add something like '''''~bpo9+''''' to the package version number.
The tilde ~ makes the package inferior in version, which should allow a proper package upgrade when you upgrade to the next Debian release (i.e. your package will be replaced with the official Debian package).

===== Test if we can successfully build the package =====
Line 22: Line 72:
....
....
loads of output
....
....
Line 29: Line 74:
# Build a pacakge properly , without GPG signing the resulting binary and the resulting .changes file If this should fail with a missing file, [[apt-file]] may be useful in locating the dependency you require.

===== Build a package properly , without GPG signing the package =====
Line 32: Line 80:
....
....
loads of output
....
....
Line 39: Line 82:
# Install and enjoy ! ===== In case of build error, use the following command: =====
Line 41: Line 84:
sudo dpkg -i ../libmpfr1ldbl_2.4.2-3_amd64.deb dpkg-buildpackage -b -us -uc
Line 43: Line 86:

===== Install and enjoy! =====

{{{
sudo apt install ../coreutils_*_*.deb
}}}

===== Go further =====

You could have a look [[BuildingFormalBackports]] and contribute your backport to Debian as explained here: http://backports.debian.org/Contribute/

----

CategoryPackaging

Translation(s): English - Español - Français - Italiano - Русский


Please keep in mind that this is meant as a quick howto for how to build private backports and is not the way we expect from official backports for backports.debian.org. For official backports, see this wiki page.

Here we take the example of the package coreutils, from which we want to install a newer release availaible in testing. If the package you're looking for not available in Testing, but in a Ubuntu PPA, you can have a look at CreatePackageFromPPA.

We don't need to be root here except the first and last steps.

Install Debian packaging tools

sudo apt-get install packaging-dev debian-keyring devscripts equivs

Find out which version is available in the Debian archive

$ rmadison coreutils --architecture amd64
coreutils  | 8.23-4        | oldstable  | amd64
coreutils  | 8.26-3        | stable     | amd64
coreutils  | 8.30-3        | testing    | amd64
coreutils  | 8.30-3        | unstable   | amd64

Add source package entries for the testing distribution

Add a testing deb-src entries to your apt sources:

# Debian testing packages sources
deb-src http://deb.debian.org/debian/ testing main

Update your packages index:

apt update

Download the package source:

apt source coreutils/testing

Install build dependencies

cd coreutils-*/
sudo mk-build-deps --install --remove

This will install a package named coreutils-build-deps depending on the listed build dependencies. If you remove this package later, the actual build dependencies will be marked as "automatically installed and no longer needed" and can be cleared with apt autoremove.

Indicate in the changelog a backport revision number

dch --bpo

This will add something like ~bpo9+ to the package version number. The tilde ~ makes the package inferior in version, which should allow a proper package upgrade when you upgrade to the next Debian release (i.e. your package will be replaced with the official Debian package).

Test if we can successfully build the package

fakeroot debian/rules binary

If this should fail with a missing file, apt-file may be useful in locating the dependency you require.

Build a package properly , without GPG signing the package

dpkg-buildpackage -us -uc

In case of build error, use the following command:

dpkg-buildpackage -b -us -uc

Install and enjoy!

sudo apt install ../coreutils_*_*.deb

Go further

You could have a look BuildingFormalBackports and contribute your backport to Debian as explained here: http://backports.debian.org/Contribute/


CategoryPackaging