Dpkg.pm 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. package Dpkg;
  14. =encoding utf8
  15. =head1 NAME
  16. Dpkg - module with core variables
  17. =head1 DESCRIPTION
  18. The Dpkg module provides a set of variables with information concerning
  19. this system installation.
  20. =cut
  21. use strict;
  22. use warnings;
  23. our $VERSION = '1.02';
  24. our @EXPORT_OK = qw(
  25. $PROGNAME
  26. $PROGVERSION
  27. $PROGMAKE
  28. $PROGTAR
  29. $CONFDIR
  30. $ADMINDIR
  31. $LIBDIR
  32. $DATADIR
  33. );
  34. our @EXPORT = qw(
  35. $version
  36. $progname
  37. $admindir
  38. $dpkglibdir
  39. $pkgdatadir
  40. );
  41. use Exporter qw(import);
  42. =head1 VARIABLES
  43. =over 4
  44. =item $Dpkg::PROGNAME
  45. Contains the name of the current program.
  46. =item $Dpkg::PROGVERSION
  47. Contains the version of the dpkg suite.
  48. =item $Dpkg::PROGMAKE
  49. Contains the name of the system GNU make program.
  50. =item $Dpkg::PROGTAR
  51. Contains the name of the system GNU tar program.
  52. =item $Dpkg::CONFDIR
  53. Contains the path to the dpkg system configuration directory.
  54. =item $Dpkg::ADMINDIR
  55. Contains the path to the dpkg database directory.
  56. =item $Dpkg::LIBDIR
  57. Contains the path to the dpkg methods and plugins directory.
  58. =item $Dpkg::DATADIR
  59. Contains the path to the dpkg architecture tables directory.
  60. =back
  61. =cut
  62. our ($PROGNAME) = $0 =~ m{(?:.*/)?([^/]*)};
  63. # The following lines are automatically fixed at install time
  64. our $PROGVERSION = '1.18.x';
  65. our $PROGMAKE = $ENV{DPKG_PROGMAKE} // 'make';
  66. our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
  67. our $CONFDIR = '/etc/dpkg';
  68. our $ADMINDIR = '/var/lib/dpkg';
  69. our $LIBDIR = '.';
  70. our $DATADIR = '..';
  71. $DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
  72. # XXX: Backwards compatibility, to be removed on VERSION 2.00.
  73. ## no critic (Variables::ProhibitPackageVars)
  74. our $version = $PROGVERSION;
  75. our $admindir = $ADMINDIR;
  76. our $dpkglibdir = $LIBDIR;
  77. our $pkgdatadir = $DATADIR;
  78. ## use critic
  79. =head1 CHANGES
  80. =head2 Version 1.02 (dpkg 1.18.11)
  81. New variable: $PROGTAR, $PROGMAKE.
  82. =head2 Version 1.01 (dpkg 1.17.0)
  83. New variables: $PROGNAME, $PROGVERSION, $CONFDIR, $ADMINDIR, $LIBDIR and
  84. $DATADIR.
  85. Deprecated variables: $version, $admindir, $dpkglibdir and $pkgdatadir.
  86. =head2 Version 1.00 (dpkg 1.15.6)
  87. Mark the module as public.
  88. =cut
  89. 1;