Manchmal gibt es debian Pakete nur als Quellen. Um diese dennoch innerhalb der Paketierung zu installieren, ist es notwendig, das debian-Package selbst zu erstellen. Das Tool der Wahl ist apt-build.
apt-build Environment herstellen
apt-get update apt-cache show apt-build Package: apt-build Priority: optional Section: devel Installed-Size: 188 Maintainer: Julien Danjou <acid@debian.org> Architecture: i386 Version: 0.12.17 Depends: perl, apt (>= 0.5), gcc, g++, dpkg-dev (>= 1.9), libappconfig-perl (>= 1.5), libapt-pkg-perl (>= 0.1.11), debconf | debconf-2.0, devscripts, apt-utils Recommends: fakeroot, build-essential Conflicts: pentium-builder Filename: pool/main/a/apt-build/apt-build_0.12.17_i386.deb Size: 33968 MD5sum: 2626afa0a3f202203aa03d41efb90dd9 SHA1: 433fa4ccddef590b3e4b3187e36c41b2a708fb68 SHA256: 2c7654927fd264e36f60afd27330f59b5cd813bbf02cdb77bf4c8bb5a1d0d467 Description: frontend to apt to build, optimize and install packages This is an apt-get front-end for compiling software optimized for your architecture by creating a local repository with built packages. It can manage system upgrades too. Tag: admin::package-management, devel::debian, devel::packaging, interface::commandline, made-of::lang:perl, role::sw:utility, suite::debian, works-with::software:package, works-with::software:source apt-get install apt-build
apt-build nutzt die Konfigurationsdatei /etc/apt/apt-build.conf mit folgendem (oder ähnlichem) Inhalt, die Werte werden während der Installation/ des Compile-Prozesses des Paketes verwendet.
apt-build.conf
build-dir = /var/cache/apt-build/build repository-dir = /var/cache/apt-build/repository Olevel = -O3 march = -march=pentium2 mcpu = -mcpu=pentium2 options =
Die Datei /etc/apt/sources.list muß einen Eintrag enthalten, der auf ein entsprechendes Repository zeigt, aus dem die Quellen der Debian Pakete bezogen werden können. Beispielsweise
deb-src ftp://ftp.debian.org/debian/ stable main contrib
Der Eintrag für das lokale apt-build Repository mit den optimierten Paketen auf dem eigenen System sieht so aus
deb file:/var/cache/apt-build/repository apt-build main
Der Quellcode soll gemäß der /etc/apt/sources.list geholt und anschließend der build-Prozess angestoßen werden.
apt-build für ein Paket
apt-build build-source libpam_abl
→ Ausgabe: build_libpam_abl.txt
Manchmal kann es sein, dass ein Paket nur im unstable Tree der debian Distribution enthalten ist. Um nicht das ganze System aktualisieren zu müssen, und noch mehr unstable Pakete zu installieren, funktioniert folgender Befehl.
nur ein paket aus unstable installieren
apt-get -t unstable install apt-build
Für apt-build ist es zwingend notwendig, dies durchzuführen, da die stable-Version 0.11.X folgende Fehler beim build-source herauswirft. →
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=301759
errors bei apt-build build-source
# apt-build build-source libpam-abl
Building the following packages from source:
libpam-abl
-----> Installing build dependencies (for libpam-abl) <-----
Reading Package Lists... Done
Building Dependency Tree... Done
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
W: Unable to locate package libpam-abl
E: No packages found
-----> Downloading libpam-abl source (libpam-abl 0.2.2-1) <-----
-----> Updating package lists <-----
...
Need to get 32.2kB of source archives.
Get:1 http://mentors.debian.net unstable/main libpam-abl 0.2.2-1 (dsc) [619B]
Get:2 http://mentors.debian.net unstable/main libpam-abl 0.2.2-1 (tar) [21.5kB]
Get:3 http://mentors.debian.net unstable/main libpam-abl 0.2.2-1 (diff) [10.0kB]
Fetched 3B in 0s (8B/s)
Skipping unpack of already unpacked source in libpam-abl-0.2.2
-----> Building libpam-abl <-----
E: Couldn't find package libpam-abl
W: Unable to locate package libpam-abl
E: No packages found
Use of uninitialized value in string eq at /usr/bin/apt-build line 288.
Use of uninitialized value in string eq at /usr/bin/apt-build line 288.
Use of uninitialized value in concatenation (.) or string at /usr/bin/apt-build line 299.
Use of uninitialized value in concatenation (.) or string at /usr/bin/apt-build line 299.
E: Unable to find a source package for
Use of uninitialized value in concatenation (.) or string at /usr/bin/apt-build line 301.
Use of uninitialized value in concatenation (.) or string at /usr/bin/apt-build line 301.
Can't chdir(-): No such file or directory at (eval 1) line 3
main::__ANON__('-') called at /usr/bin/apt-build line 301
main::build('libpam-abl', 0.2.2, -1) called at /usr/bin/apt-build line 563
main::build_source called at /usr/bin/apt-build line 81