Chapter 14. manual do debmake(1)

Table of Contents

14.1. NOME
14.2. RESUMO
14.3. DESCRIÇÃO
14.3.1. argumentos opcionais:
14.4. EXEMPLOS
14.5. PACOTES DE AJUDA
14.6. CAVEAT
14.7. DEBUG
14.8. AUTOR
14.9. LICENÇA
14.10. VEJA TAMBÉM

debmake - programa para criar um pacote fonte Debian

debmake [-h] [-c | -k] [-n | -a package-version.orig.tar.gz | -d | -t ] [-p package] [-u version] [-r revision] [-z extension] [-b "binarypackage[:type], …​]" [-e foo@example.org] [-f "firstname lastname"] [-i "buildtool" | -j] [-l license_file] [-m] [-o file] [-q] [-s] [-v] [-w "addon, …​"] [-x [01234]] [-y] [-L] [-P] [-T]

debmake ajuda a compilar um pacote Debian a partir da fonte do autor. Normalmente, isto faz-se como se segue:

  • O tarball de autor é descarregado como ficheiro pacote-versão.tar.gz.
  • É desempacotado para se criar muitos ficheiros sob o directório pacote-versão/.
  • debmake é invocado no directório pacote-versão/, possivelmente sem nenhuns argumentos.
  • Os ficheiros no directório pacote-versão/debian/ são ajustados manualmente.
  • dpkg-buildpackage (geralmente a partir do seu invólucro debuild ou sbuild) é invocado no directório pacote-versão/ para criar pacotes Debian.

Certifique-se de proteger os argumentos das opções -b, -f, -l, e -w de interferências da shell citando-os de modo apropriado.

-h, --help
mostra esta mensagem de ajuda e termina.
-c, --copyright

sonda a fonte para texto copyright+licença e termina.

  • -c: estilo de resultados simples
  • -cc: estilo de resultados normal (semelhante ao ficheiro debian/copyright)
  • -ccc: estilo de resultados de depuração
-k, --kludge

compara o ficheiro debian/copyright com a fonte e termina.

O ficheiro debian/copyright tem de ser organizado para listar os padrões de ficheiro genéricos antes das excepções específicas.

  • -k: estilo de resultados básico
  • -kk: estilo de resultados detalhados
-n, --native

make a native Debian source package without .orig.tar.gz. This makes a Debian source format 3.0 (native) package.

If you are thinking of packaging a Debian-specific source tree with debian/ in it into a native Debian package, please think otherwise. You can use the debmake -d -i debuild or debmake -t -i debuild commands to make a Debian non-native package using the Debian source format 3.0 (quilt) The only difference is that the debian/changelog file must use the non-native version scheme: version-revision. The non-native package is more friendly to downstream distributions.

-a pacote-versão.tar.gz, --archive pacote-versão.tar.gz

use o tarball fonte do autor diretamente. (-p, -u, -z: sobreposto)

O tarball do autor pode ser especificado como pacote_versão.orig.tar.gz e tar.gz. Para outros casos, pode ser tar.bz2, ou tar.xz.

Se o nome do tarball de autor especificado conter letras maiúsculas, o nome do pacote Debian é gerado ao converte-las para letras minúsculas.

If the specified argument is the URL (http://, https://, or ftp://) to the upstream tarball, the upstream tarball is downloaded from the URL using wget or curl.

-d, --dist

run the make dist command equivalents first to generate the upstream tarball and use it.

The debmake -d command is designed to run in the package/ directory hosting the upstream VCS with the build system supporting the make dist command equivalents. (automake/autoconf, …​)

-t, --tar

run the tar command to generate the upstream tarball and use it.

The debmake -t command is designed to run in the package/ directory hosting the upstream VCS. Unless you provide the upstream version with the -u option or with the debian/changelog file, a snapshot upstream version is generated in the 0\~%y%m%d%H%M format, e.g., 0~1403012359, from the UTC date and time. The generated tarball excludes the debian/ directory found in the upstream VCS. (It also excludes typical VCS directories: .git/, .hg/, .svn/, .CVS/.)

-p pacote, --package pacote
define o nome do pacote Debian.
-u versão, --upstreamversion versão
define a versão de pacote do autor.
-r revisão, --revision revisão
define a revisão de pacote Debian.
-z extensão, --targz extensão
define o tipo de tarball, extensão=(tar.gz|tar.bz2|tar.xz). (nome alternativo: z, b, x)
-b "binarypackage[:type],…​", --binaryspec "binarypackage[:type],…​"

set the binary package specs by a comma separated list of binarypackage:type pairs. Here, binarypackage is the binary package name, and the optional type is chosen from the following type values:

  • bin: C/C++ compiled ELF binary code package (any, foreign) (default, alias: "", i.e., null-string)
  • data: Data (fonts, graphics, …​) package (all, foreign) (alias: da)
  • dev: Pacote de desenvolvimento de biblioteca (any, same) (nome alternativo: de)
  • doc: Pacote de documentação (all, foreign) (nome alternativo: do)
  • lib: Pacote biblioteca (any, same) (nome alternativo: l)
  • perl: Pacote script Perl (all, foreign) (nome alternativo: pl)
  • python3: Python (version 3) script package (all, foreign) (alias: py3, python, py)
  • ruby: Pacote script Ruby (all, foreign) (nome alternativo: rb)
  • nodejs: Pacote JavaScript baseado em Node.js (all, foreign) (nome alternativo: js)
  • script: Shell and other interpretted language script package (all, foreign) (alias: sh)

The pair values in the parentheses, such as (any, foreign), are the Architecture and Multi-Arch stanza values set in the debian/control file. In many cases, the debmake command makes good guesses for type from binarypackage. If type is not obvious, type is set to bin.

Here are examples for typical binary package split scenarios where the upstream Debian source package name is foo:

  • Generating an executable binary package foo:

    • -b’foo:bin', or its short form `-b'-'`", or no -b option
  • Generating an executable (python3) binary package python3-foo:

    • -b’python3-foo:py', or its short form -b’python3-foo'
  • Generating a data package foo:

    • -b’foo:data', or its short form -b'-:data'
  • Generating a executable binary package foo and a documentation one foo-doc:

    • -b’foo:bin,foo-doc:doc', or its short form -b'-:-doc'
  • Generating a executable binary package foo, a library package libfoo1, and a library development package libfoo-dev:

    • -b’foo:bin,libfoo1:lib,libfoo-dev:dev' or its short form -b'-,libfoo1,libfoo-dev'

Se o conteúdo da árvore fonte não corresponder à definição para tipo, o comando debmake avisa-o.

-e foo@example.org, --email foo@example.org

define o endereço de e-mail.

A predefinição é obtida a partir do valor da variável de ambiente $DEBEMAIL.

-f "primeironome últimonome", --fullname "primeironome últimonome"

define o nome completo

A predefinição é obtida a partir do valor da variável de ambiente $DEBFULLNAME.

-i "buildtool", --invoke "buildtool"

invoke "buildtool" at the end of execution. buildtool may be dpkg-buildpackage, debuild, sbuild, etc.

A predefinição é não executar nenhum programa.

Definir esta opção define automaticamente a opção --local.

-j, --judge

corre dpkg-depcheck para julgar dependências de compilação e identificar caminhos de ficheiros. Os ficheiros de relatório estão no directório pai.

  • pacote.build-dep.log: Ficheiro de relatório para dpkg-depcheck.
  • pacote.install.log: Ficheiro de relatório para recordar ficheiros no directório debian/tmp.
-l "license_file,…​", --license "license_file,…​"

adiciona texto de licença formatado ao final do ficheiro debian/copyright mantendo resultados da sondagem da licença.

The default is to add COPYING and LICENSE, and license_file needs to list only the additional file names all separated by ,.

-m, --monoarch
força pacotes a serem não-multiarch.
-o ficheiro, --option ficheiro

lê parâmetros opcionais de ficheiro. (Isto não é para usar todos os dias.)

O conteúdo de ficheiro é fonte como o código Python no final de para.py. Por exemplo, a descrição do pacote pode ser especificada pelo seguinte ficheiro.

para['desc'] = 'program short description'
para['desc_long'] = '''\
 program long description which you wish to include.
 .
 Empty line is space + .
 You keep going on ...
'''
-q, --quitearly
termina cedo antes de criar ficheiros no directório debian/.
-s, --spec
use upstream spec (pyproject.py for Python, etc.) for the package description.
-v, --version
mostra informação de versão.
-w "addon,…​", --with "addon,…​"

adiciona argumentos extra à opção --with do comando dh(1) como addon em debian/rules.

The addon values are listed all separated by ,, e.g., -w "python3,autoreconf".

For Autotools based packages, autoreconf as addon to run autoreconf -i -v -f for every package building is default behavior of the dh(1) command.

For Autotools based packages, if they install Python (version 3) programs, setting python3 as addon to the debmake command argument is needed since this is non-obvious. But for pyproject.toml based Python packages, setting python3 as addon to the debmake command argument is not needed since this is obvious and the debmake command automatically set it to the dh(1) command.

-x n, --extra n

gera ficheiros de configuração como modelos. (Por favor note debian/changelog, debian/control, debian/copyright, e debian/rules são os ficheiros de configuração mínimos para compilar pacote binário Debian.)

O número n determina quais modelos de configuração são gerados.

  • -x0: all required configuration template files. (selected option if any of these files already exist)
  • -x1: all -x0 files + desirable configuration template files with binary package type supports.
  • -x2: all -x1 files + normal configuration template files with maintainer script supports.
  • -x3: all -x2 files + optional configuration template files. (default optuin)
  • -x4: all -x3 files + deprecated configuration template files.

Some configuration template files are generated with the extra .ex suffix to ease their removal. To activate these, rename their file names to the ones without the .ex suffix and edit their contents. Existing configuration files are never overwritten. If you wish to update some of the existing configuration files, please rename them before running the debmake command and manually merge the generated configuration files with the old renamed ones.

-y, --yes
force yes for all prompts. (without option: ask [Y/n]; doubled option: force no)
-L, --local
gera ficheiros de configuração para o pacote local para verificações lintian(1) tolas.
-P, --pedantic
verifica pedantemente os ficheiros auto-gerados.
-T, --tutorial
output tutorial comment lines in template files. default when -x3 or -x4 is set.

For a well behaving source, you can build a good-for-local-use installable single Debian binary package easily with one command. Test install of such a package generated in this way offers a good alternative to the traditional make install command installing into the /usr/local directory since the Debian package can be removed cleanly by the dpkg -P '…​' command. Here are some examples of how to build such test packages. (These should work in most cases. If the -d option does not work, try the -t option instead.)

For a typical C program source tree packaged with autoconf/automake:

  • debmake -d -i debuild

Para uma árvore fonte de módulo Python (versão 3) típica:

  • debmake -s -d -b":python3" -i debuild

Para um módulo Python (version 3) típico no arquivo pacote-versão.tar.gz:

  • debmake -s -a package-version.tar.gz -b":python3" -i debuild

Para um módulo Perl típico no arquivo pacote-versão.tar.gz:

  • debmake -a package-version.tar.gz -b":perl" -i debuild

O empacotamento pode requerer a instalação de alguns pacotes de ajuda especial adicional.

  • Python (version 3) programs may require the pybuild-plugin-pyproject package.
  • The Autotools (autoconf + automake) build system may require autotools-dev or dh-autoreconf package.
  • Os programas Ruby podem requerer o pacote gem2deb.
  • Os programas Node.js baseados em JavaScript podem requerer o pacote pkg-js-tools.
  • Os programas Java podem requerer o pacote javahelper.
  • Os programas do Gnome podem requerer o pacote gobject-introspection.
  • etc.

Although debmake is meant to provide template files for the package maintainer to work on, actual packaging activities are often performed without using debmake while referencing only existing similar packages and Debian Policy Manual”. All template files generated by debmake are required to be modified manually.

There are 2 positive points for debmake:

  • debmake helps to write terse packaging tutorial Guide for Debian Maintainers (debmake-doc package).
  • debmake provides short extracted license texts as debian/copyright in decent accuracy to help license review.

Please double check copyright with the licensecheck(1) command.

Existem algumas limitações para quais caracteres podem ser usados como parte do pacote Debian. A limitação mais notável é a proibição de letras maiúsculas no nome do pacote. Aqui está um sumário como um conjunto de expressões regulares:

  • Upstream package name (-p): [-+.a-z0-9]{2,}
  • Binary package name (-b): [-+.a-z0-9]{2,}
  • Upstream version (-u): [0-9][-+.:~a-z0-9A-Z]*
  • Debian revision (-r): [0-9][+.~a-z0-9A-Z]*

See the exact definition in Chapter 5 - Control files and their fields in the Debian Policy Manual.

debmake assumes relatively simple packaging cases. So all programs related to the interpreter are assumed to be Architecture: all. This is not always true.

Por favor reporte bugs ao pacote debmake usando o comando reportbug.

O caractere definido na variável de ambiente $DEBUG determina o nível de resultados no relatório.

  • i: main.py logging
  • p: para.py logging
  • s: checkdep5.py check_format_style() logging
  • y: checkdep5.py split_years_name() logging
  • b: checkdep5.py parse_lines() 1 logging — content_state scan loop: begin-loop
  • m: checkdep5.py parse_lines() 2 logging — content_state scan loop: after regex match
  • e: checkdep5.py parse_lines() 3 logging — content_state scan loop: end-loop
  • a: checkdep5.py parse_lines() 4 logging — print author/translator section text
  • f: checkdep5.py check_all_license() 1 logging — input filename for the copyright scan
  • l: checkdep5.py check_all_license() 2 logging — print license section text
  • c: checkdep5.py check_all_license() 3 logging — print copyright section text
  • k: checkdep5.py check_all_license() 4 logging — sort key for debian/copyright stanza
  • r: sed.py logging
  • w: cat.py logging
  • n: kludge.py logging (debmake -k)

Use this feature as:

 $ DEBUG=ipsybmeaflckrwn debmake ...

See README.developer in the source for more.

Copyright © 2014-2024 Osamu Aoki <osamu@debian.org>

Licença Expat

The debmake-doc package provides the Guide for Debian Maintainers” in plain text, HTML and PDF formats under the /usr/share/doc/debmake-doc/ directory.

Veja também dpkg-source(1), deb-control(5), debhelper(7), dh(1), dpkg-buildpackage(1), debuild(1), quilt(1), dpkg-depcheck(1), sbuild(1), gbp-buildpackage(1), and gbp-pq(1) manpages.