PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/Build.PL

https://bitbucket.org/Mekk/perl-keyring-gnome
Perl | 83 lines | 68 code | 10 blank | 5 comment | 0 complexity | 08d8073d4a59da45a0ae8ab8d4267e44 MD5 | raw file
  1. use 5.006;
  2. use strict;
  3. use warnings;
  4. use Module::Build;
  5. use ExtUtils::PkgConfig;
  6. #eval { require ExtUtils::PkgConfig; } or
  7. # die "OS unsupported - no ExtUtils::PkgConfig\n";
  8. my %gnome_keyring_pkg_info;
  9. eval {
  10. %gnome_keyring_pkg_info = ExtUtils::PkgConfig->find("gnome-keyring-1");
  11. } or die "OS unsupported - need gnome-keyring development libraries\n$@";
  12. # Generate also README.md
  13. # Testing: ./Build.PL; ./Build distmeta
  14. # (alternatively we could override ACTION_distmeta, but this seems nicer)
  15. my $class = Module::Build->subclass(
  16. class => 'MEKK::Module::Build',
  17. code => q{
  18. sub do_create_readme {
  19. my $self = shift;
  20. $self->SUPER::do_create_readme; # Default
  21. my $docfile = $self->_main_docfile or return; # Warning already emitted
  22. require Pod::Readme; require Pod::Markdown;
  23. $self->log_info("Creating README.md\n");
  24. my $parser = Pod::Readme->new(
  25. input_file => $docfile,
  26. translate_to_file => 'README.md',
  27. translation_class => 'Pod::Markdown');
  28. $parser->run;
  29. $self->_add_to_manifest('MANIFEST', 'README.md');
  30. }
  31. }
  32. );
  33. my $builder = $class->new(
  34. module_name => 'Passwd::Keyring::Gnome',
  35. license => 'perl',
  36. dynamic_config => 1,
  37. needs_compiler => 1,
  38. extra_compiler_flags => $gnome_keyring_pkg_info{cflags},
  39. extra_linker_flags => $gnome_keyring_pkg_info{libs},
  40. build_requires => {
  41. 'Module::Build' => '0.19', # xs
  42. 'ExtUtils::CBuilder' => 0,
  43. 'Test::More' => 0,
  44. 'Test::Pod::Coverage' => '1.0',
  45. 'Pod::Readme' => '1.001002',
  46. 'Pod::Markdown' => '2.0',
  47. },
  48. configure_requires => {
  49. 'Module::Build' => '0.36',
  50. 'ExtUtils::PkgConfig' => '1.12',
  51. },
  52. requires => {
  53. 'perl' => 5.006,
  54. },
  55. share_dir => {
  56. dist => [ 'example' ],
  57. },
  58. create_makefile_pl => 'small', # not 'traditional', we test for libraries in Build.pl
  59. add_to_cleanup => [ 'Passwd-Keyring-Gnome-*' ],
  60. create_readme => 1,
  61. dist_author => q{Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>},
  62. dist_version_from => 'lib/Passwd/Keyring/Gnome.pm',
  63. meta_merge => {
  64. keywords => [ qw/ passwords security secure-storage keyring GNOME seahorse gnome-keyring / ],
  65. resources => {
  66. license => 'http://dev.perl.org/licenses/',
  67. homepage => 'http://bitbucket.org/Mekk/perl-keyring-gnome',
  68. repository => 'http://bitbucket.org/Mekk/perl-keyring-gnome',
  69. bugtracker => 'https://bitbucket.org/Mekk/perl-keyring-gnome/issues',
  70. },
  71. },
  72. );
  73. $builder->create_build_script();