...
How to port a new package
1) Choose a package you want to port. For example, apache2. Go to the debian packages page at https://packages.debian.org/buster-backports/apache2 and copy the correct name of the source package in the right column ("Download Source Package apache2:"). Remember (or copy) "apache2". Install additional packages to manipulate the source code:
Code Block | ||
---|---|---|
| ||
du3p03% sudo apt-get install dpkg-dev Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: binutils libdpkg-perl make patch Suggested packages: binutils-doc debian-keyring gcc | c-compiler bzr make-doc ed diffutils-doc Recommended packages: build-essential gcc | c-compiler fakeroot libalgorithm-merge-perl libfile-fcntllock-perl liblocale-gettext-perl The following NEW packages will be installed: binutils dpkg-dev libdpkg-perl make patch 0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded. Need to get 6277 kB of archives. After this operation, 46.4 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 https://apt2.dilos.org/dilos du3-unstable/main solaris-i386 binutils solaris-i386 2.31.1-1+dilos3 [4409 kB] Get:2 https://apt2.dilos.org/dilos du2-unstable/main solaris-i386 libdpkg-perl all 1.19.7+dilos5 [706 kB] Get:3 https://apt2.dilos.org/dilos du2-unstable/main solaris-i386 patch solaris-i386 2.7.6-3+dilos1 [137 kB] Get:4 https://apt2.dilos.org/dilos du2-unstable/main solaris-i386 make solaris-i386 4.1-9.1-2+dilos2 [316 kB] Get:5 https://apt2.dilos.org/dilos du2-unstable/main solaris-i386 dpkg-dev all 1.19.7+dilos5 [708 kB] Fetched 6277 kB in 8s (740 kB/s) Selecting previously unselected package binutils. (Reading database ... 15551 files and directories currently installed.) Preparing to unpack .../binutils_2.31.1-1+dilos3_solaris-i386.deb ... Unpacking binutils (2.31.1-1+dilos3) ... Selecting previously unselected package libdpkg-perl. Preparing to unpack .../libdpkg-perl_1.19.7+dilos5_all.deb ... Unpacking libdpkg-perl (1.19.7+dilos5) ... Selecting previously unselected package patch. Preparing to unpack .../patch_2.7.6-3+dilos1_solaris-i386.deb ... Unpacking patch (2.7.6-3+dilos1) ... Selecting previously unselected package make. Preparing to unpack .../make_4.1-9.1-2+dilos2_solaris-i386.deb ... Unpacking make (4.1-9.1-2+dilos2) ... Selecting previously unselected package dpkg-dev. Preparing to unpack .../dpkg-dev_1.19.7+dilos5_all.deb ... Unpacking dpkg-dev (1.19.7+dilos5) ... Setting up binutils (2.31.1-1+dilos3) ... Setting up make (4.1-9.1-2+dilos2) ... Setting up patch (2.7.6-3+dilos1) ... Setting up libdpkg-perl (1.19.7+dilos5) ... Setting up dpkg-dev (1.19.7+dilos5) ... Processing triggers for install-info (6.5.0.dfsg.1-1+dilos1) ... du3p03% |
2) Now download the source code into your build environment:
Code Block | ||||
---|---|---|---|---|
| ||||
du3p03% apt-get source apache2 Reading package lists... Done NOTICE: 'apache2' packaging is maintained in the 'Git' version control system at: https://salsa.debian.org/apache-team/apache2.git Please use: git clone https://salsa.debian.org/apache-team/apache2.git to retrieve the latest (possibly unreleased) updates to the package. Need to get 10.4 MB of source archives. Get:1 http://mirrors.edge.kernel.org/debian buster-backports/main apache2 2.4.43-1~bpo10+1 (dsc) [3530 B] Get:2 http://mirrors.edge.kernel.org/debian buster-backports/main apache2 2.4.43-1~bpo10+1 (tar) [9348 kB] Get:3 http://mirrors.edge.kernel.org/debian buster-backports/main apache2 2.4.43-1~bpo10+1 (asc) [488 B] Get:4 http://mirrors.edge.kernel.org/debian buster-backports/main apache2 2.4.43-1~bpo10+1 (diff) [1015 kB] Fetched 10.4 MB in 6s (1660 kB/s) dpkg-source: info: extracting apache2 in apache2-2.4.43 dpkg-source: info: unpacking apache2_2.4.43.orig.tar.gz dpkg-source: info: unpacking apache2_2.4.43-1~bpo10+1.debian.tar.xz dpkg-source: info: using patch list from debian/patches/series dpkg-source: info: applying fhs_compliance.patch dpkg-source: info: applying no_LD_LIBRARY_PATH.patch dpkg-source: info: applying suexec-CVE-2007-1742.patch dpkg-source: info: applying customize_apxs.patch dpkg-source: info: applying build_suexec-custom.patch dpkg-source: info: applying reproducible_builds.diff dpkg-source: info: applying buffer-http-request-bodies-for-tlsv13.diff dpkg-source: info: applying tlsv13-add-logno.diff du3p01% |
3) Now we can port the package. First of all you should install (possible) all dependencies to build the package. At this stage the build system does now know anything about dependencies, install them manually:
Code Block | ||
---|---|---|
| ||
du3p01% cd apache2-2.4.43 du3p01% dpkg-checkbuilddeps dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 10) bison jdupes libapr1-dev (>= 1.6.0) libaprutil1-dev (>= 1.6.0) libbrotli-dev liblua5.2-dev libnghttp2-dev libpcre3-dev libssl-dev (>= 1.1.1) libxml2-dev lsb-release zlib1g-dev libcurl4-openssl-dev | libcurl4-dev libjansson-dev |
4) Now you can try to install them:
...
Code Block | ||
---|---|---|
| ||
du3p03% date -R Mon, 10 Aug 2020 12:06:57 +0300 |
The file is ready and we're preparing next file...
debian/control
This file is used to specify dependencies o build the package(sAlso you can use the template created by gmake debgenlog command, go to your local copy of the du3 repository, and than components/<any_component> (apt for example):
Code Block | ||
---|---|---|
| ||
Build-Depends: debhelper-compat (= # cd <path_to_du3>/du3/components/apt # gmake debgenlog /ws/home/akozlov/du3/tools/deb_gen_log.pl dummy (1.2.3.4) unstable; urgency=low * build for dilos -- DilOS Team <dilos@dilos.org> Sun, 31 Jan 2021 22:08:33 +0300 |
Here you just need to change name and version of the component.
The file is ready and we're preparing next file...
debian/control
This file is used to specify dependencies o build the package(s):
Code Block | ||
---|---|---|
| ||
Build-Depends: debhelper-compat (= 13) |
You see it ad check stage.
...
If we install the package as is (in the current environment) the BASEDIR is "/" and we just clear it.
quilt patch
If during the porting process you need to change something outside the debian folder, then these changes must be placed in the dilos.patch:
Code Block |
---|
# quilt new dilos.patch
# quilt add <modifying_file>
# quilt refresh |
du3/components/<package>
When the porting has done and all packages built you should place it into the du3 repo. Create a directory (usualy by the source package name), in our examples it is apache2 and/or jdupes.
...