| 1 | package Autoconf::Template::Constants; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use parent qw(Exporter); | ||
| 7 | |||
| 8 | our $VERSION = '2.1.0'; ## no critic (RequireInterpolation) | ||
| 9 | our $PROJECT = 'autoconf-template-perl'; ## no critic (RequireInterpolation) | ||
| 10 | our $SHARE_DIR = '/usr/local/share'; ## no critic (RequireInterpolation) | ||
| 11 | our $PERL5SHARE_DIR = '/usr/local/share/perl5/auto/share/dist/Autoconf-Template'; ## no critic (RequireInterpolation) | ||
| 12 | |||
| 13 | use Readonly; | ||
| 14 | |||
| 15 | # booleans | ||
| 16 | Readonly our $TRUE => 1; | ||
| 17 | Readonly our $FALSE => 0; | ||
| 18 | |||
| 19 | # chars | ||
| 20 | Readonly our $EMPTY => q{}; | ||
| 21 | Readonly our $SPACE => q{ }; | ||
| 22 | Readonly our $DASH => q{-}; | ||
| 23 | Readonly our $SLASH => q{/}; | ||
| 24 | Readonly our $COMMA => q{,}; | ||
| 25 | Readonly our $DOT => q{.}; | ||
| 26 | |||
| 27 | # paths | ||
| 28 | Readonly our $PROJECT_DIR => "$SHARE_DIR/$PROJECT"; | ||
| 29 | Readonly our $INCLUDE_PATH => "$PERL5SHARE_DIR/templates"; | ||
| 30 | Readonly our $TEMPLATES_DIR => "$PERL5SHARE_DIR/templates"; | ||
| 31 | Readonly our $FILE_LIST => "$PROJECT_DIR/file_list.json"; | ||
| 32 | |||
| 33 | # other | ||
| 34 | Readonly our $MANIFEST_FILE => 'manifest.yaml'; | ||
| 35 | |||
| 36 | Readonly our $COPYRIGHT => <<"END_OF_COPYRIGHT"; | ||
| 37 | version $VERSION | ||
| 38 | |||
| 39 | Copyright (C) 2023 TBC Development Group, LLC | ||
| 40 | License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html> | ||
| 41 | This is free software: you are free to change and redistribute it. | ||
| 42 | There is NO WARRANTY, to the extent permitted by law. | ||
| 43 | |||
| 44 | Written by Rob Lauer <rlauer6\@comcast.net> | ||
| 45 | END_OF_COPYRIGHT | ||
| 46 | |||
| 47 | Readonly::Hash our %CONFIG_FILE_EXTENSIONS => ( | ||
| 48 | ini_files => 'ini', | ||
| 49 | config_files => 'cfg', | ||
| 50 | json_files => 'json', | ||
| 51 | yaml_files => 'yaml', | ||
| 52 | ); | ||
| 53 | |||
| 54 | Readonly::Hash our %BOOLEAN_OPTIONS => ( | ||
| 55 | man_pages => 'man-pages', | ||
| 56 | create_missing => 'create-missing', | ||
| 57 | unit_tests => 'unit-tests', | ||
| 58 | html => 'html', | ||
| 59 | bash => 'bash', | ||
| 60 | version_numbers => 'add-version-numbers', | ||
| 61 | pod_to_readme => 'pod-to-readme', | ||
| 62 | ); | ||
| 63 | |||
| 64 | Readonly::Hash our %SUBDIRS_BY_TYPE => ( | ||
| 65 | '.html' => 'src/main/html/htdocs', | ||
| 66 | '.css' => 'src/main/html/css', | ||
| 67 | '.js' => 'src/main/html/javascript', | ||
| 68 | '.pm' => 'src/main/perl/lib', | ||
| 69 | '.pl' => 'src/main/perl/bin', | ||
| 70 | '.sh' => 'src/main/bash/bin', | ||
| 71 | '.cgi' => 'src/main/perl/cgi-bin', | ||
| 72 | ); | ||
| 73 | |||
| 74 | our %EXPORT_TAGS = ( | ||
| 75 | booleans => [ | ||
| 76 | qw( | ||
| 77 | $TRUE | ||
| 78 | $FALSE | ||
| 79 | ) | ||
| 80 | ], | ||
| 81 | chars => [ | ||
| 82 | qw( | ||
| 83 | $EMPTY | ||
| 84 | $SPACE | ||
| 85 | $DASH | ||
| 86 | $SLASH | ||
| 87 | $COMMA | ||
| 88 | $DOT | ||
| 89 | ) | ||
| 90 | ], | ||
| 91 | paths => [ | ||
| 92 | qw( | ||
| 93 | $PROJECT_DIR | ||
| 94 | $INCLUDE_PATH | ||
| 95 | $SHARE_DIR | ||
| 96 | $TEMPLATES_DIR | ||
| 97 | $PERL5SHARE_DIR | ||
| 98 | ) | ||
| 99 | ], | ||
| 100 | vars => [ | ||
| 101 | qw( | ||
| 102 | $PROJECT | ||
| 103 | $FILE_LIST | ||
| 104 | $MANIFEST_FILE | ||
| 105 | $COPYRIGHT | ||
| 106 | %CONFIG_FILE_EXTENSIONS | ||
| 107 | %SUBDIRS_BY_TYPE | ||
| 108 | %BOOLEAN_OPTIONS | ||
| 109 | ) | ||
| 110 | ], | ||
| 111 | ); | ||
| 112 | |||
| 113 | our @EXPORT_OK = map { @{ $EXPORT_TAGS{$_} } } keys %EXPORT_TAGS; | ||
| 114 | |||
| 115 | $EXPORT_TAGS{all} = [@EXPORT_OK]; | ||
| 116 | |||
| 117 | 1; |