Changeset 378


Ignore:
Timestamp:
09/29/11 11:59:09 (13 years ago)
Author:
nanardon
Message:
  • add `make rpm' target
Location:
bot/trunk
Files:
1 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • bot/trunk/MANIFEST

    r69 r378  
    11Changes 
     2MANIFEST 
    23Makefile.PL 
    3 MANIFEST 
    44README 
    5 t/Sophie-IrcBot.t 
    6 lib/Sophie/IrcBot.pm 
     5bin/sophie-bot 
     6bin/sophie-rpm 
     7lib/Sophie/Bot/IRC.pm 
     8lib/Sophie/Bot/Term.pm 
     9lib/Sophie/Bot.pm 
     10t/Sophie-Bot.t 
  • bot/trunk/Makefile.PL

    r302 r378  
    44# the contents of the Makefile that is written. 
    55WriteMakefile( 
    6     NAME              => 'Sophie::Bot', 
     6    NAME              => 'Sophie::Tools', 
    77    VERSION_FROM      => 'lib/Sophie/Bot.pm', # finds $VERSION 
    88    PREREQ_PM         => {}, # e.g., Module::Name => 1.1 
     
    1010      (ABSTRACT_FROM  => 'lib/Sophie/Bot.pm', # retrieve abstract from module 
    1111       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    }, 
    1222); 
     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} 
  • bot/trunk/t/Sophie-Bot.t

    r377 r378  
    1010 
    1111use Test::More tests => 1; 
    12 BEGIN { use_ok('Sophie::IrcBot') }; 
     12BEGIN { use_ok('Sophie::Bot') }; 
    1313 
    1414######################### 
Note: See TracChangeset for help on using the changeset viewer.