| 1 | package MegaDistro::DebMaker::CtrlFile; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Exporter; | ||
| 7 | our @ISA = qw(Exporter); | ||
| 8 | our @EXPORT_OK = qw(make_ctrlfile); | ||
| 9 | |||
| 10 | use lib '../MegaDistro'; | ||
| 11 | |||
| 12 | use MegaDistro::Config; | ||
| 13 | use MegaDistro::DebMaker::Config qw(:default :build); | ||
| 14 | |||
| 15 | |||
| 16 | sub make_ctrlfile { | ||
| 17 | if ( $args{'trace'} ) { | ||
| 18 | print 'MegaDistro::DebMaker::make_ctrlfile : Executing sub-routine: make_ctrlfile' . "\n"; | ||
| 19 | } | ||
| 20 | |||
| 21 | open( CTRLFILE, ">$buildtree{'CONTROL'}/control" ) || die "Cannot open: $!"; | ||
| 22 | print CTRLFILE 'Package: ' . $metadata{'name'} . "\n"; | ||
| 23 | print CTRLFILE 'Version: ' . $metadata{'version'} . '-' | ||
| 24 | . $metadata{'release'} . "\n"; | ||
| 25 | print CTRLFILE 'Section: ' . $metadata{'section'} . "\n"; | ||
| 26 | print CTRLFILE 'Priority: ' . $metadata{'priority'} . "\n"; | ||
| 27 | print CTRLFILE 'Depends: ' . $metadata{'depends'} . "\n"; | ||
| 28 | print CTRLFILE 'Suggests: ' . $metadata{'suggests'} . "\n"; | ||
| 29 | print CTRLFILE 'Replaces: ' . $metadata{'replaces'} . "\n"; | ||
| 30 | print CTRLFILE 'Conflicts: ' . $metadata{'conflicts'} . "\n"; | ||
| 31 | print CTRLFILE 'Maintainer: ' . $metadata{'maintainer'} . "\n"; | ||
| 32 | print CTRLFILE 'Description: ' . $metadata{'description'} . "\n"; | ||
| 33 | |||
| 34 | for (join("\n\ ",@{$section{'description'}})) { | ||
| 35 | print CTRLFILE ' ' . $_ . "\n"; | ||
| 36 | } | ||
| 37 | |||
| 38 | close( CTRLFILE ); | ||
| 39 | |||
| 40 | if ( $args{'debug'} ) { | ||
| 41 | print "\t" . 'Control file successfully created - name is: ' . 'control' . "\n"; | ||
| 42 | } | ||
| 43 | |||
| 44 | } | ||
| 45 | |||
| 46 | 1; |