def add_npy_pkg_config(self, template, install_dir, subst_dict=None):
if subst_dict is None:<EOL><INDENT>subst_dict = {}<EOL><DEDENT>basename = os.path.splitext(template)[<NUM_LIT:0>]<EOL>template = os.path.join(self.package_path, template)<EOL>if self.name in self.installed_pkg_config:<EOL><INDENT>self.installed_pkg_config[self.name].append((template, install_dir,<EOL>subst_dict))<EOL><DEDENT>else:<EOL><INDENT>self.installed_pkg_config[self.name] = [(template, install_dir,<EOL>subst_dict)]<EOL><DEDENT>
Generate and install a npy-pkg config file from a template.

The config file generated from `template` is installed in the
given install directory, using `subst_dict` for variable substitution.

Parameters
----------
template : str
    The path of the template, relatively to the current package path.
install_dir : str
    Where to install the npy-pkg config file, relatively to the current
    package path.
subst_dict : dict, optional
    If given, any string of the form ``@key@`` will be replaced by
    ``subst_dict[key]`` in the template file when installed. The install
    prefix is always available through the variable ``@prefix@``, since the
    install prefix is not easy to get reliably from setup.py.

See also
--------
add_installed_library, get_info

Notes
-----
This works for both standard installs and in-place builds, i.e. the
``@prefix@`` refer to the source directory for in-place builds.

Examples
--------
::

    config.add_npy_pkg_config('foo.ini.in', 'lib', {'foo': bar})

Assuming the foo.ini.in file has the following content::

    [meta]
    Name=@foo@
    Version=1.0
    Description=dummy description

    [default]
    Cflags=-I@prefix@/include
    Libs=

The generated file will have the following content::

    [meta]
    Name=bar
    Version=1.0
    Description=dummy description

    [default]
    Cflags=-Iprefix_dir/include
    Libs=

and will be installed as foo.ini in the 'lib' subpath.