| Recompilar / Reconstruir paquetes Debian / Ubuntu desde la fuente |
|
|
|
| Viernes, 12 de Febrero de 2010 02:20 | |
|
Necesitaba compilar Bind9 con soporte gssapi. Este How-to explica de forma detallada como descargar el código fuente en Debian / Ubuntu y generar los .deb personalizados. Está muy bien explicado. No realizaré traducción del texto.
Q. I'd like to rebuild a Debian / Ubuntu package called foo with additional option. How do I recompile .deb packages?
A. To build a Debian package, you need the following packages / software installed on system
[a] fakeroot : fakeroot package - runs a command in an environment wherein it appears to have root privileges for file manipulation. This is useful for allowing users to create archives (tar, ar, .deb etc.) with files in them with root permissions/ownership.
[b] dpkg-dev : package building tools for Debian
[c] Development environment - You need gcc, make and all other compiler collection installed on system. Under Debian / Ubuntu package build-essential takes care of everything.
Step #1: Install required packages
Type the following command
$ sudo apt-get install build-essential fakeroot dpkg-dev
Step #2: Install source code package
First, create a directory to store source package, enter:
$ mkdir build
$ cd build
Use apt-get command to install source code for a package called foo
$ sudo apt-get source foo
Install all build-dependencies, enter:
$ sudo apt-get build-dep foo
Unpacks Debian / Ubuntu source archives with Debian source package (.dsc) manipulation tool, enter:
$ dpkg-source -x foo_version-revision.dsc
To just compile the package, you need cd into foo-version directory and issue the command
$ dpkg-buildpackage -rfakeroot -b
If you want to pass custom additonal options to configure, you can set up the DEB_BUILD_OPTIONS environment variable. For instance, if you want pass option called --enable-radio --enable-gui, enter:
$ DEB_BUILD_OPTIONS="--enable-gui --enable-radio" fakeroot debian/rules binary
You can also pass some variables to the Makefile. For example, if you want to compile with gcc v3.4, enter:
$ CC=gcc-3.4 DEB_BUILD_OPTIONS="--enable-gui --enable-radio" fakeroot debian/rules binary
A complete example - mplayer
Let us see how to rebuild mplayer media player package with --enable-radio --disable-ivt options:
# sudo apt-get source mplayer
# sudo apt-get build-dep mplayer
# dpkg-source -x mplayer_version-revision.dsc
# DEB_BUILD_OPTIONS="--enable-gui --enable-radio --disable-ivt" fakeroot debian/rules binary
Now wait for some time as compile procedure going to take its own time. To install the newly-built package, enter:
# dpkg -i ../mplayer_version-revision_arch.deb
Q. I'd like to rebuild a Debian / Ubuntu package called foo with additional option. How do I recompile .deb packages?
A. To build a Debian package, you need the following packages / software installed on system:
Step #1: Install required packages Step #2: Install source code package First, create a directory to store source package, enter: Use apt-get command to install source code for a package called foo Install all build-dependencies, enter: Unpacks Debian / Ubuntu source archives with Debian source package (.dsc) manipulation tool, enter: To just compile the package, you need cd into foo-version directory and issue the command If you want to pass custom additonal options to configure, you can set up the DEB_BUILD_OPTIONS environment variable. For instance, if you want pass option called --enable-radio --enable-gui, enter: You can also pass some variables to the Makefile. For example, if you want to compile with gcc v3.4, enter: A complete example - mplayer Let us see how to rebuild mplayer media player package with --enable-radio --disable-ivt options: Now wait for some time as compile procedure going to take its own time. To install the newly-built package, enter: Fuente: http://www.cyberciti.biz/faq/rebuilding-ubuntu-debian-linux-binary-package/
Comentarios (0)
¡Sólo los usuarios registrados pueden escribir comentarios!
Joomla components by Compojoom
|
|
| Actualizado ( Domingo, 14 de Febrero de 2010 20:50 ) |
Tags
Contácto
Para contactarme puedes usar:
- Gmail:
cybercanibal *arroba*gmail.com
- ICQ: 13588975
- Yahoo messenger:
cybercanibal
- MSN messenger:
cybercanibal *arroba*hotmail.com



Google
Facebook
Twitter
Del.icoi.us
Blogger
Rain Concert 