Search code examples
debianpackagedpkglintian

Debian package : where is the right place to put temporary installation files?


I am trying to build a binary package for Debian (with dpkg-deb --build) and I need to copy some files into the target machine to complete the installation with a postinst script (and remove them just after).

But I don't know where to put them.

I have tried /tmp/mypkg, /bin/mypkgtmp/, /usr/share/mypkg/tmp. But Lintian has produced error/warning for all of them :

It's a directory with some binaries so the only place I can use seems to be /usr/bin/mh.

But /usr/bin/mh seems to be related to mail handling (not really clear).

What's the right place to put my temporary files without producing a Lintian error or warning ?

Here is my actual tree :

.tmp
├── DEBIAN
│   ├── control
│   └── postinst
└── usr
    ├── bin
    │   ├── mypkg
    │   └── mh
    │       └── mypkgtmp
    │           ├── build
    │           │   └── lib.linux-x86_64-3.4
    │           │       ├── myClib.cpython-34m.so
    │           │       └── mytools.py
    │           └── setupCython.py
    └── share
        └── doc
            └── mypkg
                ├── changelog.gz
                └── copyright

Thx.


Solution

  • You can put files in /usr/lib/mypkg/ and just leave them there even if they are not necessary or useful after postinst.

    There is a (weak) hint that the packager may opt for convenience to use this for both architecture-independent and architecture-dependent files in Policy section 9.1.1 though of course your specific postinst scenario isn't covered there.