dpkg og apt til å tro at noen pakker er installert, selv om det bare er et tomt skall. Dette tillater tilfredsstilling av avhengigheter i en pakke når den tilsvarende programvaren ble installert utenfor rammen av pakkesystemet. En slik metode fungerer, men bør likevel unngås når det er mulig, ettersom det ikke er noen garanti for at den manuelt installerte programvaren oppfører seg akkurat som den tilsvarende pakken ville ha gjort, og andre pakker som er avhengig av den, ikke vil fungere ordentlig.
equivs-control and equivs-build commands in the equivs package. The equivs-control file command creates a Debian package header file that should be edited to contain the name of the expected package, its version number, the name of the maintainer, its dependencies, and its description. Other fields without a default value are optional and can be deleted. The Copyright, Changelog, Readme and Extra-Files fields are not standard fields in Debian packages; they only make sense within the scope of equivs-build, and they will not be kept in the headers of the generated package.
Eksempel 15.2. Topptekstfil for den falske pakken libxml-libxml-perl
Section: perl Priority: optional Standards-Version: 4.6.2 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 filen. Og plutselig er pakken opprettet i den gjeldende katalogen, og kan håndteres som enhver annen Debian-pakke ville blitt.
$equivs-build filedpkg-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_auto_install --destdir=debian/libxml-libxml-perl/ 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 -O../libxml-libxml-perl_2.0207-1_amd64.buildinfo dpkg-genchanges --build=binary -O../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 message above!
falcot-data-1.0 directory to contain the target source package. The package will, logically, be named falcot-data and bear the 1.0 version number. The administrator then places the document files in a data subdirectory. Then they invoke the dh_make command (from the dh-make package) to add files required by the package generation process, which will all be stored in a debian subdirectory:
$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 : Sun, 26 May 2024 21:48:41 +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 i debian/control). single er et alternativ, og fører til en enkelt binærpakke som er avhengig av målarkitekturen (Architecture: any). I dette tilfellet er valget mer relevant, siden pakken bare inneholder dokumentasjon, og ingen binære programmer, slik at den kan brukes enhver datamaskiner uavhengig av arkitektur.
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 field in debian/control.
copyright-filen må inneholde info om utviklerne av dokumenter som inkluderes i pakken, og relatert opphavsrett og lisens. I vår fall er dette interne dokumenter hvis bruk er begrenset til Falcot Corp-bedriften. Forvalgt format brukt for denne filen er definert i Format-feltet.
changelog-fil er vanligvis anvendbar; der man erstatter «opprinnelig utgave» med en mer sirlig forklaring og endring av distribusjonen fra UNRELEASED eller unstable til målutgivelsen er nok.
control-filen må også oppdateres: Section-feltet kan endres til misc og Homepage, Vcs-Git og Vcs-Browser-feltene fjernet. Depends-feltene ble fullført med firefox-esr | www-browser slik at det alltid finnes en nettleser for å vise dokumentene i pakken. Hvis pakken ikke trenger å kjøre noen kommandoer som root-bruker (sjekk VERKTØY fakeroot) så kan Rules-Requires-Root-feltet kan levnes som det er.
Eksempel 15.3. control-filen
Source: falcot-data
Section: misc
Priority: optional
Maintainer: Raphael Hertzog <hertzog@debian.org>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.6.2
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.
Eksempel 15.4. changelog-filen
falcot-data (1.0) bookworm; urgency=low
* Initial Release.
* Let's start with few documents:
- internal company structure;
- contacts for each department.
-- Raphael Hertzog <hertzog@debian.org> Sun, 26 May 2024 21:48:41 +0100
Eksempel 15.5. copyright-filen
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: falcot-data Files: * Copyright: 2004-2024 Falcot Corp License: All rights reserved.
rules inneholder vanligvis et sett med regler til å sette opp, bygge og installere programvaren i en egen underkatalog (oppkalt etter den genererte binære pakken). Innholdet i denne underkatalogen blir deretter arkivert i Debian-pakken som om det var roten i filsystemet. I vårt tilfelle vil filene bli installert i debian/falcot-data/usr/share/falcot-data/-undermappe, slik at å installere den genererte pakken, vil plassere filene under /usr/share/falcot-data/. Filen rules blir brukt som en Makefile, med noen få standard mål (medregnet clean og binary, respektivt brukt til å rydde opp i kildemappen og generere binærpakken).
debhelper-verktøyet. Slik er tilfellet for filer generert av dh_make. For å installere våre filer må vi ganske enkelt sette opp atferden til dh_install-kommandoen ved å lage den følgende debian/falcot-data.install-filen:
data/* usr/share/falcot-data/
falcot-data.desktop-file og får den installert i /usr/share/applications ved å legge til en andre linje til debian/falcot-data.install.
Eksempel 15.6. Filen 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 ser slik ut:
data/* usr/share/falcot-data/ falcot-data.desktop usr/share/applications/
dpkg-buildpackage -us -uc-kommandoen fra falcot-data-1.0-mappen.