Get a debian directory out of a source package
-
19-09-2019 - |
Question
I'm trying to decompile a source package because I want to look at the preist en prerm files. Those files are normally in the debian folder but when I extract the source package I don't find any debian folder. Is there a simple command or other way to get the debian folder?
Thanks in advance
Solution
If you want to to it from the source for package foo:
apt-get source foo
which will get the .orig.tar.gz
, the .dsc
with control information and the .diff.gz
with Debian changes (if any) and the debian/
directory added to the source for the build. It will have (pre|post)(inst|rm)
files too.
From the .deb
binary, you can use ar
and tar
as per the other answer.
OTHER TIPS
try ar x [dpkg-package]
(where dpkg-package is the binary-package) which generates a control.tar.gz
which contains the postinst
(and other) files.
It is actually simple: The debian subdirectory is only there in the source for dpkg, i.e. it is a meta-directory used by dpkg, and dpkg will look at it and build the final .deb, where there is only a textfile "debian-binary", a "data.tar.gz" and a "control.tar.gz".
To get the initial "debian" directory, you would have to look at the upstream source control, or ask the maintainer/s of the package.
Try
apt-get source packagename
this will download the file and decompress it, along with debian specific files.