Appendix A. Страница руководства debmake(1)

debmake - program to make a Debian source package

debmake [-h] [-c | -k] [-n | -a пакет-версия.orig.tar.gz | -d | -t ] [-p пакет] [-u версия] [-r редакция] [-z расширение] [-b "двоичныйпакет, …]" [-e foo@example.org] [-f "имя фамилия"] [-i "инструментсборки" | -j] [-l файл_лицензии] [-m] [-o файл] [-q] [-s] [-v] [-w "дополнение, …"] [-x [01234]] [-y] [-L] [-P] [-T]

debmake помогает собрать пакет Debian из исходного кода основной ветки разработки. Обычно это делается следующим образом:

  • Загружается tar-архив основной ветки разработки в виде файла пакет-версия.tar.gz.
  • Исходный код распаковывается, создаются файлы в каталоге пакет-версия/.
  • Вызывается debmake в каталоге пакет-версия/, возможно, без аргументов.
  • Файлы в каталоге package-version/debian/ настраиваются вручную.
  • dpkg-buildpackage (usually from its wrapper debuild or sbuild) is invoked in the package-version/ directory to make Debian packages.

Обязательно защитите путём соответствующего включения в кавычки аргументы опций -b, -f, -l и -w от вмешательства командной оболочки.

-h, --help
показать справочное сообщение и выйти.
-c, --copyright

сканировать исходный код на предмет текста об авторском праве и лицензировании и выйти.

  • -c: простой стиль вывода
  • -cc: обычный стиль вывода (схож с файлом debian/copyright)
  • -ccc: отладочный стиль вывода
-k, --kludge

сравнить файл debian/copyright с исходным кодом и выйти.

Файл debian/copyright должен быть организован таким образом, что наиболее общие файловые шаблоны размещаются раньше конкретных исключений.

  • -k: простой стиль вывода
  • -kk: подробный стиль вывода
-n, --native

make a native Debian source package without .orig.tar.gz. This makes a “3.0 (native)” format 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 “3.0 (quilt)” format non-native Debian package. 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 пакет-версия.tar.gz, --archive пакет-версия.tar.gz

использовать непосредственно tar-архив с исходным кодом основной ветки. (отменяются опции -p, -u, -z)

The upstream tarball may be specified as package_version.orig.tar.gz and tar.gz. For other cases, it may be tar.bz2, or tar.xz.

Если в имени указанного tar-архива основной ветки содержатся буквы в верхнем регистре, то в имени пакета Debian они будут преобразованы в буквы нижнего регистра.

Если в качестве аргумента указан URL (http://, https:// или ftp://) tar-архива основной ветки, то этот архив скачивается с помощью wget или curl.

-d, --dist

сначала запустить эквиваленты команды «make dist» для создания tar-архива основной ветки, затем использовать его.

Команда «debmake -d» предназначена для запуска в каталоге пакет/, в котором расположена система управления версиями и система сборки, поддерживающая эквиваленты команды «make dist». (automake/autoconf, Python distutils, …)

-t, --tar

запустить команду «tar» для создания tar-архива основной ветки, затем использовать его.

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 пакет, --package пакет
установить имя пакета Debian.
-u версия, --upstreamversion версия
установить версию пакета основной ветки.
-r редакция, --revision редакция
установить номер редации пакета Debian.
-z расширение, --targz расширение
set the tarball type, extension=(tar.gz|tar.bz2|tar.xz). (alias: z, b, x)
-b "двоичныйпакет[:тип],…", --binaryspec "двоичныйпакет[:тип],…"

set the binary package specs by a comma separated list of binarypackage:type pairs, e.g., in the full form “foo:bin,foo-doc:doc,libfoo1:lib,libfoo-dev:dev” or in the short form, “-doc,libfoo1,libfoo-dev”.

Here, binarypackage is the binary package name, and the optional type is chosen from the following type values:

  • bin: скомпилированный двоичный пакет с исполняемыми файлами формата ELF на языке C/C++ (any, foreign) (по умолчанию, псевдоним: "", то есть пустая-строка)
  • data: пакет с данными (шрифты, графика, …) (all, foreign) (псевдоним: da)
  • dev: пакет с библиотекой разработки (any, same) (псевдоним: de)
  • doc: пакет документации (all, foreign) (псевдоним: do)
  • lib: пакет с библиотекой (any, same) (псевдоним: l)
  • perl: пакет со сценарием на языке Perl (all, foreign) (псевдоним: pl)
  • python3: Python (version 3) script package (all, foreign) (alias: py3)
  • ruby: пакет со сценарием на языке Ruby (all, foreign) (псевдоним: rb)
  • nodejs: Node.js based JavaScript package (all, foreign) (alias: js)
  • script: пакет со сценарием командной оболочки (all, foreign) (псевдоним: sh)

Пары значений в скобках, такие как (any, foreign), представляют собой значения служебных строк Architecture и Multi-Arch, устанавливаемые в файле debian/control.

Во многих случаях команда debmake довольно хорошо предсказывает значение поля тип, исходя из значения поля двоичныйпакет. Если тип не очевиден, то значением поля тип становится bin. Например, исходя из libfoo значением поля тип становится lib, а исходя из font-bar значением поля тип становится data, …

Если содержимое дерева исходного кода не совпадает с настройками поля тип, то команда debmake выводит предупреждение.

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

установить адрес электронной почты.

По умолчанию берётся значение переменной окружения $DEBEMAIL.

-f "имя фамилия", --fullname "имя фамилия"

установить имя и фамилию.

По умолчанию берётся значение переменной окружения $DEBFULLNAME.

-i "инструментсборки", --invoke "инструментсборки"

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

По умолчанию никакая программа не выполняется.

Передача этой опции автоматически приводит к передаче опции --local.

-j, --judge

запустить dpkg-depcheck для выявления сборочных зависимостей и определения путей файлов. Файлы журнала располагаются в родительском каталоге.

  • package.build-dep.log: файл журнала dpkg-depcheck.
  • package.install.log: файл журнала, в который записываются файлы из каталога debian/tmp.
-l "файл_лицензии,…", --license "файл_лицензии,…"

add formatted license text to the end of the debian/copyright file holding license scan results.

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

-m, --monoarch
подготовить пакеты без поддержки мультиархитектурности.
-o файл, --option файл

read optional parameters from file. (This is not for everyday use.)

The content of file is sourced as the Python code at the end of para.py. For example, the package description can be specified by the following file.

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
выйти до создания файлов в каталоге debian/.
-s, --spec
использовать spec-файло основной ветки (в случае исходного кода на языке Python используется setup.py и т. д.) в качестве источника описания пакета.
-v, --version
показать информацию о версии.
-w "дополнение,…", --with "дополнение,…"

добавить дополнительные аргументы опции --with команды dh(1) в качестве дополнений в файл 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 setup.py based 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

generate configuration files as templates. (Please note debian/changelog, debian/control, debian/copyright, and debian/rules are bare minimum configuration files to build a Debian binary package.)

The number n determines which configuration templates are generated.

  • -x0: bare minimum configuration files. (default option if any of bare minimum configuration files already exist)
  • -x1: all -x0 files + desirable configuration files for the single binary package. (default option for the single binary package if none of bare minimum configuration files exist)
  • -x2: all -x1 files + desirable configuration files for the multi binary package. (default option for the multi binary package if none of bare minimum configuration files exist)
  • -x3: all -x2 files + unusual configuration template files. Unsual configuration template files are generated with the extra .ex suffix to ease their removal. To use these as configuration files, rename their file names to ones without the .ex suffix.
  • -x4: all -x3 files + copyright file examples.
-y, --yes
«отвечать утвердительно» на все вопросы. (без опции: «спрашивать [Y/n]»; двочная опция: «отвечать отрицательно»)
-L, --local
создать файлы настройки для локального пакета, чтобы перехитрить проверки lintian(1).
-P, --pedantic
педантично проверять автоматически создаваемые файлы.
-T, --tutorial
вывести в шаблонных файлах строки с обучающими комментариями.

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.)

Для дерева исходного кода обычной программы на языке C с autoconf/automake:

  • debmake -d -i debuild

For a typical Python (version 3) module source tree:

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

For a typical Python (version 3) module in the package-version.tar.gz archive:

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

Для обычного модуля языка Perl в виде архива пакет-версия.tar.gz:

  • debmake -a пакет-версия.tar.gz -b":perl" -i debuild

Для работы над пакетами может потребоваться установка некоторых дополнительных специализированных вспомогательных пакетов.

  • Python (version 3) programs may require the dh-python package.
  • The Autotools (Autoconf + Automake) build system may require autotools-dev or dh-autoreconf package.
  • Ruby programs may require the gem2deb package.
  • Node.js based JavaScript programs may require the pkg-js-tools package.
  • Java programs may require the javahelper package.
  • Для программ для окружения Gnome может потребоваться пакет gobject-introspection.
  • и т. д.

Утилита debmake предназначена для создания шаблонных файлов в помощью сопровождающему пакета. Строчки с комментариями начинаются с символа # и содержат обучающий текст. Вам следует удалить или отредактировать строки с комментариями до выполнения загрузки пакета в архив Debian.

The license extraction and assignment process involves a lot of heuristics; it may fail in some cases. It is highly recommended to use other tools such as licensecheck from the devscripts package in conjunction with debmake.

There are some limitations for what characters may be used as a part of the Debian package. The most notable limitation is the prohibition of uppercase letters in the package name. Here is a summary as a set of regular expressions:

  • Имя пакета основной ветки разработки (-p): [-+.a-z0-9]{2,}
  • Имя двоичного пакета (-b): [-+.a-z0-9]{2,}
  • Версия основной ветки разработки (-u): [0-9][-+.:~a-z0-9A-Z]*
  • Редакция Debian (-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 предполагает относительно простые случаи создания пакетов. Поэтому все программы, относящиеся е интерпретатору, считаются «Architecture: all». Тем не менее, это не всегда так.

Сообщения об ошибках отправляйте с помощью команды reportbug для пакета debmake.

Набор символов в переменной окружении $DEBUG определяет уровень вывода журнала.

  • i: печать информации
  • p: вывод всех глобальных параметров
  • d: вывод всех грамматически разобранных параметров для всех двоичных пакетов
  • f: ввод имени файла для сканирования copyright
  • y: разделение год/имя для строки об авторском праве
  • s: сканер строки для format_state
  • b: цикл сканирования content_state: начало-конец
  • m: цикл сканирования content_state: после совпадения с регулярным выражением
  • e: цикл сканирования content_state: конец-цикл
  • c: печать текста из раздела об авторских правах
  • l: печать текста из раздела о лицензиях
  • a: печать текста из раздела автор/переводчик
  • k: сортировать ключи для строк debian/copyright
  • n: сканировать результат debian/copyright («debmake -k»)

Используйте эту переменную следующим образом:

 $ DEBUG=pdfbmeclak debmake ...

Дополнительную информацию см. в файле README.developer.

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

Лицензия 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.

See also 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.