switch to MakeMaker, rip off man8 stuff from vipuls razor, via mat
authorIan Beckwith <ianb@erislabs.net>
Sat, 16 Oct 2010 10:59:13 +0000 (11:59 +0100)
committerIan Beckwith <ianb@erislabs.net>
Sat, 16 Oct 2010 10:59:13 +0000 (11:59 +0100)
Build.PL [deleted file]
MANIFEST
Makefile.PL [new file with mode: 0644]

diff --git a/Build.PL b/Build.PL
deleted file mode 100644 (file)
index 84a88aa..0000000
--- a/Build.PL
+++ /dev/null
@@ -1,21 +0,0 @@
-use Module::Build;
-
-my $build = Module::Build->new
-    (
-     dist_name => "id3fs",
-     dist_version_from => 'sbin/id3fsd',
-     license     => "gpl",
-     requires    =>
-     {
-        'perl'        => 0,
-        'Fuse'        => 0,
-        'DBI'         => 0,
-        'DBD::SQLite' => 0,
-     },
-     sbin_files   => { 'sbin/id3fsd' => 'sbin/id3fsd' },
-    );
-
-$build->add_build_element('sbin');
-$build->create_build_script();
-
-
index eaf9e04..1537d77 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,5 +1,5 @@
 MANIFEST
-Build.PL
+Makefile.PL
 COPYING
 sbin/id3fsd
 bin/id3fs-index
@@ -13,6 +13,7 @@ lib/ID3FS/PathElement/Tagval.pm
 lib/ID3FS/PathElement/Album.pm
 lib/ID3FS/PathElement/Boolean.pm
 lib/ID3FS/DB.pm
+lib/ID3FS/Path/Node.pm
 lib/ID3FS/Fuse.pm
 lib/ID3FS/Path.pm
 lib/ID3FS/AudioFile.pm
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644 (file)
index 0000000..188e130
--- /dev/null
@@ -0,0 +1,131 @@
+#!/usr/bin/perl -w
+
+use ExtUtils::MakeMaker;
+
+my @binscripts=qw(id3fs-index);
+my @sbinscripts=qw(id3fsd);
+
+WriteMakefile(NAME=>"id3fs",
+             VERSION=>"1.0",
+             EXE_FILES=>[ map( "bin/$_", @binscripts), map( "sbin/$_", @sbinscripts) ],
+             MAN1PODS=>{ map({ +"bin/$_" => "\${INST_MAN1DIR}/$_.1" } @binscripts) },
+             MAN8PODS=>{ map({ +"sbin/$_" => "\${INST_MAN8DIR}/$_.8" } @sbinscripts) },
+             PREREQ_PM=>{ 'Fuse'        => 0,
+                          'DBI'         => 0,
+                          'DBD::Sqlite' => 0} ,
+#            dist=>{ COMPRESS=>"gzip -9f", SUFFIX=>"gz", },
+             ($] >= 5.005
+              ? (ABSTRACT   => 'FUSE-based filesystem for browsing music metadata',
+                 AUTHOR     => 'Ian Beckwith <ianb@erislabs.net>')
+              : ()),
+             );
+
+# man 5/8 stuff adapted from vipul's razor, http://razor.sf.net
+
+{
+package MY;
+
+sub constants {
+
+    my $self = shift;
+    my $inherited = $self->SUPER::constants(@_);
+
+    my $add = q{
+
+# begin id3fs
+#MAN5PODS = docs/mp3lintrc.pod
+INST_MAN8DIR = blib/man8
+INSTALLMAN8DIR = $(PREFIX)/man/man8
+DESTINSTALLMAN8DIR = $(DESTDIR)$(INSTALLMAN8DIR)
+INSTALLSITEMAN8DIR = $(SITEPREFIX)/man/man8
+DESTINSTALLSITEMAN8DIR = $(DESTDIR)$(INSTALLSITEMAN8DIR)
+INSTALLVENDORMAN8DIR = $(VENDORPREFIX)/man/man8
+DESTINSTALLVENDORMAN8DIR = $(DESTDIR)$(INSTALLVENDORMAN8DIR)
+MAN8EXT = 8
+INST_SYSCONFDIR = blib/etc
+INSTALLSYSCONFDIR = /etc
+DESTINSTALLSYSCONFDIR = $(DESTDIR)$(INSTALLSYSCONFDIR) 
+# end id3fs
+
+};
+
+    return $inherited . $add;
+
+}
+
+
+sub MY::top_targets {
+
+    use Config;
+
+    my $self = shift;
+    my $inherited = $self->SUPER::top_targets(@_);
+
+    my ($perlh) = $self->catfile($Config{archlibexp}, 'CORE', "perl.h");
+
+    my $noecho = q{NOECHO = @} unless $inherited =~ /NOECHO/;
+
+    my $add = sprintf <<'MAKE_FRAG', $perlh, $perlh, $perlh, $perlh;
+
+# begin id3fs
+config :: $(INST_MAN8DIR)/.exists $(INST_SYSCONFDIR)/.exists
+       @$(NOOP)
+
+$(INST_MAN8DIR)/.exists :: %s
+       @$(MKPATH) $(INST_MAN8DIR)
+       @$(EQUALIZE_TIMESTAMP) %s $(INST_MAN8DIR)/.exists
+       -@$(CHMOD) $(PERM_RWX) $(INST_MAN8DIR)
+
+#$(INST_SYSCONFDIR)/.exists :: %s
+#      @$(MKPATH) $(INST_SYSCONFDIR)
+#      @$(EQUALIZE_TIMESTAMP) %s $(INST_SYSCONFDIR)/.exists
+#      -@$(CHMOD) $(PERM_RWX) $(INST_SYSCONFDIR)
+#      @$(CP) etc/matrc $(INST_SYSCONFDIR)
+# end id3fs
+
+MAKE_FRAG
+
+    return $inherited . $add;
+}
+
+
+sub MY::manifypods {
+    my $self = shift;
+    my $inherited = $self->SUPER::manifypods(@_);
+
+    $inherited =~ s{^(manifypods : .*)\\}{$1 manifypods-local \\}m;
+
+    # MakeMaker 6.06_x through 6.13 eliminated the POD2MAN macro.
+    my $pod2man = "";
+    unless ($inherited =~ /^POD2MAN\b/m)
+    {
+       $pod2man=q{POD2MAN = $(POD2MAN_EXE)};
+    }
+#    my $manifypods_local = sprintf <<'MAKE_FRAG', $pod2man;
+#
+## begin id3fs
+#%s
+#
+#manifypods-local : docs/mp3lintrc.pod
+#      $(POD2MAN) -s $(MAN8EXT) docs/mp3lintrc.pod $(INST_MAN8DIR)/mp3lintrc.$(MAN8EXT) 
+#
+##end id3fs
+#MAKE_FRAG
+
+    return $inherited . "\n" . $manifypods_local;
+
+}
+
+
+sub MY::install {
+
+  my $self = shift;
+  my $inherited = $self->SUPER::install(@_);
+  my $conf="\t\t\$(INST_SYSCONFDIR) \$(DESTINSTALLSYSCONFDIR)";
+  $inherited =~ s/(^\s*\$\(INST_MAN)3(DIR\s*.*MAN)3(DIR\))/${1}3${2}3$3 \\\n${1}8${2}8$3 \\\n$conf/gm;
+# $inherited =~ s/(^\s*\$\(INST_MAN3DIR\s*.*MAN3DIR\))/$1 \\\n$conf/gm;
+
+  return $inherited;
+}
+
+}