[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: all, any, alpha -- how to build them? (package split)



Hi Helge,

On Fri, Nov 28, 2003 at 09:46:15AM +0100, Helge Kreutzmann wrote:

> Hello,
> I help to work on a existing Debian package (aboot) which currently
> only exits for alpha. Since it is boot related, there are requests
> (as bugs) to split off part of the package which can be built on any
> architecture besides alpha into a "any" packet.

> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=211777

> Currently my patch has three targets: One all-target (aboot-base)
> which contains files (no binaries) which can be built only on alpha
> but are required for other architectures as well, so it is
> architecture "all" (I read autobuilders never build those, so an
> alpha upload of them does the job).  One target "any" (currently
> labled isomarkboot) which contains binaries for any architecture, and
> lastly "aboot" itself which contains the rest which does not make
> sense to port (of no use on other archs and besides contains alpha
> specific assembly).

> So my debian/rules currently contains the following targets:
> build:
>     # We do nothing here

> build-aboot: build-aboot-stamp
> build-aboot-base: build-aboot-base-stamp
> build-isomarkboot: build-isomarkboot-stamp

> build-aboot-stamp:
>    # Some code

> build-aboot-base-stamp:
>    # Some code

> build-isomarkboot-stamp:
>    # Some code

> clean:
>    # Some code

> install-aboot: install-aboot-stamp
> install-aboot-base: install-aboot-base-stamp
> install-isomarkboot: install-isomarkboot-stamp

> install-aboot-stamp: build-aboot-stamp
>   # Some code

> install-aboot-base-stamp: build-aboot-base-stamp
>   # Some code

> install-isomarkboot-stamp: build-isomarkboot-stamp
>   # Some code

> # Build architecture-independent files here.
> binary-indep: build-aboot-base install-aboot-base
> # We have nothing to do besides calling targets (?)

> # Build architecture-dependent files here.
> binary-arch: build-aboot build-isomarkboot install-aboot install-isomarkboot
>    # Here I do all the packaging stuff (no -p required)

> binary: binary-indep binary-arch
>    # Some code

> Although my debian/control says:
> Package: aboot
> Architecture: alpha
> it is ignored when I run "dpkg-buildpackage -uc -b -rfakeroot", i.e. on
> i386 the target build-aboot is attempted and of course, the build fails.
> Manually calling make -f debian/rules build-isomarkboot works fine (though
> of course no package itself is made). On alpha all three targets work, all
> three packages are created and contain the proper contents, linda and lintian
> are completely happy.

> So my question is: How do I build this on non-alpha archs or, if my layout
> is wrong (though I read policy to understand how it works), how do I properly
> create the targets in debian/rules so that I can build the isomarkboot-package
> (and only this one) on other architectures?

> Please CC: me as I am not subscribed, thanks.

> Thanks for info && pointers.

The Architecture: tag in debian/control ensures that it's not considered
an error if no contents are found for the aboot package at the time the
binary target is run.  However, you must still construct your
debian/rules file so that it Does The Right Thing on every arch when the
policy targets (build, binary, binary-indep, etc.) are called.

DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq (alpha-linux,$(DEB_HOST_GNU_TYPE))
build-arch: build-aboot
build-indep: build-aboot-base
endif

build-arch: build-isomarkboot
build-indep:

build: build-arch build-indep

binary-arch: install-isomarkboot
binary-indep: 

ifeq (alpha-linux,$(DEB_HOST_GNU_TYPE))
binary-arch: install-aboot
binary-indep: install-aboot-base
endif

binary: binary-arch binary-indep


This could probably be further simplified, depending on what targets you
really want to support directly (e.g., 'build-isomarkboot' wouldn't
necessarily need its own target, the rules could just be included under
'build-arch'; but having a separate 'build-aboot' target might make the
conditional easier to read).

And thanks for working on this bug.  If you need another set of eyeballs
on your rules once you have them put together, let me know.

Cheers,
-- 
Steve Langasek
postmodern programmer

Attachment: signature.asc
Description: Digital signature


Reply to: