| 1 | # | ||
| 2 | # This file is part of App-CPAN2Pkg | ||
| 3 | # | ||
| 4 | # This software is copyright (c) 2009 by Jerome Quelin. | ||
| 5 | # | ||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||
| 8 | # | ||
| 9 | use 5.010; | ||
| 10 | use strict; | ||
| 11 | use warnings; | ||
| 12 | |||
| 13 | package App::CPAN2Pkg::Utils; | ||
| 14 | # ABSTRACT: various utilities for cpan2pkg | ||
| 15 | $App::CPAN2Pkg::Utils::VERSION = '3.004'; | ||
| 16 | use Devel::Platform::Info::Linux; | ||
| 17 | use Exporter::Lite; | ||
| 18 | use File::ShareDir::PathClass qw{ dist_dir }; | ||
| 19 | use FindBin qw{ $Bin }; | ||
| 20 | use Path::Class; | ||
| 21 | |||
| 22 | our @EXPORT_OK = qw{ $LINUX_FLAVOUR $SHAREDIR $WORKER_TYPE }; | ||
| 23 | |||
| 24 | my $root = dir($Bin)->parent; | ||
| 25 | our $IS_DEVEL = -e $root->file("dist.ini" ); | ||
| 26 | our $SHAREDIR = $IS_DEVEL ? $root->subdir("share") : dist_dir("App-CPAN2Pkg"); | ||
| 27 | our $LINUX_FLAVOUR = Devel::Platform::Info::Linux->new->get_info->{oslabel}; | ||
| 28 | our $WORKER_TYPE = "App::CPAN2Pkg::Worker::$LINUX_FLAVOUR"; | ||
| 29 | |||
| 30 | 1; | ||
| 31 | |||
| 32 | __END__ |