On Wed, Aug 21, 07:37, Helmut Grohne wrote:

> > I tried that on two debian-12 systems. First I built lopsub with
> > your patch applied on the i386 system, copied over the resulting
> > -bin.deb to the amd64 system, and ran dpkg --add-architecture i386
> > there. Attempting to install the -bin.deb package fails because
> > liblopsub1t64:i386 is not installed, and trying to install that
> > results in:
> > 
> >     # dpkg -i liblopsub1t64_1.0.5-1.1_i386.deb 
> >     dpkg: regarding liblopsub1t64_1.0.5-1.1_i386.deb containing 
> > liblopsub1t64:i386:
> >      liblopsub1t64:i386 breaks liblopsub1 (<< 1.0.5-1.1)
> >       liblopsub1 (version 1.0.3-2) is present and installed.
> > 
> >     dpkg: error processing archive liblopsub1t64_1.0.5-1.1_i386.deb 
> > (--install):
> >      installing liblopsub1t64:i386 would break liblopsub1, and
> >      deconfiguration is not permitted (--auto-deconfigure might help)
> >     Errors were encountered while processing:
> >      liblopsub1t64_1.0.5-1.1_i386.deb
> > 
> > Any hints?
> 
> My patch has an important omission. Thanks for testing. liblopsub1t64
> should be marked "Multi-Arch: same". That annotation tells the package
> manager that this package can be installed multiple times for different
> architectures concurrently. On tracker.d.o, you see a note from the
> multiarch hinter about this. For that to work, the versions have to
> match up exactly, so you'll also need an amd64 build for testing this.

Indeed, with "Multi-Arch: same" added to debian/control it is
possible to build tfortune on an amd64 system using the i386 version
of lopsubgen.

> > > You may also just upload to experimental. Then you can try your change
> > > there and since upgrading from experimental to unstable is not generally
> > > supported, you may just revert it (without Breaks+Replaces) in case it
> > > does not work out. Once uploaded, you may try cross building tfortune
> > > against the experimental liblopsub.
> > 
> > Good to know. But this is more complicated since I'd always need somebody
> > to sponsor the upload.
> 
> Please keep in mind that NEW uploads must be binary (ftp master
> requirement) and that in order for your upload to migrate to testing, it
> must not be binary. Hence you usually need two uploads anyway. liblopsub
> may get away with a binNMU request as it does not build any Arch:all
> packages. Going through experimental for NEW uploads generally is
> recommended practice still.

Then let's go through experimental. The patch shown below is identical
to the one you sent, except that I added the missing "Multi-Arch:
same" line, fixed a typo in debian/control (converstion) and provided a
commit message, using your original mail as the basis. If this looks
good to you, I'll push the change to the public repo for you to pick
up so that you can perform the necessary uploads.

Thanks
Andre
---
commit f9f4bdbf1dbaf3d9cd06243184ad33c311f91d7e
Author: Helmut Grohne <hel...@subdivi.de>
Date:   Tue Aug 20 15:11:10 2024 +0000

    debian: Make liblopsub-dev usable for cross compilation.
    
    In order to build a package such as tfortune which depends on the
    lopsub library, we need the liblopsub shared library for the host
    architecture, and we also need to run lopsubgen as a build architecture
    executable. These things currently reside in the same binary package,
    but for a cross build we need them to be installed for different
    architectures.
    
    This patch splits liblopsub-dev. The new liblopsub-bin package only
    contains lopsubgen and its man page. Since the -dev package depends
    on the -bin package, all existing uses will continue to work as
    is. For a cross build, liblopsub-dev will continue to be installed
    for the host architecture. liblopsub-bin will be installed for the
    build architecture though as it will be marked Multi-Arch: foreign,
    indicating that the architecture of the package does not matter for
    interactions with it.
    
    V2: Add missing "Multi-Arch: same" for liblopsub1t64, fix typo

diff --git a/debian/changelog b/debian/changelog
index af14609..a13d08e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+liblopsub (1.0.5-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Split lopsubgen into a Multi-Arch: foreign package. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Fri, 16 Aug 2024 19:03:09 +0200
+
 liblopsub (1.0.5-1) unstable; urgency=medium
 
   * prefer https:// over http:// and git://
diff --git a/debian/control b/debian/control
index 0216b98..668fbd9 100644
--- a/debian/control
+++ b/debian/control
@@ -14,6 +14,7 @@ Provides: ${t64:Provides}
 Replaces: liblopsub1
 Breaks: liblopsub1 (<< ${source:Version})
 Architecture: any
+Multi-Arch: same
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: Long Option Parser for Subcommands
  Lopsub  is  an  open  source library written in C which aims to ease
@@ -28,7 +29,7 @@ Description: Long Option Parser for Subcommands
 
 Package: liblopsub-dev
 Architecture: any
-Depends: ${shlibs:Depends}, liblopsub1t64 (= ${binary:Version}), 
${misc:Depends}
+Depends: ${shlibs:Depends}, liblopsub1t64 (= ${binary:Version}), 
${misc:Depends}, liblopsub-bin (= ${binary:Version})
 Description: Long Option Parser for Subcommand - headers
  Lopsub  is  an  open  source library written in C which aims to ease
  the task of creating, documenting and parsing the options of Unix
@@ -40,3 +41,21 @@ Description: Long Option Parser for Subcommand - headers
  supports single-character short options and GNU-style long  options.
  The public API is well documented and stable.
  This package contains the development environment for the lopsub library.
+
+Package: liblopsub-bin
+Architecture: any
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, liblopsub1t64 (= ${binary:Version}), 
${misc:Depends}
+Breaks: liblopsub-dev (<< 1.0.5-1.1~)
+Replaces: liblopsub-dev (<< 1.0.5-1.1~)
+Description: Long Option Parser for Subcommand - generator
+ Lopsub  is  an  open  source library written in C which aims to ease
+ the task of creating, documenting and parsing the options of Unix
+ command line utilities. It is suitable for simple commands as well
+ as complex command line utilities with many subcommands where  each
+ subcommand  has its own set of options. Options and documentation are
+ kept together in a single file which can be translated to C code (to
+ be included in the application), or to a manual page.  The library
+ supports single-character short options and GNU-style long  options.
+ The public API is well documented and stable.
+ This package contains the lopsubgen conversion utility.
diff --git a/debian/liblopsub-dev.install b/debian/liblopsub-dev.install
index 8e6c62d..773fd2a 100644
--- a/debian/liblopsub-dev.install
+++ b/debian/liblopsub-dev.install
@@ -1,5 +1,3 @@
 usr/include/*
 usr/lib/*/liblopsub.so
-usr/bin/lopsubgen
-usr/share/man/man1/lopsubgen*
 usr/share/man/man5/lopsub-suite*
diff --git a/debian/rules b/debian/rules
index ddb503d..4f5f5ca 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,7 @@
 
 package := liblopsub1t64
 devpackage := liblopsub-dev
+binpackage := liblopsub-bin
 
 define checkdir
        @test -f debian/rules -a -f lopsub.c || \
@@ -47,6 +48,8 @@ binary: build
        mv $(TMPDIR)/usr/lib-$(TRIPLET) $(TMPDIR)/usr/lib/$(TRIPLET)
        dh_install -p $(package)
        dh_install -p $(devpackage)
+       dh_install -p $(binpackage)
+       dh_link -p $(binpackage)
        dh_lintian
        $(MAKE_DIR) $(DESTDIR)/DEBIAN $(DOCS_DIR) $(DEVDOCS_DIR)
        echo 'activate-noawait ldconfig' > $(DESTDIR)/DEBIAN/triggers
-- 
Max Planck Institute for Biology
Max-Planck-Ring 5, 72076 Tübingen, Germany. Phone: (+49) 7071 601 829
http://people.tuebingen.mpg.de/maan/

Reply via email to