2

I am building a custom package for Debian which I then intend to deploy to other machines. To keep things simple, I'm just installing the .deb file directly with dpkg -i.

According to the Debian Policy Manual you can use the special words all for an architecture-independent package, and any for an architecture-dependent package that can be built for any number of different architectures.

So I have gone ahead and written Architecture: any in my control file, however when I go to install the package, I get this error:

 package architecture (any) does not match system (amd64)

Why is the package being created for the any architecture? This is not an architecture-independent package (which is why I didn't write all), so it looks like dpkg is not replacing any with the architecture the package was compiled for.

What is the correct way to specify that a package is platform-specific but it can be built for all available platforms? I don't want to have to list all of them, there are hundreds!

UPDATE: The build process is a simple configure && make && make install PREFIX=/xyz and then I'm making the package with fakeroot dpkg -b /xyz /output

Is there a standard way to replace 'any' with the current architecture automatically, or should I e.g. be using sed to modify the control file?

6
  • It's not dpkg that has to replace any with the name of the actual architecture, but the build process. Please show us (editi it in to the question), the actual commands you use, and preferably their output (there can be a lot of output from building, so please filter it. Commented Aug 15, 2016 at 6:28
  • Thanks for the info. I've updated the question. dpkg produces little output (just the name of the .deb file with the architecture as any) and the configure process is much the same as any other.
    – Malvineous
    Commented Aug 15, 2016 at 6:38
  • 1
    That is not a good way of building debian packages. As far as I could gather from a quick look at the manpage for dpkg-deb (the man page for dpkg refers to that for the -b option) all it does is wrap things up in a .deb file. Please read (debian.org/doc/manuals/maint-guide/)[Debian New Maintainers' Guide]. Commented Aug 15, 2016 at 7:49
  • Yes this isn't a good way of building Debian packages, but I suppose that's not really what I'm doing. I'm using dpkg as a convenient way to deploy custom software to a Debian machine, with dpkg taking care of removing old files after an upgrade and installing dependencies. I guess the answer in this case is to use sed then?
    – Malvineous
    Commented Aug 15, 2016 at 8:56
  • 1
    If you want to use dpkg you have to build debian packages! Trying to use it for anything else is a way of f*cking your system. Commented Aug 15, 2016 at 12:12

1 Answer 1

1

The problem is that you are creating raw packages without any of the tooling to build them, contained in the dpkg-dev package. The usual way to generate binary packages is with a source package, which would contain the master control file where any is a valid architecture, that then gets transformed into the correct one by dpkg-gencontrol which gets called from debian/rules.

In any case I'd either recommend reading about packaging in the developers-reference or similar documents, both in case you decide to do standard packaging or if you decide to reimplement it from scratch.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .