[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get source questions



On Sun, Apr 16, 2006 at 09:24:43PM -0400, Chris Jones wrote:
[..]
>>>2. Can I just remove the source tree after having installed the
>>>binary .deb without breaking anything? Or is there a recommended
>>>'debian way' to clean up?
>>If you build the source packages at the same time as you build the
>>binary one you can delete the source directory without losing any
>>information.
>
>Now that's interesting. Could you explain this "at the same time"
>further? There is something in the apt HOWTO that also says something
>about some kind of time factor. Suggesting it's different when you
>build the binary package and install it at a later date.
>
>"To auto-build the package when it's been downloaded, just add -b to
>the "command line, like this:
>"
>"     $ apt-get -b source packagename
>"
>"If you decide not to create the .deb at the time of the download, you
>"can create it later by running:
>"
>"     $ dpkg-buildpackage -rfakeroot -uc -b
>
>It bothered me because I did not understand what the author meant.
>
>Would this have anything to do with the apt build-dep? Running that
>command on my (live) system also bothered me because I have no clue
>what it does. I got out of rpm hell a year ago and I find anything that
>might endanger the health of my system rather scary.

OK. I'll try my best to answer this :-)

First of all, I _never_ use `apt-get -b source <pkg_name>`. I am happy
using the pre-built binary packages. I only re-compile Debian packages
when I need to change some build-time configuration options. These are
the steps I follow:

 1. `apt-get source <pkg_name>` in an empty directory.
 2. Move into the package's build directory.
 3. Change the build version (`dch` + editing debian/changelog, I
    usually add 'mt' rather than bump the build version).
 4. Make any changes I want to the build steps and the source itself.
 5. Use `debuild` to build both binary and source packages (they end up
    in '..', i.e. in the download directory).

I hope it now is clear what I mean with "build the source packages".
Since I've bumped the build version I keep the original source packages
as well. After this you can delete the directory with the sources since
you can recreate it using the source package.


AFAIK a Debian source package consists of three files, .dsc, .tar, and
.diff. You can use `dpkg-source -x <pkg>.dsc` to unpack them. You can
use `dpkg-buildpackage` to build the binary and source packages.

I hope that clears up what you read.


`apt-get build-dep` will download and install all packages that a
specific source package has as its build-dependencies. E.g. on my system
`apt-get build-dep` installed libncursesw5-dev.

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus@therning.org
http://therning.org/magnus

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

The day after tomorrow is the third day of the rest of your life.

Attachment: pgp5DowPZmHDR.pgp
Description: PGP signature


Reply to: