dpkg (1.18.25) stretch; urgency=medium
[dpkg] / scripts / Dpkg.pm
CommitLineData
1479465f
GJ
1# This program is free software; you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation; either version 2 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <https://www.gnu.org/licenses/>.
13
14package Dpkg;
15
16=encoding utf8
17
18=head1 NAME
19
20Dpkg - module with core variables
21
22=head1 DESCRIPTION
23
24The Dpkg module provides a set of variables with information concerning
25this system installation.
26
27=cut
28
29use strict;
30use warnings;
31
32our $VERSION = '1.03';
33our @EXPORT_OK = qw(
34 $PROGNAME
35 $PROGVERSION
36 $PROGMAKE
37 $PROGTAR
38 $PROGPATCH
39 $CONFDIR
40 $ADMINDIR
41 $LIBDIR
42 $DATADIR
43);
44our @EXPORT = qw(
45 $version
46 $progname
47 $admindir
48 $dpkglibdir
49 $pkgdatadir
50);
51
52use Exporter qw(import);
53
54=head1 VARIABLES
55
56=over 4
57
58=item $Dpkg::PROGNAME
59
60Contains the name of the current program.
61
62=item $Dpkg::PROGVERSION
63
64Contains the version of the dpkg suite.
65
66=item $Dpkg::PROGMAKE
67
68Contains the name of the system GNU make program.
69
70=item $Dpkg::PROGTAR
71
72Contains the name of the system GNU tar program.
73
74=item $Dpkg::PROGPATCH
75
76Contains the name of the system GNU patch program (or another implementation
77that is directory traversal resistant).
78
79=item $Dpkg::CONFDIR
80
81Contains the path to the dpkg system configuration directory.
82
83=item $Dpkg::ADMINDIR
84
85Contains the path to the dpkg database directory.
86
87=item $Dpkg::LIBDIR
88
89Contains the path to the dpkg methods and plugins directory.
90
91=item $Dpkg::DATADIR
92
93Contains the path to the dpkg architecture tables directory.
94
95=back
96
97=cut
98
99our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
100
101# The following lines are automatically fixed at install time
102our $PROGVERSION = '1.18.x';
103our $PROGMAKE = $ENV{DPKG_PROGMAKE} // 'make';
104our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
105our $PROGPATCH = $ENV{DPKG_PROGPATCH} // 'patch';
106
107our $CONFDIR = '/etc/dpkg';
108our $ADMINDIR = '/var/lib/dpkg';
109our $LIBDIR = '.';
110our $DATADIR = '..';
111
112$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
113
114# XXX: Backwards compatibility, to be removed on VERSION 2.00.
115## no critic (Variables::ProhibitPackageVars)
116our $version = $PROGVERSION;
117our $admindir = $ADMINDIR;
118our $dpkglibdir = $LIBDIR;
119our $pkgdatadir = $DATADIR;
120## use critic
121
122=head1 CHANGES
123
124=head2 Version 1.03 (dpkg 1.18.24)
125
126New variable: $PROGPATCH.
127
128=head2 Version 1.02 (dpkg 1.18.11)
129
130New variable: $PROGTAR, $PROGMAKE.
131
132=head2 Version 1.01 (dpkg 1.17.0)
133
134New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
135$DATADIR.
136
137Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.
138
139=head2 Version 1.00 (dpkg 1.15.6)
140
141Mark the module as public.
142
143=cut
144
1451;