Chapter 6. Опции debmake

Table of Contents

6.1. Опции быстрых действий (-a, -i)
6.1.1. Модуль Python
6.2. Срезы основной ветки (-d, -t)
6.3. Upstream snapshot (alternative git deborig approach)
6.4. debmake -cc
6.5. debmake -k
6.6. debmake -j
6.7. debmake -x
6.8. debmake -P
6.9. debmake -T

Ниже приводятся некоторые наиболее важные опции команды debmake.

Команда debmake предлагает 2 опции для выполнения быстрых действий.

  • -a : открыть tar-архив основной ветки
  • -i : выполнить сценарий для сборки двоичного пакета

Действия из примера, приведённого выше в Chapter 4, Простой пример, можно выполнить с помощью следующей простой команды.

 $ debmake -a package-1.0.tar.gz -i debuild
[Tip] Tip

A URL such as “https://www.example.org/DL/package-1.0.tar.gz” may be used for the -a option.

[Tip] Tip

A URL such as “https://arm.koji.fedoraproject.org/packages/ibus/1.5.7/3.fc21/src/ibus-1.5.7-3.fc21.src.rpm” may be used for the -a option, too.

This packaging scheme is good for the git repository organized as described in gbp-buildpackage(7) which uses the master, upstream, and pristine-tar branches.

The upstream snapshot from the upstream source tree in the VCS can be made with the -d option if the upstream package supports the “make dist” equivalence.

 $ cd /path/to/upstream-vcs
 $ debmake -d -i debuild

С другой стороны, то же самое можно сделать с помощью опции -t в том случае, если с помощью команды tar можно создать tar-архив основной ветки.

 $ cd /path/to/upstream-vcs
 $ debmake -p package -t -i debuild

Если вы не укажите версию основной ветки с помощью опции -u или в файле debian/changelog, то версия среза основной ветки будет создана в формате 0~%y%m%d%H%M из текущих даты и времени по UTC, напр., 0~1403012359.

Если система управления версиями основной ветки размещена в каталоге пакет/, а не в каталоге upstream-vcs/, то «-p пакет» можно пропустить.

If the upstream source tree in the VCS contains the debian/* files, the debmake command with either the -d option or the -t option combined with the -i option automates the making of a non-native Debian package from the VCS snapshot while using these debian/* files.

 $ cp -r /path/to/package-0~1403012359/debian/. /path/to/upstream-vcs/debian
 $ dch
   ... update debian/changelog
 $ git add -A .; git commit -m "vcs with debian/*"
 $ debmake -t -p package -i debuild

Эта схема сборки неродного двоичного пакета Debian, используя команду «debmake -t -i debuild» может рассматриваться как схема сборки квазиродного пакета Debian, поскольку эта ситуация при работе над пакетом схожа со сборкой родного двоичного пакета Debian с помощью команды debuild и без tar-архива основной ветки.

Use of a non-native Debian package helps to ease communication with the downstream distros such as Ubuntu for bug fixes etc.

This packaging scheme is good for the git repository organized as described in dgit-maint-merge(7) which uses the master branch only.

You can create the upstream tarball and Debian package simply as follows.

 $ cd /path/to/upstream-git
 $ git deborig -f HEAD
 $ pdebuild

This scheme can be applied to the quasi-native Debian package scheme when debian/changelog contains the non-native version number with revision like 0.16-1.

For -1 revision, this use of git-deborig(1) as above is how this debmake-doc package generates the upstream tarball. For source format 3.0 (quilt), files under debian/ directory in the upstream tarball has no negatives. You may override the lintian warning.

For -2, -3, … revisions, you need to fetch and use the uploaded upstream tarball instead. For this, origtargz(1) may be handy.

The debmake command with the -cc option can make a summary of the copyright and license for the entire source tree to standard output.

 $ tar -xvzf package-1.0.tar.gz
 $ cd package-1.0
 $ debmake -cc | less

Опция -c позволяет получить более краткий отчёт.

При обновлении пакета до нового выпуска основной ветки команда debmake может проверить содержимое существующего файла debian/copyright и сравнить его с информацией об авторских правах и лицензировании для всего обновлённого дерева исходного кода целиком.

 $ cd package-vcs
 $ gbp import-orig --uscan --pristine-tar
 ... update source with the new upstream release
 $ debmake -k | less

The “debmake -k” command parses the debian/copyright file from the top to the bottom and compares the license of all the non-binary files in the current package with the license described in the last matching file pattern entry of the debian/copyright file.

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

[Tip] Tip

Для всех новых выпусков основной ветки запускайте команду «debmake -k», чтобы файл debian/copyright оставался актуальным.

The generation of a functioning multi-binary package always requires more manual work than that of a functioning single binary package. The test build of the source package is the essential part of it.

Например, создадим пакет из того же архива package-1.0.tar.gz (см. Chapter 4, Простой пример) с поддержкой набора из нескольких двоичных пакетов.

  • Запустите команду debmake с опцией -j для выполнения тестовой сборки и создания отчёта.

     $ debmake -j -a package-1.0.tar.gz
  • Check the last lines of the package.build-dep.log file to judge build dependencies for Build-Depends. (You do not need to list packages used by debhelper, perl, or fakeroot explicitly in Build-Depends. This technique is useful for the generation of a single binary package, too.)
  • Проверьте содержимое файла пакет.install.log для определения путей установки файлов, чтобы решить, как разделить эти файлы на несколько пакетов.
  • Начните работу над пакетом с помощью команды debmake.

     $ rm -rf package-1.0
     $ tar -xvzf package-1.0.tar.gz
     $ cd package-1.0
     $ debmake -b"package1:type1, ..."
  • Обновите файлы debian/control и debian/двоичныйпакет.install, используя полученную выше информацию.
  • При необходимости обновите другие файлы debian/*.
  • Build the Debian package with the debuild command or its equivalent.

     $ debuild
  • All binary package entries specified in the debian/binarypackage.install file are generated as binarypackage_version-revision_arch.deb.
[Note] Note

Опция -j для команды debmake вызывает dpkg-depcheck(1) для запуска debian/rules под управлением strace(1) с целью получения зависимостей от библиотек. К сожалению, это выполняется очень медленно. Если вам известны зависимости от библиотек из других источников, например, файла SPEC, то можно просто запустить команду «debmake …» без опции -j и запустить команду «debian/rules install», чтобы проверить пути установки созданных файлов.

Количество шаблонных файлов, создаваемых командой debmake зависит от опции -x[01234].

[Note] Note

Команда debmake не меняет ни один из существующих файлов настройки.

Команда debmake, запущенная с опцией -P, педантично проверяет создаваемые автоматически файлы на предмет наличия текста об автоских правах и лицензировании, даже если они подпадают под действие разрешительной лицензии.

This option affects not only the content of the debian/copyright file generated by normal execution, but also the output by the execution with the -k, -c, -cc, and -ccc options.

The debmake command invoked with the -T option additionally prints verbose tutorial comment lines. The lines marked with ### in the template files are part of the verbose tutorial comment lines.