emvendor(1) retrieve vendor-specific package configuration strings

Synopsis

 emvendor -V|--vendor VENDOR -p|--package PACKAGE -k|--key KEY
 emvendor -?|-h|--help|--version

Commands

 -v|--vendor VENDOR:    the vendor name from dpkg-vendor
 -p|--package PACKAGE:  the package name (usually source)
 -k|--key KEY:          arbitrary string for the key of the data

All commands must be specified every time.

On success, the string is printed and emvendor exits with zero.

In the case of error, emvendor dies with an empty string on STDERR and exits with a non-zero return value.

Description

emvendor provides a way for debian/rules to call in a string for a particular package that fits into the rules for that package and conforms to the requirements of the vendor.

http://wiki.debian.org/EmdebianAuditDetail#Vendor

It is fairly obvious that specifying each vendor in the debian/rules file of each package is not going to be particularly flexible.

 DEB_VENDOR=$(shell dpkg-vendor --query vendor)
 ifeq (Debian,$(DEB_VENDOR))
  # Debian build
  EXCONFARGS=--disable-mono --disable-monodoc
 else
  # any-vendor build
  EXCONFARGS=$(shell emvendor --vendor $(DEB_VENDOR) --package avahi --key EXCONFARGS)
 endif

or use the short options:

 EXCONFARGS=$(shell foo-bar -V $(DEB_VENDOR) -p avahi -k EXCONFARGS)

The values themselves are in a vendor-specific conf file in /etc/emvendor.d/

 $ cat /etc/foo-bar.d/emdebian-crush
 [avahi]
 EXCONFARGS=--disable-mono --disable-monodoc --disable-python
 --disable-doxygen-doc --disable-pygtk --disable-python-dbus
 --disable-core-docs --disable-qt3 --disable-qt4 --disable-gobject
 --with-distro debian 
 [busybox]
 foo=

(Note that the value has to be all on one line which is a little awkward - also note that values are not able to include the equals sign which could be more of an issue.)

Packages that need two strings can do so - the key string is entirely arbitrary as long as it fits in the style of a typical ini file.

Therefore, the key can be matched to the needs of the relevant package.

"emdebian-buildsupport" provides /etc/emvendor.d/emdebian-crush with all the content for all packages that need such details.

emvendor and dpkg-vendor

dpkg-vendor supports vendor functionality but emvendor adds an extra hierarchy, organised by Debian source package name. It would be possible to include the relevant strings in /etc/dpkg/origins/vendor but each identifier string would need to be unique across all packages for each vendor, which is an unrealistic limitation.