Index: bot/trunk/MANIFEST
===================================================================
--- bot/trunk/MANIFEST	(revision 302)
+++ bot/trunk/MANIFEST	(revision 378)
@@ -1,6 +1,10 @@
 Changes
+MANIFEST
 Makefile.PL
-MANIFEST
 README
-t/Sophie-IrcBot.t
-lib/Sophie/IrcBot.pm
+bin/sophie-bot
+bin/sophie-rpm
+lib/Sophie/Bot/IRC.pm
+lib/Sophie/Bot/Term.pm
+lib/Sophie/Bot.pm
+t/Sophie-Bot.t
Index: bot/trunk/Makefile.PL
===================================================================
--- bot/trunk/Makefile.PL	(revision 302)
+++ bot/trunk/Makefile.PL	(revision 378)
@@ -4,5 +4,5 @@
 # the contents of the Makefile that is written.
 WriteMakefile(
-    NAME              => 'Sophie::Bot',
+    NAME              => 'Sophie::Tools',
     VERSION_FROM      => 'lib/Sophie/Bot.pm', # finds $VERSION
     PREREQ_PM         => {}, # e.g., Module::Name => 1.1
@@ -10,3 +10,76 @@
       (ABSTRACT_FROM  => 'lib/Sophie/Bot.pm', # retrieve abstract from module
        AUTHOR         => 'Olivier Thauvin <nanardon@nanardon.zarb.org>') : ()),
+    EXE_FILES => [ qw(
+        bin/sophie-bot
+        bin/sophie-rpm
+    ) ],
+    macro => {
+        INSTALLMAN5DIR      => '$(PERLPREFIX)/share/man/man5',
+        DESTINSTALLMAN5DIR  => '$(DESTDIR)$(INSTALLMAN5DIR)',
+        INST_MAN5DIR        => 'blib/man5',
+        DESTRPMDIR          => '$(shell pwd)'
+    },
 );
+
+package MY;
+
+sub postamble {
+    <<EOF;
+#.PHONY .= svnmanifest
+
+svnmanifest:
+\tsvn ls -R| grep -v "/\$\$"  > MANIFEST
+
+ChangeLog:
+\tsvn log > ChangeLog
+
+sophie-tools.spec: sophie-tools.spec.in Makefile
+\tsed -e 's/\@VERSION@/\$(VERSION)/' < \$< > \$@
+
+rpm: \$(DISTVNAME).tar.gz sophie-tools.spec
+\tmkdir ./noarch || :
+\trpmbuild -ba --clean\\
+\t --define "_sourcedir `pwd`" \\
+\t --define "_specdir `pwd`" \\
+\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
+\t --define "_rpmdir \$(DESTRPMDIR)" \\
+\t sophie-tools.spec
+
+svnrpm: \$(DISTVNAME).tar.gz sophie-tools.spec
+\tmkdir \$(DESTRPMDIR)/noarch || :
+\trpmbuild -ba --clean\\
+\t --define "_sourcedir `pwd`" \\
+\t --define "_specdir `pwd`" \\
+\t --define "_srcrpmdir \$(DESTRPMDIR)" \\
+\t --define "_rpmdir \$(DESTRPMDIR)" \\
+\t --define "svnrelease `LC_ALL=C svn info | grep '^Revision:' | sed 's/Revision: //'`" \\
+\t sophie-tools.spec
+
+EOF
+}
+
+sub installbin {
+    my $self = shift;
+    my $inherited = $self->SUPER::installbin(@_);
+    $inherited;
+}
+
+sub top_targets {
+    my $inherited = shift->SUPER::top_targets(@_);
+    $inherited;
+}
+
+sub install {
+    my ($self) = @_;
+    my $section = $self->SUPER::install();
+
+    $section =~ s/(^install ::.*)/$1 install_config install_templates/m;
+
+    $section .= q[
+install_config ::
+
+install_templates ::
+];
+  
+    return $section;
+}
Index: bot/trunk/sophie-tools.spec.in
===================================================================
--- bot/trunk/sophie-tools.spec.in	(revision 378)
+++ bot/trunk/sophie-tools.spec.in	(revision 378)
@@ -0,0 +1,46 @@
+# $Id$
+
+%define realname   Sophie-Tools
+%define version    @VERSION@
+%define release    %mkrel %{?svnrelease:0.%{svnrelease}}%{?!svnrelease:1}
+
+Name:       sophie-tools
+Version:    %{version}
+Release:    %{release}
+License:    GPL or Artistic
+Group:      Development/Perl
+Summary:    Sophie's tools
+Source:     %{realname}-%{version}.tar.gz
+Url:        http://search.cpan.org/dist/%{realname}
+BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+BuildArch:  noarch
+
+Requires: perl-Term-ReadLine-Gnu
+
+%description
+Command line tools to query Sophie website (http://sophie.zarb.org/)
+
+%prep
+%setup -q -n %{realname}-%{version} 
+
+%build
+%{__perl} Makefile.PL INSTALLDIRS=vendor
+%make
+
+%check
+make test
+
+%install
+rm -rf %buildroot
+%makeinstall_std
+
+%clean
+rm -rf %buildroot
+
+%files
+%defattr(-,root,root)
+%doc Changes README
+%_bindir/*
+%{_mandir}/*/*
+%perl_vendorlib/*
+
Index: bot/trunk/t/Sophie-Bot.t
===================================================================
--- bot/trunk/t/Sophie-Bot.t	(revision 378)
+++ bot/trunk/t/Sophie-Bot.t	(revision 378)
@@ -0,0 +1,18 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl Sophie-IrcBot.t'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+BEGIN { use_ok('Sophie::Bot') };
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
Index: bot/trunk/t/Sophie-IrcBot.t
===================================================================
--- bot/trunk/t/Sophie-IrcBot.t	(revision 302)
+++ 	(revision )
@@ -1,18 +1,0 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl Sophie-IrcBot.t'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-BEGIN { use_ok('Sophie::IrcBot') };
-
-#########################
-
-# Insert your test code below, the Test::More module is use()ed here so read
-# its man page ( perldoc Test::More ) for help writing this test script.
-
