Skip to content
Browse files

Build files

  • Loading branch information...
1 parent 34ddf67 commit 0f11a212a97008223441f911863789d8f26a0b49 @potyl committed Oct 22, 2009
Showing with 121 additions and 0 deletions.
  1. +63 −0 Build.PL
  2. +58 −0 inc/MyBuilder.pm
View
63 Build.PL
@@ -0,0 +1,63 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use inc::MyBuilder;
+use File::Spec::Functions;
+
+
+my %requires = (
+ perl => '5.6.1',
+
+ 'Pod::Usage' => 0,
+ 'Getopt::Long' => 0,
+ 'Glib' => 0,
+ 'Clutter' => '1.000',
+ 'Gtk2' => 0,
+ 'XML::LibXML' => 0,
+ 'URI' => 0,
+ 'Class::Accessor::Fast' => 0,
+ 'File::Spec' => 0,
+ 'FindBin' => 0,
+ 'Carp' => 0,
+ 'Data::Dumper' => 0,
+ 'AnyEvent::HTTP' => 0,
+ 'List::Util' => 0,
+ 'Math::Trig' => 0,
+);
+
+my %configure_requires = (
+ 'File::Spec::Functions' => 0,
+);
+
+my $build = inc::MyBuilder->new(
+ module_name => 'Game::Pexeso',
+ license => 'perl',
+ dist_author => 'Emmanuel Rodriguez <potyl@cpan.org>',
+ dist_version_from => catfile('lib', 'Game', 'Xacobeo.pm'),
+
+ # Installation files
+ script_file => [ catfile('bin', 'pexeso') ],
+
+ # Dependencies
+ requires => \%requires,
+
+ configure_requires => \%configure_requires,
+
+ build_requires => {
+ %configure_requires,
+ },
+
+ meta_merge => {
+ resources => {
+# homepage => 'http://www.github.com/potyl/pexeso/',
+# bugtracker => 'http://www.github.com/potyl/pexeso/issues',
+# repository => 'http://www.github.com/potyl/pexeso/',
+ },
+ },
+);
+
+
+$build->create_build_script();
+
View
58 inc/MyBuilder.pm
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+package inc::MyBuilder;
+
+
+use strict;
+use warnings;
+
+use base 'Module::Build';
+use File::Spec::Functions;
+
+
+sub ACTION_install {
+ my $self = shift;
+
+ # Make sure that 'share/' has an installation path
+ my $p = $self->{properties};
+ if (! exists $p->{install_path}{share}) {
+ my $script_dir = $self->install_destination('script');
+ my @dirs = File::Spec->splitdir($script_dir);
+ $dirs[-1] = 'share';
+ $p->{install_path}{share} = File::Spec->catdir(@dirs);
+ }
+
+ # Proceed normally
+ $self->SUPER::ACTION_install(@_);
+}
+
+
+sub ACTION_post_install {
+ my $self = shift;
+ print "Updating desktop database\n";
+ system('update-desktop-database');
+}
+
+
+sub ACTION_build {
+ my $self = shift;
+
+ # Copy the files in share/
+ foreach my $entry (@{ $self->rscan_dir('share') }) {
+
+ # Skip hidden entries or folders
+ next if $entry =~ m,(^|/)\., or -d $entry;
+
+ $self->copy_if_modified(
+ from => $entry,
+ to => catfile($self->blib, $entry)
+ );
+ }
+
+ # Proceed normally
+ $self->SUPER::ACTION_build(@_);
+}
+
+
+# Return a true value
+1;

0 comments on commit 0f11a21

Please sign in to comment.
Something went wrong with that request. Please try again.