---
name: "Debian::DpkgCross"
section: "3"
platform: "linux"
package: "libdebian-dpkgcross-perl"
version: "2.6.20"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Debian::DpkgCross"
---

# Debian::DpkgCross(3)

Package of dpkg-cross commonly used functions The 2.x series of dpkg-cross is seeking to achieve its own removal by incorporating as much cross-building support as possible into dpkg itself. The number, scope and range of functions supported by this package is therefore only going to decrease. Any newly-written code using this package will need to keep up with changes in dpkg. Developers are recommended to join the debian-dpkg and debian-embedded mailing lists and keep their code under review.

## Name

Debian::DpkgCross - Package of dpkg-cross commonly used functions

The 2.x series of dpkg-cross is seeking to achieve its own removal by incorporating as much cross-building support as possible into dpkg itself. The number, scope and range of functions supported by this package is therefore only going to decrease. Any newly-written code using this package will need to keep up with changes in dpkg. Developers are recommended to join the debian-dpkg and debian-embedded mailing lists and keep their code under review.

## Copyright and License

```
 Copyright (C) 2004  Nikita Youshchenko <yoush@cs.msu.su>
 Copyright (C) 2004  Raphael Bossek <bossekr@debian.org>
 Copyright (c) 2007-2009  Neil Williams <codehelp@debian.org>
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
```

## Bugs

Please report bugs via the Debian Bug Tracking System.

## Support

All enquiries to the `"<debian-embedded@lists.debian.org"`\> mailing list.

## MAKEFLAGS

See bug #437507 Even if the other flags are needed CC, GCC and other compiler names should \*NOT\* be overridden in `$ENV`{'MAKEFLAGS'} because this prevents packages compiling and running build tools using CC\_FOR\_BUILD. CDBS packages need to declare an empty override variable in debian/rules:

```
 DEB_CONFIGURE_SCRIPT_ENV=
```

Depending on progress with dpkg cross-building support, the remaining overrides may also be removed. Do not rely on these being set.

## read\_config

Read '$conffile' and save the definition in global variables all recognised variables.

'$crossroot' will be set by **setup()**. Until **setup()** is called all "crossroot-\<arch\>" settings are stored within '%allcrossroots'.

All package variables are stored within '%conf'.

No variables are skipped.

return: none

## get\_config

Return the current configuration from read\_config as a hash reference.

## get\_version

Return the current DpkgCross version string used by all dpkg-cross scripts.

## dump\_debug\_data

Return a hashtable of assorted debug data collated during the current run that can be processed using Data::Dumper.

## rewrite\_pkg\_name

Converts a package name into the dpkg-cross package name.

`$1` - the package name to check and convert if needed return - the cross-package name

## convert\_filename($)

Converts an original .deb filename into the dpkg-cross .deb filename or converts a dpkg-cross .deb filename into the original .deb filename.

returns undef on error

## get\_architecture

Returns the current architecture.

return: Current architecture or empty if not set.

## check\_arch($arch)

Checks that the supplied `$arch` is (or can be converted to) a DEB\_HOST\_GNU\_TYPE that can be supported by dpkg-cross.

returns the DPKG\_HOST\_GNU\_TYPE or undef

## setup

Set global variables '$arch', '$crossbase', '$crossbin', '$crosslib32', '$crossdir', '$crossinc', '$crosslib', '$crosslib64', '$crossprefix', '$compilerpath' and '$deb\_host\_gnu\_type' to defaults and substitute them with variables from '%conf' and '$arch'.

return: none

## create\_tmpdir($basename)

Safely create a temporary directory

```
 $1: Directory basename (random suffix will be added)
```

return: Full directory pathname, undef if failed

## convert\_path($multiarch, $path)

Convert path, substituting '$crossinc', '$crosslib', '$crosslib64', '$crosslib32', '$crossdir', allowing for multiarch paths. This function will  be used while building foreign binary packages or converting GCC options.

```
 $1: Multiarch sub-directory to strip
 $2: Directory (and file) to convert.
```

return: Converted path.

## simplify\_path($path)

Simplify path. Remove duplicate slashes, "./", "dir/..", etc

`$1:` Path to simplify.

return: Simplified path.
