dpkg dan apt sehingga percaya bahwa paket terpasang biarpun hanya berupa cangkang kosong. Hal ini memungkinkan memenuhi dependensi dari paket saat perangkat lunak terkait terpasang di luar ruang lingkup sistem pemaketan. Metode seperti ini bekerja, namun sedapat mungkin dihindari, karena tidak ada jaminan bahwa perangkat lunak yang terpasang berperilaku persis seperti paket terkait dan paket lainnya yang tergantung padanya tidak bekerja sebagaimana mestinya.
equivs-control dan equivs-build(dalam paket equivs). Perintah equivs-control berkas membuat berkas header paket Debian yang harus disunting agar memuat nama dari paket yang diinginkan, nomor versinya, nama dari maintainer, dependensi, dan deskripsinya. Field lainnya tanpa nilai default adalah opsional dan dapat dihapus. Field Copyright, Changelog, Readme dan Extra-Files bukan merupakan field standar dalam paket Debian; mereka hanya relevan dalam ruang lingkup equivs-build, dan mereka tidak akan disimpan dalam header dari paket yang dihasilkan.
Contoh 15.2. Berkas header dari libxml-libxml-perl paket palsu
Section: perl Priority: optional Standards-Version: 4.5.1 Package: libxml-libxml-perl Version: 2.0207-1 Maintainer: Raphael Hertzog <hertzog@debian.org> Depends: libxml2 (>= 2.9.10) Architecture: all Description: Fake package - module manually installed in site_perl This is a fake package to let the packaging system believe that this Debian package is installed. . In fact, the package is not installed since a newer version of the module has been manually compiled & installed in the site_perl directory.
equivs-build berkas. Voilà: paket dibuat pada direktori saat ini dan dapat dapat ditangani sebagaimana paket Debian lainnya.
$equivs-build fileequivs-build control dpkg-buildpackage: info: source package libxml-libxml-perl dpkg-buildpackage: info: source version 2.0207-1 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Raphael Hertzog <hertzog@debian.org> dpkg-buildpackage: info: host architecture amd64 dpkg-source --before-build . debian/rules clean dh clean dh_clean debian/rules binary dh binary dh_update_autotools_config dh_autoreconf create-stamp debian/debhelper-build-stamp dh_prep dh_install dh_installdocs dh_installchangelogs dh_perl dh_link dh_strip_nondeterminism dh_compress dh_fixperms dh_missing dh_installdeb dh_gencontrol dh_md5sums dh_builddeb dpkg-deb: building package 'libxml-libxml-perl' in '../libxml-libxml-perl_2.0207-1_all.deb'. dpkg-genbuildinfo --build=binary dpkg-genchanges --build=binary >../libxml-libxml-perl_2.0207-1_amd64.changes dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) The package has been created. Attention, the package has been created in the current directory, not in ".." as indicated by the messaige above!
falcot-data-1.0 berisi target dari paket sumber. Paket secara logika akan dinamakan falcot-data dan dengan nomor versi 1.0. Administrator selanjutnya meletakkan berkas dokumen dalam subdirektori data. Lalu mereka meng-invoke perintah dh_make (dari paket dh-make) untuk menambah berkas yang dibutuhkan oleh proses pembuatan paket, yang akan disimpan dalam subdirektori debian:
$cd falcot-data-1.0$dh_make --nativeType of package: (single, indep, library, python) [s/i/l/p]?iMaintainer Name : Raphael Hertzog Email-Address : hertzog@debian.org Date : Sat, 26 Feb 2021 13:02:06 +0100 Package Name : falcot-data Version : 1.0 License : gpl3 Package Type : indep Are the details correct? [Y/n/q] Currently there is not top level Makefile. This may require additional tuning Done. Please edit the files in the debian/ subdirectory now. $
Architecture: all in debian/control). single acts as a counterpart, and leads to a single binary package that is dependent on the target architecture (Architecture: any). In this case, the former choice is more relevant since the package only contains documents and no binary programs, so it can be used similarly on computers of all architectures.
dh_make command created a debian subdirectory with many files. Some are required, in particular rules, control, changelog and copyright. Files with the .ex extension are example files that can be used by modifying them (and removing the extension) when appropriate. When they are not needed, removing them is recommended. The compat file is not used nor created anymore. Instead of defining the debhelper compatibility level as a number in this file, it is now defined as a build-dependency on the debhelper-compat virtual package in the Build-Depends file in debian/control.
copyright file must contain information about the authors of the documents included in the package, and the related copyright and license. In our case, these are internal documents and their use is restricted to within the Falcot Corp company. The default format used for this file is defined in the Format field.
changelog file is generally appropriate; replacing the “Initial release” with a more verbose explanation and changing the distribution from UNRELEASED or unstable to the target release name is enough.
control file must also be updated: the Section field can be changed to misc and the Homepage, Vcs-Git and Vcs-Browser fields were removed. The Depends fields was completed with firefox-esr | www-browser so as to ensure the availability of a web browser able to display the documents in the package. If the package does not require to run any commands as root (see PERKAKAS fakeroot), the Rules-Requires-Root field can be left as is.
Contoh 15.3. Berkas control
Source: falcot-data
Section: misc
Priority: optional
Maintainer: Raphael Hertzog <hertzog@debian.org>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.5.1
Rules-Requires-Root: no
Package: falcot-data
Architecture: all
Depends: firefox-esr | www-browser, ${misc:Depends}
Description: Internal Falcot Corp Documentation
This package provides several documents describing the internal
structure at Falcot Corp. This includes:
- organization diagram
- contacts for each department.
.
These documents MUST NOT leave the company.
Their use is INTERNAL ONLY.
Contoh 15.4. Berkas changelog
falcot-data (1.0) bullseye; urgency=low
* Initial Release.
* Let's start with few documents:
- internal company structure;
- contacts for each department.
-- Raphael Hertzog <hertzog@debian.org> Sat, 26 Feb 2022 15:12:06 +0100
Contoh 15.5. Berkas copyright
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: falcot-data Files: * Copyright: 2004-2021 Falcot Corp License: All rights reserved.
rules umumnya berisi sekumpulan rules yang digunakan untuk meng-konfigurasi, build dan install perangkat lunak dalam subdirektori terdedikasi (dinamakan setelah paket binari dihasilkan). Isi dari subdirektori ini selanjutnya diarsipkan dalam paket Debian seolah sebagai root dari filesystem. Dalam kasus kami, berkas akan di-install dalam subdirektori debian/falcot-data/usr/share/falcot-data/, jadi meng-install paket yang dihasilkan akan men-deploy berkas di bawah /usr/share/falcot-data/. Berkas rules digunakan sebagai Makefile, dengan beberapa target standar (termasuk clean dan binary, digunakan untuk membersihkan direktori sumber dan menghasilkan paket binari).
debhelper. Sebagai contoh dalam kasus untuk berkas yang dihasilkan oleh dh_make. Untuk menginstall berkas, kita hanya perlu mengkonfigurasi perilaku dari perintah dh_install dengan membuat berkas berikut debian/falcot-data.install:
data/* usr/share/falcot-data/
falcot-data.desktop dan meletakkannya di /usr/share/applications dengan menambahkan baris kedua pada debian/falcot-data.install.
Contoh 15.6. Berkas falcot-data.desktop
[Desktop Entry] Name=Internal Falcot Corp Documentation Comment=Starts a browser to read the documentation Exec=x-www-browser /usr/share/falcot-data/index.html Terminal=false Type=Application Categories=Documentation;
debian/falcot-data.install terlihat seperti ini:
data/* usr/share/falcot-data/ falcot-data.desktop usr/share/applications/
dpkg-buildpackage -us -uc dari direktori falcot-data-1.0.