~db-keen/alexandria/working

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
= Installing Alexandria

Alexandria is written in Ruby with a GTK+2/GNOME user-interface. It
currently only runs on UNIX-style systems, such as GNU/Linux.

Alexandria is not an easy project to build from scratch. Apart from
Ruby and GNOME, it has a lot of dependencies; however, many of these
are now optional as detailed below. Once the dependencies have been
installed, building and installing Alexandria is relatively
straightforward.

[Also note that there are pre-built packages for some distros, such as
Fedora and Ubuntu.]

== Dependencies

The {Ruby-GNOME2}[http://ruby-gnome2.sourceforge.jp/] user-interface
involves a number of packages:

* <tt>ruby-gtk2</tt>
* <tt>ruby-gnome2</tt>
* <tt>ruby-libglade2</tt>
* <tt>ruby-gconf2</tt>
* <tt>ruby-pango</tt>

You should have GTK+ >= 2.8.0, and use Ruby-GNOME2 >= 0.16.0.

<tt>ruby-gettext</tt>[http://ponx.s5.xrea.com/hiki/ruby-gettext.html]
is required for the internationalisation of the user interface.
Requires version 1.7.0 or higher.

=== Hpricot

Alexandria uses +hpricot+[http://code.whytheluckystiff.net/hpricot] to
parse the HTML from web pages for providers such as DeaStore and
Siciliano. It is also used to parse the XML for the Amazon web
service. You can install the +hpricot+ package natively or as a
ruby gem.

== HTMLEntities

This is used by all website-based providers except MCU. 
 +htmlentities+[http://htmlentities.rubyforge.org/] is used to
provide more flexible HTML parsing.

== Build Dependencies

=== Ruby Dependencies

+rake+[http://rake.rubyforge.org] is required to build Alexandria from
the project +Rakefile+.

You also need +rubygems+[http://www.rubygems.org/] and
+rspec+[http://rspec.rubyforge.org/] to run the RSpec test suite.

=== Native Dependencies

The +gettext+[http://www.gnu.org/software/gettext] package is needed
to generate the binary +mo+ files used by <tt>ruby-gettext</tt> at
runtime. You also need the
+intltool+[http://www.freedesktop.org/wiki/Software/intltool] package
to merge translations into generated files (and to extract
translatable string from xml files during development).

Note that these files are pre-generated in tar.gz releases, so you'll
only need them if you're building from the SVN version, or want to
change the translations.

== Optional Dependencies

=== Ruby/ZOOM and Yaz

For Z39.50 support and and the <b>Library of Congress</b> and
<b>British Library</b> book providers you will need
<tt>ruby-zoom</tt>[http://ruby-zoom.rubyforge.org], which in turn
requires the non-Ruby package +yaz+[http://www.indexdata.dk/yaz].

Note that if you install the recent Ruby/ZOOM as the +zoom+ gem, you
will also need to install the +marc+ gem. (Older implementations of
ruby-zoom contained their own implementation of MARC.)

The Z39.50 Object-Orientation Model (ZOOM) is an international
standard for communication between computer systems, particularly
libraries and information-related systems.

=== image_size

You will need
<tt>image_size</tt>[http://rubyforge.org/projects/imagesize/] for
optimizing the cover images in exported libraries.

=== Revolution

If you want to auto-complete the names of people you loan books to
from your Evolution contacts database, you can install
+revolution+[ http://revolution.rubyforge.org/].

== Build and Install

To build Alexandria from a subversion checkout, go to the base project
directory (where the Rakefile and this INSTALL file are located) and
issue the command
    rake build
If you have downloaded a source package, this step will not usually be
necessary.

You must have root priveledges to install, so use +su+
    su -c 'rake install'
or +sudo+
    sudo rake install

Now you can check the version of the installed Alexandria
    alexandria --version

To launch Alexandria, simply use
    alexandria

If you wish to see more output on the console, you can use
    alexandria --debug

=== Staged installation for making packages

When building a binary package (such as a deb or rpm) you will want to
"install" Alexandria into a specified directory instead of the root
filesystem. You should specify this as the DESTDIR environment variable
and use the +install_package_staging+ task instead of +install+

    DESTDIR=debian/alexandria rake install_package_staging

If your distribution uses a specific directory to install Ruby
packages, you should also set the RUBYLIBDIR.

=== Installing in the home directory

If you want to install Alexandria in your home directory, you should
specify the PREFIX, SHARE and RUBYLIBDIR envrionment variables, and
use the +install_package+ task instead of +install+.

    PREFIX=$HOME SHARE=$HOME/.share RUBYLIBDIR=$HOME/.rubylib rake install_package

This will install the +alexandria+ program into +$HOME/bin+ (which you
should add to your +PATH+), and the ruby files to your
+$HOME/.rubylib+ which you should add to your +RUBYLIBDIR+ environment
variable.

=== Uninstalling

To uninstall, simply run

    sudo rake uninstall

(or +rake uninstall_package+ if you installed in your home directory).

If you specified any of the environment variables PREFIX, SHARE,
RUBYLIBDIR and DESTDIR during the installation, you should use the
same variables during uninstallation (or rake won't know where to look
for the files it has to remove).