Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Empaquetado Debian

1,550 views

Published on

Published in: Technology
  • Be the first to comment

Empaquetado Debian

  1. 1. Debian Debian Packages
  2. 2. Index <ul><li>Introduction </li></ul><ul><li>Package Information </li></ul><ul><li>Making a Debian Package </li></ul><ul><li>Debian Quality Package </li></ul><ul><li>Debian ports/backport </li></ul><ul><li>Exercise </li></ul>
  3. 3. Introduction <ul><li>Easy way to install and configure software, documentation, libraries... </li></ul><ul><li>Packages with dependences -> less packages sizes -> flexibility. </li></ul><ul><li>Package for Evolution does not include gtk libraries. </li></ul><ul><li>Meta-information about the package, allow different information search. </li></ul>
  4. 4. Package Information Package: acpid Version: 1.0.4-5ubuntu9 Architecture: amd64 Maintainer: Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com> Installed-Size: 188 Depends: libc6 (>= 2.4), lsb-base (>= 1.3-9ubuntu3), module-init-tools (>= 3.1-rel-2ubuntu2), sysv-rc (>= 2.86.ds1-14.1ubuntu2) Section: admin Priority: optional Description: Utilities for using ACPI power management Modern computers support the Advanced Configuration and Power Interface (ACPI) to allow intelligent power management on your system and to query battery and configuration status. . ACPID is a completely flexible, ... Original-Maintainer: Cajus Pollmeier <cajus@debian.org>
  5. 5. Package Information <ul><li>Debian Package is an “ar” file with: </li></ul><ul><ul><li>Debian-binary: package format version </li></ul></ul><ul><ul><li>control.tar.gz: meta-information, scripts </li></ul></ul><ul><ul><li>data.tar.gz: installation files </li></ul></ul>
  6. 6. Making a Debian Package <ul><li>Sources directory with Makefile, script or something to compile. Autotools -> right way -> Debian. </li></ul><ul><li>Build-depends and depends. </li></ul><ul><li>“debian” directory in the root directory of the sources. </li></ul><ul><li>“debian” directory with information about the package and its files. Meta-Information. </li></ul>
  7. 7. Making a Debian Package <ul><li>Some necessary packages: </li></ul><ul><ul><li>autotools-dev </li></ul></ul><ul><ul><li>dh_make </li></ul></ul><ul><ul><li>fakeroot </li></ul></ul><ul><ul><li>devscripts </li></ul></ul>
  8. 8. Making a Debian Package <ul><li>Generate debian directory: </li></ul><ul><ul><li>dh_make </li></ul></ul><ul><ul><ul><li>Package Type (s/m/l/k..) </li></ul></ul></ul><ul><ul><ul><li>Original sources should be indicated (.tar.gz) or created using the actual sources directory. </li></ul></ul></ul><ul><ul><ul><li>Debian sources packages include differences from original sources. </li></ul></ul></ul><ul><ul><ul><li>DEBNAME,DEBFULLNAME,DEBEMAIL variables. </li></ul></ul></ul>
  9. 9. Making a Debian Package <ul><li>Files in debian directory: </li></ul><ul><ul><li>Changelog </li></ul></ul><ul><ul><li>Control </li></ul></ul><ul><ul><li>Rules </li></ul></ul><ul><ul><li>Copyright </li></ul></ul><ul><ul><li>preinst | postinst | prerm | postrm </li></ul></ul><ul><ul><li>install </li></ul></ul><ul><ul><li>Multiple Packages: </li></ul></ul><ul><ul><ul><li>package1.install packag2.postinstall </li></ul></ul></ul>
  10. 10. Making a Debian Package <ul><li>Other files </li></ul><ul><ul><li>Manpages </li></ul></ul><ul><ul><ul><li>paquete.manpages -> manpages files in the package </li></ul></ul></ul><ul><ul><ul><li>manpage.1, manpage.2 -> man pages files to be referenced from paquete.manpages </li></ul></ul></ul><ul><ul><li>dirs </li></ul></ul><ul><ul><ul><li>Directories to be created not included in the install </li></ul></ul></ul><ul><ul><li>Docs </li></ul></ul><ul><ul><ul><li>Documents to be included in the packages </li></ul></ul></ul>
  11. 11. Making a Debian Package <ul><li>Changelog </li></ul><ul><ul><li>Changes in the package </li></ul></ul><ul><ul><li>Version, priority. </li></ul></ul><ul><ul><li>Bug fixed </li></ul></ul><ul><ul><li>debchange | debchange -i (increment X 1.0.0-X) | debchange -v version (new version) </li></ul></ul>
  12. 12. Making a Debian Package <ul><li>Control </li></ul><ul><ul><li>Dependences </li></ul></ul><ul><ul><li>Conflicts </li></ul></ul><ul><ul><li>Recommends </li></ul></ul><ul><ul><li>Suggests </li></ul></ul><ul><ul><li>Description </li></ul></ul>
  13. 13. Making a Debian Package <ul><li>Rules </li></ul><ul><ul><li>The most important </li></ul></ul><ul><ul><li>Rules to compile (Makefile), easier using autotools. </li></ul></ul><ul><ul><li>Compile soures and generate a temporal directory with all the files to be included in the package. </li></ul></ul>
  14. 14. Making a Debian Package <ul><li>Copyright </li></ul><ul><ul><li>Author </li></ul></ul><ul><ul><li>Copyright </li></ul></ul><ul><ul><li>License </li></ul></ul>
  15. 15. Making a Debian Package <ul><li>Scripts </li></ul><ul><ul><li>#!/bin/sh -e (abort with error) </li></ul></ul><ul><ul><li>Package removing, options passed to the script: </li></ul></ul><ul><ul><ul><li>upgrade, remove, purge, deconfigure, failed-upgraded, abort-upgraded </li></ul></ul></ul><ul><ul><li>Package installing, options passed to the script: </li></ul></ul><ul><ul><ul><li>install, upgrade, abort-upgrade, configure </li></ul></ul></ul>
  16. 16. Making a Debian Package <ul><li>Multiple Packages </li></ul><ul><ul><li>Different entries in debian/contol </li></ul></ul><ul><ul><li>Each package have his own .install, .postrm, etc. </li></ul></ul>
  17. 17. Making a Debian Package <ul><li>Generating package </li></ul><ul><ul><li>dpkg-buildpackage -rfakeroot </li></ul></ul><ul><ul><li>debuild </li></ul></ul><ul><ul><li>Scripts that make several actions: </li></ul></ul><ul><ul><ul><li>make clean </li></ul></ul></ul><ul><ul><ul><li>dpkg-source (generate source.tar.gz and diff.gz) </li></ul></ul></ul><ul><ul><ul><li>configure </li></ul></ul></ul><ul><ul><ul><li>Make </li></ul></ul></ul><ul><ul><ul><li>make install DESTDIR=$(CURDIR)/debian/project </li></ul></ul></ul>
  18. 18. Making a Debian Package <ul><li>Generated files </li></ul><ul><ul><li>package.build </li></ul></ul><ul><ul><ul><li>Generation package log </li></ul></ul></ul><ul><ul><li>package.changes </li></ul></ul><ul><ul><ul><li>Package information and changelog </li></ul></ul></ul><ul><ul><li>package.tar.gz and package-orig.tar.gz </li></ul></ul><ul><ul><li>package-diff.gz </li></ul></ul><ul><ul><li>Package-dsc </li></ul></ul><ul><ul><ul><li>Package description </li></ul></ul></ul>
  19. 19. Making a Debian Package <ul><li>Mandatory files in a repository </li></ul><ul><ul><li>package.changes </li></ul></ul><ul><ul><li>package.dsc </li></ul></ul><ul><ul><ul><li>Files included </li></ul></ul></ul><ul><ul><li>package.diff.gz </li></ul></ul><ul><ul><li>package.orig.tar.gz </li></ul></ul><ul><ul><li>package.tar.gz </li></ul></ul><ul><ul><li>package.deb </li></ul></ul>
  20. 20. Debian Quality Package <ul><li>Lintian - dissects Debian packages and reports bugs and policy violations. </li></ul><ul><ul><li>Lintian web page to search warning/errors. </li></ul></ul><ul><li>Linda – another Debian Package checker. </li></ul><ul><li>http://www.debian.org/doc/debian-policy/index.html ← Debian Policy Manual </li></ul>
  21. 21. Debian ports/backport <ul><li>Sources from a Debian Package </li></ul><ul><li>Change information from Debian Meta-Information files </li></ul><ul><li>Generate a new package </li></ul><ul><li>Useful to get packages from later distributions </li></ul>
  22. 22. Debian ports/backport <ul><li>Useful to get packages in other architectures </li></ul><ul><li>Chroot, debootstrap </li></ul>
  23. 23. Exercise <ul><li>Make your own Debian Package </li></ul><ul><li>Try to have few errors/warnings with Lintian. </li></ul>

×