From d48d5327798befb66cee5ab08ab253449e431d5c Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 20 Aug 2024 15:11:10 +0000 Subject: [PATCH] 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. V3: Edit debian/changelog since this is no longer an NMU, add signed-off-by V2: Add missing "Multi-Arch: same" for liblopsub1t64, fix typo Signed-off-by: Andre Noll --- debian/changelog | 10 ++++++++++ debian/control | 21 ++++++++++++++++++++- debian/liblopsub-dev.install | 2 -- debian/rules | 3 +++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index af14609..dc53520 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +liblopsub (1.0.5-2) experimental; urgency=medium + + [ Helmut Grohne ] + * Split lopsubgen into a Multi-Arch: foreign package. Closes: #1078823 + + [ Andre Noll ] + * Mark liblopsub1t64 Multi-Arch: same. + + -- Andre Noll Mon, 26 Aug 2024 16:21:14 +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 -- 2.39.5