apt-get source source-package-name
command. This command requires a deb-src
line in the /etc/apt/sources.list
file, and up-to-date index files (i.e. apt-get update
). These conditions should already be met if you followed the instructions from the chapter dealing with APT configuration (see قسم 6.1, “تعبئة الملف sources.list
”). Note however, that you will be downloading the source packages from the Debian version mentioned in the deb-src
line. If you need another version, you may need to download it manually from a Debian mirror or from the web site. This involves fetching two or three files (with extensions *.dsc
— for Debian Source Control — *.tar.comp
, and sometimes *.diff.gz
or *.debian.tar.comp
— comp taking one value among gz
, bz2
or xz
depending on the compression tool in use), then run the dpkg-source -x file.dsc
command. If the *.dsc
file is directly accessible at a given URL, there is an even simpler way to fetch it all, with the dget URL
command. This command (which can be found in the devscripts package) fetches the *.dsc
file at the given address, then analyzes its contents, and automatically fetches the file or files referenced within. Once everything has been downloaded, it extracts the source package (unless the -d
or --download-only
option is used).
2:4.1.17+dfsg-2
, we can create version 2:4.1.17+dfsg-2falcot1
, which clearly indicates the origin of the package. This makes the package version number higher than the one provided by Debian, so that the package will easily install as an update to the original package. Such a change is best effected with the dch
command (Debian CHangelog) from the devscripts package, with an command such as dch --local falcot
. This invokes a text editor (sensible-editor
— this should be your favorite editor if it is mentioned in the VISUAL
or EDITOR
environment variables, and the default editor otherwise) to allow documenting the differences brought by this rebuild. This editor shows us that dch
really did change the debian/changelog
file.
debian/rules
, which drives the steps in the package build process. In the simplest cases, the lines concerning the initial configuration (./configure …
) or the actual build ($(MAKE) …
or make …
) are easy to spot. If these commands are not explicitly called, they are probably a side effect of another explicit command, in which case please refer to their documentation to learn more about how to change the default behavior. With packages using dh
, you might need to add an override for the dh_auto_configure
or dh_auto_build
commands (see their respective manual pages for explanations on how to achieve this).
debian/control
أيضاً اعتماداً على طبيعة التغييرات المحلية التي أجريتها على الحزمة، يحوي هذا الملف وصفاً للحزم المولّدة. على وجه الخصوص، يحوي هذا الملف سطور Build-Depends
تتحكم بقائمة الاعتماديات التي يجب تلبيتها عند بناء الحزمة. تشير هذه الاعتماديات غالباً إلى نسخ الحزم الموجودة في التوزيعة التي أتت منها الحزمة المصدرية، لكنها قد لا تكون متوفرة في التوزيعة المستخدمة للبناء. لا توجد طريقة مؤتمتة تبيّن هل الاعتمادية حقيقية أم أنها محددة فقط لضمان محاولة البناء باستخدام آخر نسخة من المكتبة — هذه هي الطريقة الوحيدة المتاحة لإجبار البانيات الآلية (autobuilder) على استخدام نسخة معينة من الحزمة أثناء البناء، لذلك يستخدم مشرفو دبيان في كثير من الأحيان اعتماديات لها أرقام محددة.
INSTALL
غالباً — على معرفة الاعتماديات المناسبة. في الحالة المثالية، يجب أن تتمكن من تلبية الاعتماديات ضمن التوزيعة المستخدمة للبناء؛ إذا لم تتمكن من ذلك، ستبدأ عملية تعاودية، حيث يجب نقل الحزم المذكورة في الحقل Build-Depends
خلفاً قبل أن تتمكن من نقل الحزمة المستهدفة. قد لا تحتاج بعض الحزم أن تنقلها خلفياً، ويمكن تثبيتها كما هي أثناء عملية البناء (إحدى الأمثلة البارزة هي debhelper). لاحظ أن عملية النقل الخلفي قد تتعقد سريعاً إذا لم تكن حذراً. لذلك، يجب تقليل المنقولات الخلفية إلى أقل ما يمكن.
.deb
). يدير الأمر dpkg-buildpackage
العملية كلها.
Build-Depends
، أو إذا لم تُثبَّت الحزم المناسبة. في هذه الحالات، يمكن تجاوز عملية التحقق عبر تمرير الخيار -d
إلى dpkg-buildpackage
. لكن تجاهل هذه الاعتماديات صراحة يعرضك لخطر إخفاق عملية البناء في مرحلة لاحقة. وأسوأ من ذلك، قد يبدو أن الحزمة تبنى بشكل صحيح لكنها لا تعمل بشكل سليم لاحقاً: فبعض البرامج تعطّل بعض مزاياها آلياً إذا لم تعثر على إحدى المكتبات المطلوبة أثناء البناء.
debuild
؛ الذي يستدعي dpkg-buildpackage
كالعادة لكنه يضيف أيضاً استدعاءً لبرنامج يجري عدة فحوصات للتحقق من اتفاق الحزم المولّدة مع سياسة دبيان. كما يُنظِّف هذا السكربت البيئة بحيث لا ”تُلوّث“ متغيرات البيئة المحلية عملية بناء الحزمة. الأمر debuild
هو أحد الأدوات من المجموعة devscripts، التي تتناسق مع بعضها وتشترك في بعض الإعدادات حتى تسهِّل مهمة مشرف الحزمة.