5

How can i list all the files (and their future locations) which will be installed by invoking 'dpkg -i' on a .deb file? Which makefile target of the source package determines those (is it the default 'install' target?)

(The second part of the question concerns the package creation process. I want the list of files installed by 'make install' and the list of files installed by the .deb package to be the same)

Juliusz
  • 215

2 Answers2

6

You can list the contents of a deb file by running

dpkg-deb --contents package.deb

dpkg-deb can show a whole lot of information about a deb package. You can see the other options by running dpkg-deb --help.

Unfortunately, you can't determine what files a Makefile will install. However, you can install to a temporary directory by setting the DESTDIR variable. Note that this works well mainly on Makefiles generated by autotools ie. the ./configure script. For example:

cd sourcecode-1.2
./configure --prefix=/usr           #Just the usual compiling stuff
make
mkdir /tmp/installedfiles           #Create a temporary directory for the files
make DESTDIR=/tmp/installedfiles install

That last make line will install the files in /tmp/installedfiles. You can then see the files that would be created, although those files and directories will all be relative to the prefix specified in the configure script. In other words, /tmp/installedfiles/bin/mainprogram would be installed as /usr/bin/mainprogram.

I hope I answered your question :)

0

A deb file is an archive file which you can extract to see its contents.

From Wikipedia

Since Debian 0.93, a deb file is implemented as an ar archive. Canonical contents of this archive are three files:

  • debian-binary: deb format version number. This is "2.0" for current
    versions of Debian.
  • control.tar.gz: all package meta-information.

  • data.tar, data.tar.gz, data.tar.bz2, data.tar.lzma or data.tar.xz: the actual installable files.

The debian-binary file must be the first entry in the archive, otherwise it will not be recognized as a Debian package.

So when you extract a deb file you will get a data file i.e data.tar/data.tar.gz/data.tar.lzma/data.tar.xz. Extract this file and you will get all the files/directories that this deb will create or put files into.

binW
  • 13,194