File Coverage

File:Dpkg/BuildInfo.pm
Coverage:100.0%

linestmtbrancondsubpodtimecode
1# Copyright © 2016-2022 Guillem Jover <guillem@debian.org>
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <https://www.gnu.org/licenses/>.
15
16=encoding utf8
17
18 - 27
=head1 NAME

Dpkg::BuildInfo - handle build information

=head1 DESCRIPTION

The Dpkg::BuildInfo module provides functions to handle the build
information.

=cut
28
29package Dpkg::BuildInfo 1.00;
30
31
3
3
3
29
7
136
use strict;
32
3
3
3
7
9
241
use warnings;
33
34our @EXPORT_OK = qw(
35    get_build_env_allowed
36);
37
38
3
3
3
9
4
362
use Exporter qw(import);
39
40 - 49
=head1 FUNCTIONS

=over 4

=item @envvars = get_build_env_allowed()

Get an array with the allowed list of environment variables that can affect
the build, but are still not privacy revealing.

=cut
50
51my @env_allowed = (
52    # Toolchain.
53    qw(
54        CC
55        CPP
56        CXX
57        OBJC
58        OBJCXX
59        PC
60        FC
61        M2C
62        AS
63        LD
64        AR
65        RANLIB
66        MAKE
67        AWK
68        LEX
69        YACC
70    ),
71    # Toolchain flags.
72    qw(
73        ASFLAGS
74        ASFLAGS_FOR_BUILD
75        CFLAGS
76        CFLAGS_FOR_BUILD
77        CPPFLAGS
78        CPPFLAGS_FOR_BUILD
79        CXXFLAGS
80        CXXFLAGS_FOR_BUILD
81        OBJCFLAGS
82        OBJCFLAGS_FOR_BUILD
83        OBJCXXFLAGS
84        OBJCXXFLAGS_FOR_BUILD
85        DFLAGS
86        DFLAGS_FOR_BUILD
87        FFLAGS
88        FFLAGS_FOR_BUILD
89        LDFLAGS
90        LDFLAGS_FOR_BUILD
91        ARFLAGS
92        MAKEFLAGS
93    ),
94    # Dynamic linker, see ld(1).
95    qw(
96        LD_LIBRARY_PATH
97    ),
98    # Locale, see locale(1).
99    qw(
100        LANG
101        LC_ALL
102        LC_CTYPE
103        LC_NUMERIC
104        LC_TIME
105        LC_COLLATE
106        LC_MONETARY
107        LC_MESSAGES
108        LC_PAPER
109        LC_NAME
110        LC_ADDRESS
111        LC_TELEPHONE
112        LC_MEASUREMENT
113        LC_IDENTIFICATION
114    ),
115    # Build flags, see dpkg-buildpackage(1).
116    qw(
117        DEB_BUILD_OPTIONS
118        DEB_BUILD_PROFILES
119    ),
120    # DEB_flag_{SET,STRIP,APPEND,PREPEND} will be recorded after being merged
121    # with system config and user config.
122    # See deb-vendor(1).
123    qw(
124        DEB_VENDOR
125    ),
126    # See dpkg(1).
127    qw(
128        DPKG_ROOT
129        DPKG_ADMINDIR
130    ),
131    # See dpkg-architecture(1).
132    qw(
133        DPKG_DATADIR
134    ),
135    # See Dpkg::Vendor(3).
136    qw(
137        DPKG_ORIGINS_DIR
138    ),
139    # See dpkg-gensymbols(1).
140    qw(
141        DPKG_GENSYMBOLS_CHECK_LEVEL
142    ),
143    # See <https://reproducible-builds.org/specs/source-date-epoch>.
144    qw(
145        SOURCE_DATE_EPOCH
146    ),
147);
148
149sub get_build_env_allowed {
150
3
1
11
    return @env_allowed;
151}
152
153=back
154
155 - 161
=head1 CHANGES

=head2 Version 1.00 (dpkg 1.21.14)

Mark the module as public.

=cut
162
1631;