Install a .deb package with dpkg-deb without creating the usr folder

I am installing a debian package using dpkg-deb on Ubuntu 20.04.3 LTS (64-bit). I want to install it in a specific directory, called software. Inside this directory I have already the bin, the share, the include, the lib directories.

Here's how I tried to install the package:

wget http://ftp.br.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3+b1_amd64.deb
dpkg-deb -x libcurl4_7.74.0-1.3+b1_amd64.deb /gpfs/software

The /gpfs/software directory is the one where I want to install it. The result of this operation is an error-less installation. However, it creates a directory named usr contained inside the software directory. Inside usr, you'll find lib and share which I already have inside `software. Like this:

.
└── software
    ├── bin
    ├── include
    ├── lib
    ├── share
    │   └── man
    └── usr
        ├── lib
        └── share

My question is: how can I tell dpkg-deb to put the contents of software/usr/lib and of software/usr/share inside software/lib and software/share?


You cannot tell that. dpkg-deb installs the .deb package according to how it is packaged. It is the packager of the .deb package that decides how files are arranged. You only can decide on the parent directory where it is installed (/gpfs/software in your example).

You would need to repackage the software yourself in a different .deb package in order to change this.