if ($answer_counter == 1): ?>
endif; ?>
Используйте команду apt-get source <package>
(не используйте sudo с ней), чтобы загрузить исходный код пакета.
От man apt-get
:
source
source causes apt-get to fetch source packages. APT will examine the
available packages to decide which source package to fetch. It will then
find and download into the current directory the newest available version of
that source package while respect the default release, set with the option
APT::Default-Release, the -t option or per package with the pkg/release
syntax, if possible.
Source packages are tracked separately from binary packages via deb-src type
lines in the sources.list(5) file. This means that you will need to add such
a line for each repository you want to get sources from. If you don't do
this you will properly get another (newer, older or none) source version
than the one you have installed or could install.
If the --compile option is specified then the package will be compiled to a
binary .deb using dpkg-buildpackage, if --download-only is specified then
the source package will not be unpacked.
A specific source version can be retrieved by postfixing the source name
with an equals and then the version to fetch, similar to the mechanism used
for the package files. This enables exact matching of the source package
name and version, implicitly enabling the APT::Get::Only-Source option.
Note that source packages are not tracked like binary packages, they exist
only in the current directory and are similar to downloading source tar
balls.
Чтобы создать пакет из исходного кода, сначала установите зависимости сборки:
sudo apt-get build-dep <package>
Затем используйте dpkg-buildpackage
для создания файла .deb
. Из Краткие справочные листы APT и Dpkg :
dpkg-buildpackage Создает пакет Debian из дерева исходных текстов Debian. Вы должны находиться в главной директории исходного дерева, чтобы это работало. Использование примера:
dpkg-buildpackage -rfakeroot -uc -b
Где -rfakeroot
инструктирует его использовать программу fakeroot для имитации прав root (для целей владения), -uc
означает «Не криптографически подписывать журнал изменений», а -b
означает «Сборка двоичного пакета только "
В терминале cd
в каталог, содержащий источник пакета (например, ~/code/hellanzb-0.13
), и выполните следующую команду:
dpkg-buildpackage -rfakeroot -uc -b
Если сборка выполнена успешно, появится файл .deb
, расположенный в родительском файле
(например, ~/code/hellanzb_0.13-6.1_all.deb
). Р>