dpkg
e o apt
para acreditarem que algum pacote está instalado mesmo que em realidade seja apenas uma caixa vazia. Isto permite satisfazer dependências num pacote quando o programa correspondente foi instalado fora do escopo do sistema de pacotes. Este método funciona, porém deve mesmo assim ser evitado sempre que possível, já que não existem garantias de que o programa instalado manualmente se comportará exatamente como o pacote correspondente faria e outros pacotes dependentes dele podem não funcionar corretamente.
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.
Exemplo 15.2. Arquivo de cabeçalho do pacote falso 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 arquivo
. Voilà: o pacote foi criado no diretório atual e pode ser manejado como qualquer outro pacote Debian seria.
$
equivs-build file
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_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 --native
Type of package: (single, indep, library, python) [s/i/l/p]?
i
Maintainer 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. $
Arquitetura: all
em debian/control
). single atua como contraparte, e leva a um único pacote binário que é dependente da arquitetura alvo ( Arquitetura: any
). Neste caso, a primeira escolha é mais relevante uma vez que o pacote contém apenas os documentos e não programas binários, para que possa ser usado de forma semelhante em computadores de todas as arquiteturas.
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
deve conter informações sobre os autores dos documentos incluídos no pacote e os respectivos direitos autorais e licença. No nosso caso, esses são documentos internos e seu uso é restrito à empresa Falcot Corp. O formato padrão usado para este arquivo é definido no campo Format
.
changelog
padrão é geralmente apropriado; basta substituir o “Initial release” por uma explicação mais detalhada e alterar a distribuição de UNRELEASED
ou unstable
para o nome do lançamento alvo.
control
também deve ser atualizado: o campo Section
pode ser alterado para misc e os campos Homepage
, Vcs-Git
e Vcs-Browser
foram removidos. Os campos Depends
foram preenchidos com firefox-esr | www-browser
para garantir a disponibilidade de um navegador web capaz de exibir os documentos do pacote. Se o pacote não exigir a execução de nenhum comando como root (consulte FERRAMENTA fakeroot
), o campo Rules-Requires-Root
pode ser deixado como está.
Exemplo 15.3. O arquivo control
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.
Exemplo 15.4. O arquivo changelog
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
Exemplo 15.5. O arquivo copyright
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
geralmente contém um conjunto de regras usado para configurar, construir e instalar o software em um subdiretório específico (nomeado de acordo com o pacote binário gerado). O conteúdo desta pasta é depois arquivado dentro do pacote Debian como se fosse a raiz do sistema de arquivos. No nosso caso, os arquivos serão instalados na pasta debian/falcot-data/usr/share/falcot-data/
para que a instalação do pacote gerado implante os arquivos em /usr/share/falcot-data/
. O arquivo rules
é utilizado como um Makefile
, com alguns alvos padrões (incluindoclean
e binary
, utilizados, respectivamente, para limpar a pasta de origem e gerar o pacote binário).
debhelper
. Tal é o cado dos arquivos gerados pelo dh_make
. Para instalar nossos arquivos, nós simplesmente configuramos o comportamento do comando dh_install
criando o seguinte arquivo debian/falcot-data.install
:
data/* usr/share/falcot-data/
falcot-data.desktop
e o instalaremos em /usr/share/applications
através da adição de uma segunda linha em debian/falcot-data.install
.
Exemplo 15.6. O arquivo 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
atualizado se parece com isso:
data/* usr/share/falcot-data/ falcot-data.desktop usr/share/applications/
dpkg-buildpackage -us -uc
de dentro do diretório falcot-data-1.0
.