Table of Contents
Ниже приводятся некоторые наиболее важные опции команды debmake.
Команда debmake предлагает 2 опции для выполнения быстрых действий.
Действия из примера, приведённого выше в Chapter 4, Простой пример, можно выполнить с помощью следующей простой команды.
$ debmake -a package-1.0.tar.gz -i debuild
Tip | |
---|---|
A URL such as “https://www.example.org/DL/package-1.0.tar.gz” may be used for the -a option. |
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. |
You can generate a functioning single binary Debian package with a reasonable package description directly from the Python module package offered as a tarball, pythonmodule-1.0.tar.gz. The -b option specifying the package type python and the -s option to copy the package description from the upstream package need to be specified.
$ debmake -s -b':python' -a pythonmodule-1.0.tar.gz -i debuild
For other interpreted languages that support the -b option, specify the pertinent type for the -b option.
For interpreted languages without the -b option support, specify the script type instead and add the interpreter package as a dependency of the resulting binary package by adjusting the debian/control file.
This test building 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
This non-native Debian binary package building scheme without the real upstream tarball using the “debmake -t -i debuild” command may be considered as the quasi-native Debian package scheme since the packaging situation resembles the native Debian binary package building case using the debuild command without the upstream tarball.
Use of a non-native Debian package building scheme helps to ease communication with the downstream distros such as Ubuntu for bug fixes etc.
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 | |
---|---|
Для всех новых выпусков основной ветки запускайте команду «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
Начните работу над пакетом с помощью команды debmake.
$ rm -rf package-1.0 $ tar -xvzf package-1.0.tar.gz $ cd package-1.0 $ debmake -b"package1:type1, ..."
Build the Debian package with the debuild command or its equivalent.
$ debuild
Note | |
---|---|
Опция -j для команды debmake вызывает dpkg-depcheck(1) для запуска debian/rules под управлением strace(1) с целью получения зависимостей от библиотек. К сожалению, это выполняется очень медленно. Если вам известны зависимости от библиотек из других источников, например, файла SPEC, то можно просто запустить команду «debmake …» без опции -j и запустить команду «debian/rules install», чтобы проверить пути установки созданных файлов. |
Количество шаблонных файлов, создаваемых командой debmake зависит от опции -x[01234].
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.