source: bot/trunk/Makefile.PL @ 378

Last change on this file since 378 was 378, checked in by nanardon, 13 years ago
  • add `make rpm' target
File size: 2.2 KB
Line 
1use 5.012002;
2use ExtUtils::MakeMaker;
3# See lib/ExtUtils/MakeMaker.pm for details of how to influence
4# the contents of the Makefile that is written.
5WriteMakefile(
6    NAME              => 'Sophie::Tools',
7    VERSION_FROM      => 'lib/Sophie/Bot.pm', # finds $VERSION
8    PREREQ_PM         => {}, # e.g., Module::Name => 1.1
9    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
10      (ABSTRACT_FROM  => 'lib/Sophie/Bot.pm', # retrieve abstract from module
11       AUTHOR         => 'Olivier Thauvin <nanardon@nanardon.zarb.org>') : ()),
12    EXE_FILES => [ qw(
13        bin/sophie-bot
14        bin/sophie-rpm
15    ) ],
16    macro => {
17        INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
18        DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
19        INST_MAN5DIR        => 'blib/man5',
20        DESTRPMDIR          => '$(shell pwd)'
21    },
22);
23
24package MY;
25
26sub postamble {
27    <<EOF;
28#.PHONY .= svnmanifest
29
30svnmanifest:
31\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
32
33ChangeLog:
34\tsvn log > ChangeLog
35
36sophie-tools.spec: sophie-tools.spec.in Makefile
37\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
38
39rpm: \$(DISTVNAME).tar.gz sophie-tools.spec
40\tmkdir ./noarch || :
41\trpmbuild -ba --clean\\
42\t --define "_sourcedir `pwd`" \\
43\t --define "_specdir `pwd`" \\
44\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
45\t --define "_rpmdir \$(DESTRPMDIR)" \\
46\t sophie-tools.spec
47
48svnrpm: \$(DISTVNAME).tar.gz sophie-tools.spec
49\tmkdir \$(DESTRPMDIR)/noarch || :
50\trpmbuild -ba --clean\\
51\t --define "_sourcedir `pwd`" \\
52\t --define "_specdir `pwd`" \\
53\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
54\t --define "_rpmdir \$(DESTRPMDIR)" \\
55\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
56\t sophie-tools.spec
57
58EOF
59}
60
61sub installbin {
62    my $self = shift;
63    my $inherited = $self->SUPER::installbin(@_);
64    $inherited;
65}
66
67sub top_targets {
68    my $inherited = shift->SUPER::top_targets(@_);
69    $inherited;
70}
71
72sub install {
73    my ($self) = @_;
74    my $section = $self->SUPER::install();
75
76    $section =~ s/(^install ::.*)/$1 install_config install_templates/m;
77
78    $section .= q[
79install_config ::
80
81install_templates ::
82];
83 
84    return $section;
85}
Note: See TracBrowser for help on using the repository browser.