]> git.donarmstrong.com Git - infobot.git/blob - INSTALL
use result div in babelfish
[infobot.git] / INSTALL
1                            --------------------------
2                            -- General Installation --
3                            --------------------------
4
5 This file contains some general guidelines for installing infobot on your
6 system. At this point it is very basic, but should hopefully clear up some of
7 your confusion.
8
9 Configuration:
10
11     - Copy files/sample/* to files/
12
13     - Edit files/infobot.config, modify to taste.
14     - Edit files/infobot.servers to modify list of IRC servers to connect.
15     - Edit files/infobot.chan to set which channels to join.
16
17 Required Perl modules:
18
19     - Net::IRC perl module
20         - Debian: (apt-get install libnet-irc-perl)
21     - WWW::Search
22         - Debian: (apt-get install libwww-search-perl)
23     - LWP
24         - Debian: (apt-get install libwww-perl)
25     - HTML::Parser
26         - Debian: (apt-get install libhtml-parser-perl)
27     - XML::Feed
28         - Debian: (apt-get install libxml-feed-perl)
29
30 Choose your database:
31         - MySQL, read the section MySQL below
32         - SQLite or SQLite2, read the section SQLite below
33         - PgSQL, read the section PostgreSQL below
34
35 NOTE: There are "bugs" in the perl modules.  Read the section "Patches" below, on how to fix.
36
37 Finally, start your bot by changing to the base dir and type:
38
39     ./infobot
40
41
42
43                                  -------------
44                                  -- Patches --
45                                  -------------
46
47 - apply *.patch patches inside patches/
48     - cd /usr/lib/perl5/WWW/Search
49     - patch -p0 < WWW::Search::Google.patch
50
51 - alternatively, move the files from patches/
52     - mv patches/Google.pm /usr/lib/perl5/WWW/Search/
53
54
55 Net::IRC DCC CHAT
56 -----------------
57 Unfortunately, Net::IRC 0.70 has buggy code that does not detect DCC CHAT
58 properly. to patch:
59     - cd /usr/share/perl5/Net/IRC/
60     - cat ~bot/patches/Net_IRC_Connection_pm.patch | patch -p0
61
62
63
64
65                                 ----------------
66                                 -- PostgreSQL --
67                                 ----------------
68
69 - Debian: (apt-get install postgresql)
70 - Debian: (apt-get install libpg-perl)
71
72
73 As of now, infobot has full pgsql support. It seems to be working 100%, but it
74 assumes that you have precreated the database and user for now. As long as you
75 already created the database and user and stored this info in the
76 infobot.config, then the tables will automatically be created on startup. Until
77 I get setup.pl fixed, run the following commands as root (or postgres if root
78 doesnt have permission to create users/db's):
79
80     > createuser --no-adduser --no-createdb --pwprompt --encrypted <user>
81     > createdb --owner=<user> <dbname> [<description>]
82
83 Dont forget to replace <user> and so forth with actual values you intend to use,
84 and dont include the <>'s ;) If you run these commands, you should get a user
85 with an encrypted password that cannot create new db's or user's (as it should
86 be!), and the user will own the newly created database <dbname>. Congrats!
87
88 If everything went fine, you should have everything infobot needs to use pgsql.
89 Next simply cd to the base directory you installed the bot to and type:
90
91     ./infobot
92
93
94 Thats it! Everything the bot needs should be automatically created when it loads
95 for the first time.
96
97 In the future I will try to get around to editing the setup.pl file to ask the
98 same questions it does for mysql (your root password etc) so that you can skip
99 manually creating the database/user. But for now, this should be just fine for
100 most of you techies out there.
101
102
103
104
105                                   -----------
106                                   -- MySQL --
107                                   -----------
108
109 - Install a MySQL server and the DBI Perl modules.
110     - Debian: (apt-get install mysql-server libdbd-mysql-perl)
111
112 - Run 'mysqladmin -u root -p create <DB NAME>'
113     Where <DB NAME> is the same as specified in infobot.config.
114
115 - Run 'setup/setup.pl'
116     FIXME: This script is horribly broken! Do NOT use it! The bot will
117     automatically create the tables when it starts. You just need to ensure that
118     the database and the login information are correct, and start the bot.
119
120 Possible problems
121 -----------------
122     - if connection to localhost is (short) refused, run
123             '/etc/init.d/mysql stop'
124             '/etc/init.d/mysql start'
125     - if connection for user is refused, reload grant tables with
126             'mysqladmin -u root -p reload'
127
128 * [OPTIONAL]
129     - run 'scripts/dbm2mysql.pl old-db' to convert dbm database file
130     to mysql.
131
132
133 ADDITIONAL NOTES
134 ----------------
135 You can add a new user manually by connecting to MySQL and performing these
136 commands:
137
138   $ mysql -u root -p
139
140   mysql> CREATE DATABASE infobot;
141   mysql> GRANT USAGE ON *.* TO 'user'@'localhost' IDENTIFIED BY 'yourpassword';
142   mysql> GRANT ALL PRIVILEGES ON infobot.* TO 'user'@'localhost';
143
144 FULL FACTOID DATABASE
145 ---------------------
146 You can get the data from the MySQL database that the apt bot uses on
147 #debian at freenode (irc.freenode.net), at:
148
149     http://lain.cheme.cmu.edu/~apt/infobot/apt.sql.bz2
150
151
152
153
154                                   ------------
155                                   -- SQLite --
156                                   ------------
157
158 SQLite is a C library that implements an embeddable SQL database engine.
159 Programs that link with the SQLite library can have SQL database access without
160 running a separate RDBMS process. The distribution comes with a standalone
161 command-line access program (sqlite) that can be used to administer an SQLite
162 database and which serves as an example of how to use the SQLite library.
163
164 infobot will create a file called <DBname>.sqlite and populate the tables for
165 you if they do not already exist.
166
167 - Install SQLite libraries and DBI Perl modules.
168     - Debian: (apt-get install libsqlite0 libdbd-sqlite-perl)
169
170 other distros might need to build from sources.
171
172 You may use either DBD::SQLite or DBD::SQLite2
173
174 SQLite sources:
175
176     http://www.hwaci.com/sw/sqlite/
177
178 DBD::SQLite sources:
179
180     http://search.cpan.org/author/MSERGEANT/DBD-SQLite/
181
182 You will also need the normal Perl DBD stuff which should be included in your
183 Perl distribution.
184
185 # vim:ts=4:sw=4:expandtab:tw=80