0

I wonder how linux distros like Debian, Red Hat, Gentoo, Ubuntu make many binary packages from one package? When I compile package, they just become install all in one. So my questions are:

How do they separate them?

How do they figure out their dependencies?

3
  • 3
    An example of what you mean would be good.
    – Kusalananda
    May 24, 2020 at 7:53
  • @Kusalananda I mean in Debian, gcc , g++ , libstdc++ package is built from one source package GCC. May 24, 2020 at 9:23
  • Example library : name, name-dev → Run time only is required, so "name-dev" is not installed. ... Example gcc : You don't need e.g. {gnat gccgo gfortran}, but gcc only : apt install gcc libc6-dev linux-libc-dev ... or apt install g++ May 24, 2020 at 19:59

1 Answer 1

1

When distribution packages are built, the artifacts aren’t installed directly in their target locations. Instead, they are installed to a temporary location, and the packages are built using the contents there.

For source packages which build multiple binary packages, the last step above is split into multiple target packages. Each target package lists the files it’s supposed to contain. See the various .install files in my libevdev package for example; the libevdev build installs the following files:

debian/tmp/usr/include/libevdev-1.0/libevdev/libevdev.h
debian/tmp/usr/include/libevdev-1.0/libevdev/libevdev-uinput.h
debian/tmp/usr/lib/x86_64-linux-gnu/libevdev.la
debian/tmp/usr/lib/x86_64-linux-gnu/libevdev.a
debian/tmp/usr/lib/x86_64-linux-gnu/libevdev.so.2.3.0
debian/tmp/usr/lib/x86_64-linux-gnu/pkgconfig/libevdev.pc
debian/tmp/usr/bin/libevdev-tweak-device
debian/tmp/usr/bin/mouse-dpi-tool
debian/tmp/usr/bin/touchpad-edge-detector
debian/tmp/usr/share/man/man3/libevdev.3

(the equivalent of what you’d get by installing with sudo make install), and these are split up into

  • libevdev2:

    /usr/lib/x86_64-linux-gnu/libevdev.so.2.3.0
    
  • libevdev-dev:

    /usr/include/libevdev-1.0/libevdev/libevdev.h
    /usr/include/libevdev-1.0/libevdev/libevdev-uinput.h
    /usr/lib/x86_64-linux-gnu/libevdev.a
    /usr/lib/x86_64-linux-gnu/pkgconfig/libevdev.pc
    /usr/share/man/man3/libevdev.3
    
  • libevdev-tools:

    /usr/bin/libevdev-tweak-device
    /usr/bin/mouse-dpi-tool
    /usr/bin/touchpad-edge-detector
    

(The udeb is a special case, probably not worth discussing here.)

Not the answer you're looking for? Browse other questions tagged or ask your own question.