Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to make a package that will install on Ubuntu 12.04 - 13.* on 1386 and amd64. I've figured out that on the amd64 the only difference is that I need to install the 32 bit libraries. depending on ia32-libs works when the system has it (even though it is overkill) but 13.* does not even have that package. Therefore I am trying to install via the ':i386' extension. When I do sudo apt-get install blah:i386 ...etc it works fine.

The following control file yields the message: "Dependency not satisfiable: libgcc1:i386" on 12.04.

Package: foo
Version: 1.0-1
Section: base
Priority: optional
Maintainer: bar@gmail.com
Architecture: all
Depends: libgcc1:i386, gcc-4.6-base:i386, libstdc++5:i386, libstdc++6:i386, libsasl2-2:i386, libgstreamermm-0.10-2:i386, libfreetype6:i386,
 libfontconfig1:i386, libX11-6:i386, libXrender1:i386, libice6:i386, libxext6:i386, libsm6:i386
Description: foo is awesome
 Foo is really awesome
Installed-Size: 71140

Therefore as per a few other places say, I made the following control file:

Package: foo-amd64
Version: 1.0-1
Section: base
Priority: optional
Maintainer: bar@gmail.com
Architecture: amd64
Depends: foo, libgcc1:i386, gcc-4.6-base:i386, libstdc++5:i386, libstdc++6:i386, libsasl2-2:i386, libgstreamermm-0.10-2:i386, libfreetype6:i386,
 libfontconfig1:i386, libX11-6:i386, libXrender1:i386, libice6:i386, libxext6:i386, libsm6:i386
Description: foo is awesome
 Foo is really awesome
Installed-Size: 71140

Package: foo
Version: 1.0-1
Section: base
Priority: optional
Maintainer: bar@gmail.com
Architecture: i386
Depends: gksu
Multi-Arch: foreign
Description: foo is awesome
 Foo is really awesome
Installed-Size: 71140

This control file wont even compile as I get the following error message: dpkg-deb: error: parsing file 'foo/DEBIAN/control' near line 25 package 'foo': several package info entries found, only one allowed. How do I do this correctly?

EDIT: This package does not come with the source. It comes with compiled 32 bit binaries, hence the need to depend on the 32 bit version of the libraries.

share|improve this question
    
Example with multi-arch: gh12009.net78.net/control More useful information: manpages.ubuntu.com/manpages/precise/man5/deb-control.5.html –  Gustaf Dec 26 '13 at 18:09
add comment

1 Answer 1

You don't need to create separated packages name to get multiarch. Just type:

Package: foo-amd64
Version: 1.0-1
Section: base
Priority: optional
Maintainer: bar@gmail.com
Architecture: any
Multi-Arch: same
Depends: foo, libgcc1, gcc-4.6-base, libstdc++5, libstdc++6, libsasl2-2, libgstreamermm-0.10-2, libfreetype6,
 libfontconfig1, libX11-6, libXrender1, libice6, libxext6, libsm6
Description: foo is awesome
 Foo is really awesome
Installed-Size: 71140

That should build both, amd64 and i386 packages depending your build environment variable. There are various ways you can convert your packages to multiarch if you use the recipes instead:

dh(1) and autotools

The simplest package to convert is one that uses autoconf upstream and dh(1) in the Debian packaging.

  1. Build-depend on debhelper (>= 9).
  2. Add Pre-Depends: ${misc:Pre-Depends} to any package listed in debian/control that provides a shared library.
  3. Update debian/compat to '9'.
  4. Replace occurrences of /usr/lib/ in debian/.install with /usr/lib//.
  5. If /usr/lib (or a subdirectory) is listed as an installation target in debian/.install, or the target of a link in debian/.links, you will need to substitute the value of $(DEB_HOST_MULTIARCH) into this file. See Dynamic debian/* files below.
  6. Any occurrences of /usr/lib in debian/rules should be replaced with /usr/lib/$(DEB_HOST_MULTIARCH).
  7. If you needed to use $(DEB_HOST_MULTIARCH) in debian/rules in either of the two preceding steps, set DEB_HOST_MULTIARCH in debian/rules by calling: DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH).
  8. Once you have built the package and verified that the shared library package contains only the expected files, and that your -dev package still works, mark this shared library package Multi-Arch: same in debian/control.
  9. Mark the common package(which is "all") Multi-Arch: foreign in debian/control, if it may be needed by the shared library package.

If you have overridden debhelper commands in debian/rules, despite using dh(1) for the rest of the build, you may need to follow the instructions below for classic debhelper to modify mv, cp or rm commands used by your override rules.

There are more examples in the Debian packaging implementation guide https://wiki.debian.org/Multiarch/Implementation. You may also use lithian to make sure your package in completely compliance.

share|improve this answer
    
Ah, the critical difference I forgot to mention is that this package does not come with the source. It comes with compiled 32 bit binaries, hence the need to depend on the 32 bit version of the libraries. –  chacham15 Dec 26 '13 at 18:28
    
@chacham15 exactly what package are you trying to install? –  Braiam Dec 26 '13 at 18:32
    
A program that I created (and cannot release source code for). –  chacham15 Dec 26 '13 at 18:33
    
Wait, I'm telling you how to repackage the binary/sources/whatever. If your program doesn't support amd64 you should only modify the aspects of the packaging as I described. –  Braiam Dec 26 '13 at 19:27
    
No, it supports amd64 but requires those additional dependencies. Those dependencies, however, as stated above fail to be recognized. –  chacham15 Dec 26 '13 at 19:29
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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