aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.PL
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2011-01-07 08:07:11 +0000
committerPascal Terjan <pterjan@mageia.org>2011-01-07 08:07:11 +0000
commitabc9a802404902718dc808fdce36f226533f02de (patch)
treefc46dc3b0da9bf9fead8a50c9a6a3d8a5e27a75a /Makefile.PL
downloadmga-youri-submit-abc9a802404902718dc808fdce36f226533f02de.tar
mga-youri-submit-abc9a802404902718dc808fdce36f226533f02de.tar.gz
mga-youri-submit-abc9a802404902718dc808fdce36f226533f02de.tar.bz2
mga-youri-submit-abc9a802404902718dc808fdce36f226533f02de.tar.xz
mga-youri-submit-abc9a802404902718dc808fdce36f226533f02de.zip
get_file_name returns a full path, which Install does not like
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL97
1 files changed, 97 insertions, 0 deletions
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..09ff7f7
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,97 @@
+# $Id: Makefile.PL 1723 2006-10-17 13:53:27Z warly $
+use ExtUtils::MakeMaker;
+use Config;
+
+WriteMakefile(
+ NAME => 'youri-submit',
+ VERSION => 0.9,
+ AUTHOR => 'Youri project <youri@zarb.org>',
+ EXE_FILES => [
+ 'bin/youri-submit',
+ 'bin/youri-submit-restricted',
+ 'bin/youri-submit-proxy'
+ ],
+ PREREQ_PM => {
+ 'Youri::Config' => 0,
+ 'Youri::Utils' => 0,
+ 'Pod::Simple::HTMLBatch' => 0
+ },
+ PREFIX => '/usr/local',
+ INSTALLPRIVLIB => $Config{installprivlib},
+ INSTALLSITELIB => $Config{installsitelib},
+ INSTALLVENDORLIB => $Config{installvendorlib},
+ INSTALLMAN3DIR => $Config{installman3dir},
+ INSTALLSITEMAN3DIR => $Config{installsiteman3dir},
+ INSTALLVENDORMAN3DIR => $Config{installvendorman3dir},
+ INSTALLSCRIPT => '$(PREFIX)/bin',
+ INSTALLSITESCRIPT => '$(PREFIX)/bin',
+ INSTALLVENDORSCRIPT => '$(PREFIX)/bin',
+ INSTALLMAN1DIR => '$(PREFIX)/share/man/man1',
+ INSTALLSITEMAN1DIR => '$(PREFIX)/share/man/man1',
+ INSTALLVENDORMAN1DIR => '$(PREFIX)/share/man/man1',
+);
+
+package MY;
+
+sub post_constants {
+ my ($self) = @_;
+ my $sysconfdir = $self->{ARGS}->{SYSCONFDIR} || '$(PREFIX)/etc';
+ return <<EOF;
+SYSCONFDIR = $sysconfdir
+EOF
+}
+
+sub top_targets {
+ my ($self) = @_;
+ my $top_targets = $self->SUPER::top_targets(@_);
+ $top_targets =~ s/all :: pure_all manifypods/all :: pure_all manifypods htmlifypods/;
+ $top_targets .= <<'EOF';
+htmlifypods : $(TO_INST_PM)
+ if [ ! -d blib/html ]; then mkdir blib/html; fi
+ perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go lib blib/html
+ pod2html < bin/youri-submit > blib/html/youri-submit.html
+ pod2html < bin/youri-submit-restricted > blib/html/youri-submit-restricted.html
+ pod2html < bin/youri-submit-proxy > blib/html/youri-submit-proxy.html
+EOF
+ return $top_targets;
+}
+
+sub install {
+ my ($self) = @_;
+ my $install = $self->SUPER::install(@_);
+ $install =~ s/install :: all pure_install doc_install/install :: all pure_install doc_install config_install completion_install/;
+ $install .= <<'EOF';
+config_install :
+ install -d -m 755 $(DESTDIR)$(SYSCONFDIR)/youri
+ install -m 644 etc/submit.conf $(DESTDIR)$(SYSCONFDIR)/youri
+
+completion_install :
+ install -d -m 755 $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
+ install -m 644 etc/bash_completion.d/youri-submit $(DESTDIR)$(SYSCONFDIR)/bash_completion.d
+EOF
+ return $install;
+}
+
+sub installbin {
+ my ($self) = @_;
+ my $installbin = $self->SUPER::installbin(@_);
+ $installbin .= <<'EOF';
+bin/youri-submit : bin/youri-submit.in Makefile
+ perl -p \
+ -e 's|\@sysconfdir\@|$(SYSCONFDIR)|;' \
+ < $< > $@
+
+bin/youri-submit-restricted : bin/youri-submit-restricted.in Makefile
+ perl -p \
+ -e 's|\@sysconfdir\@|$(SYSCONFDIR)|;' \
+ -e 's|\@bindir\@|$(PREFIX)/bin|;' \
+ < $< > $@
+
+bin/youri-submit-proxy : bin/youri-submit-proxy.in Makefile
+ perl -p \
+ -e 's|\@sysconfdir\@|$(SYSCONFDIR)|;' \
+ -e 's|\@bindir\@|$(PREFIX)/bin|;' \
+ < $< > $@
+EOF
+ return $installbin;
+}