Hi there, Package maintainers reading this might like to know a flexible method for extending system/cpu-specific package relationships in dpkg has been added to the debian archive in unstable. The package is called type-handling. Packages that need to check for DEB_*_GNU_SYSTEM and/or DEB_*_GNU_CPU in their package relation fields (e.g, Build-Depends, Depends..) can use the virtual Provides generated dynamicaly in this package instead of the standard DEB_*_ARCH hardcoded in dpkg. type-handling acts as a frontend to dpkg-architecture, which allows for checking of cpu and system separately. This is mostly advantageous for supporting the non-Linux-based ports. Refer to dpkg-architecture's documentation for details. Here are some examples on how you can use type-handling to improve portability of your packages: CPU detection example ~~~~~~~~~~~~~~~~~~~~~ Package foo requires bar to build, but only when foo is being built for i386 cpus. foo's debian/control reads: Build-Depends: bar [i386] But the [i386] above implies Linux, so if you want to support all kernels in Debian you'd have to maintain a continously growing list: Build-Depends: bar [i386 hurd-i386 ...] Here's how you would do it with type-handling: Build-Depends: bar | not+i386 That's all of it. type-handling provides a virtual package for the target cpu, system and type, but also a list of all cpus, systems, and types that do _not_ match the target preceded by the "not+" prefix. [1] [1] This feature only on type-handling >= 0.1.0, currently in incoming. System detection example ~~~~~~~~~~~~~~~~~~~~~~~~ This one is mostly analogous to the previous example, so I'll be brief. Package gdb build-depends on mig which is only needed when building on GNU/Hurd: Build-Depends: mig [hurd-i386] Everytime Debian GNU/Hurd is ported to a new CPU, we'll have to add it to the list: Build-Depends: mig [hurd-i386 fubar-i386 ...] Instead, you could just use type-handling: Build-Depends: mig | not+gnu Whereas not+gnu is a virtual package provided by type-handling on all systems but GNU/Hurd, on any architecture. -- Robert Millan "[..] but the delight and pride of Aule is in the deed of making, and in the thing made, and neither in possession nor in his own mastery; wherefore he gives and hoards not, and is free from care, passing ever on to some new work." -- J.R.R.T., Ainulindale (Silmarillion)
Attachment:
signature.asc
Description: Digital signature