| 1 | package MegaDistro::DebMaker::Config; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Exporter; | ||
| 7 | our @ISA = qw(Exporter); | ||
| 8 | our @EXPORT = qw(%buildtree); | ||
| 9 | our @EXPORT_OK = qw( %metadata %section build_pre ); | ||
| 10 | our %EXPORT_TAGS; | ||
| 11 | $EXPORT_TAGS{'default'} = \@EXPORT; | ||
| 12 | $EXPORT_TAGS{'build'} = \@EXPORT_OK; | ||
| 13 | |||
| 14 | use File::Path; | ||
| 15 | use File::Spec::Functions qw(:ALL); | ||
| 16 | |||
| 17 | use lib '../MegaDistro'; | ||
| 18 | |||
| 19 | use MegaDistro; | ||
| 20 | use MegaDistro::Config; | ||
| 21 | |||
| 22 | |||
| 23 | # | ||
| 24 | # Package-specific configurables | ||
| 25 | # | ||
| 26 | # the package metadata (headers) | ||
| 27 | our %metadata = ( | ||
| 28 | # the package Name | ||
| 29 | 'name' => 'megadistro', | ||
| 30 | |||
| 31 | # the package Version | ||
| 32 | 'version' => $MegaDistro::VERSION, | ||
| 33 | |||
| 34 | # the package Release number | ||
| 35 | 'release' => '5', | ||
| 36 | |||
| 37 | # the package Section | ||
| 38 | 'section' => 'libs', | ||
| 39 | |||
| 40 | # the package Priority | ||
| 41 | 'priority' => 'optional', | ||
| 42 | |||
| 43 | # the package Dependencies | ||
| 44 | 'depends' => 'perl (>= 5.6.1)', | ||
| 45 | |||
| 46 | # the package Suggestions | ||
| 47 | 'suggests' => 'perl (>= 5.8.5)', | ||
| 48 | |||
| 49 | # the package Replaces | ||
| 50 | 'replaces' => 'megadistro (<< ' . $MegaDistro::VERSION . ')', | ||
| 51 | |||
| 52 | # the package Conflicts | ||
| 53 | 'conflicts' => 'megadistro (<< ' . $MegaDistro::VERSION . ')', | ||
| 54 | |||
| 55 | # the package Maintainer | ||
| 56 | 'maintainer' => 'David Buchman <dbuchman@cpan.org>', | ||
| 57 | |||
| 58 | # the package Description (short) | ||
| 59 | 'description' => 'A packaged bundle of pre-compiled perl modules.', | ||
| 60 | |||
| 61 | ); | ||
| 62 | |||
| 63 | # hash to contain various sections | ||
| 64 | our %section; | ||
| 65 | |||
| 66 | # the Description section (long) | ||
| 67 | $section{'description'} = [ | ||
| 68 | 'The MegaDistro is a distributable binary package,', | ||
| 69 | 'which contains a selection of pre-compiled perl modules.', | ||
| 70 | '.', | ||
| 71 | 'Simply feed it a list of modules,', | ||
| 72 | 'configure manually if necessary,', | ||
| 73 | 'and crank out a package!', | ||
| 74 | ]; | ||
| 75 | |||
| 76 | |||
| 77 | # hash to contain the various directories needed for building the rpm, on the system | ||
| 78 | our %buildtree; | ||
| 79 | |||
| 80 | sub _init_globals { | ||
| 81 | # Package directory (name) | ||
| 82 | $buildtree{'PACKAGE'} = 'debian'; | ||
| 83 | |||
| 84 | # SOURCES directory | ||
| 85 | $buildtree{'ROOT'} = catdir($Conf{'rootdir'}, $buildtree{'PACKAGE'}); | ||
| 86 | |||
| 87 | # BUILD directory | ||
| 88 | $buildtree{'CONTROL'} = catdir($buildtree{'ROOT'}, 'DEBIAN'); | ||
| 89 | |||
| 90 | # RPM directory | ||
| 91 | $buildtree{'BUILDROOT'} = $buildtree{'ROOT'}; | ||
| 92 | } | ||
| 93 | |||
| 94 | &_init_globals; | ||
| 95 | |||
| 96 | # | ||
| 97 | # Preparation | ||
| 98 | # | ||
| 99 | sub build_pre { | ||
| 100 | if ( $args{'trace'} ) { | ||
| 101 | print 'MegaDistro::DebMaker::Config : Executing sub-routine: build_pre' . "\n"; | ||
| 102 | } | ||
| 103 | |||
| 104 | mkpath $buildtree{'ROOT'} if ! -d $buildtree{'ROOT'}; | ||
| 105 | mkpath $buildtree{'CONTROL'} if ! -d $buildtree{'CONTROL'}; | ||
| 106 | mkpath $buildtree{'BUILDROOT'} if ! -d $buildtree{'BUILDROOT'}; | ||
| 107 | } | ||
| 108 | |||
| 109 | 1; |