- 论坛徽章:
- 0
|
Linux doesn't support CHM file very well. And there are many tools for reading chm files, such as chmsee, chmviewer, but they don't behave very well on supporting Chinese chm files.
Currently, I'm learning python and I've found that somebody says GnoCHM supports chinese well and it uses Python tools and libs, so I decided to use GnoCHM for reading chm files.
Follow the below steps to install GnoCHM on Fedora 8:
1. Go to http://gnochm.sourceforge.net/ to download
GnoCHM source file.
gnochm-0.9.11.tar.gz
Maybe I have to download PyCHM source file in orde to compile GnoCHM successfully. But
here, I haven't download it just because I want to know their dependences with each other
and have a try.
2. Change to root and move gnochm-0.9.11.tar.gz to /opt and unpack it:
tar zxvf gnochm-0.9.11.tar.gz
3. Configure and compile gnochm:
1) ./configure --help # check the default configuration
# default install dir is /usr/local
2) ./configure # use default configuration
Oh, failed, and error message is as follows:
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
Seems I have to install a perl module named XML::Parser. I search the
install disk to get this module and install it. Actually, I have to
install many modules to install it successfully. Complex dependences!
Try configure again and succeed!
3) make & make install
No PyCHM?
4. Run it:
$ gnochm
You do not have all of the required Python modules to run gnochm. Check the gnochm README file for tips on how to fix this. What follows is the error description highlighting the problematic module. No module named chm
Seems I haven't finished the installation.
Check README and several Python modules need to be installed:
- PyCHM (or python-chm) (>= 0.8.4)
- Python (>= 2.2.1)
Also, python must have gettext and locale modules
- pygtk2 (>= 1.99.12)
- pygtk2-libglade (>= 1.99.12)
- gnome-python2 (>= 1.99.11)
- gnome-python2-gtkhtml2 (>= 1.99.11)
- gnome-python2-gconf (>= 1.99.11)
- gnome-python2-bonobo (>= 1.99.11)
Next I'll install the necessary tools and modules.
5. Install PyCHM:
1) Download PyCHM to /opt and unpack it.
2) Check README. Oh, I have to install chmlib first. Fortunately, README
gives the location to download chmlib:
http://66.93.236.84/~jedwin/projects/chmlib
But I cannot connect to it. I have to find a valid address:
http://morte.jedrea.com/~jedwin/projects/chmlib/
3) Install chmlib:
When doing make, one error message blocked me:
libtool: link: `chm_lib.lo' is not a valid libtool object
Check its README file but found nothing usefull. But a mismach, I
have downloaded a tar file with version 0.39, but its README file
shows version 0.38. Try version 0.38. Made it!
4) Install Pychm:
It's a python tool, and its README file tells the install command
python setup.py install
6. Install pygtk2 and pygtk2-libglade:
Search the install disk to find the rpm packages and install them. In
fact, these two components were installed by default when I installed
Fedora 8.
7. Install gnome-python2, gnome-python2-gtkhtml2, gnome-python2-gconf and
gnome-python2-bonobo:
Search the install disk to find the rpm packages and install them. In
fact, these components were installed by default when I installed
Fedora 8. Maybe Python is popular among the open sourece communities.
8. Test:
$ gnochm
You do not have all of the required Python modules to run gnochm. Check the gnochm README file for tips on how to fix this. What follows is the error description highlighting the problematic module. libchm.so.0: cannot open shared object file: No such file or directory
Check /usr/local/lib to find libchm components:
# ls -l | grep libchm
-rw-r--r-- 1 root root 57304 11-11 16:05 libchm.a
-rwxr-xr-x 1 root root 811 11-11 16:05 libchm.la
lrwxrwxrwx 1 root root 15 11-11 16:05 libchm.so -> libchm.so.0.0.0
lrwxrwxrwx 1 root root 15 11-11 16:05 libchm.so.0 -> libchm.so.0.0.0
-rwxr-xr-x 1 root root 54238 11-11 16:05 libchm.so.0.0.0
Google it, and somebody says symbol links must be setup under /usr/lib:
ln -s /usr/local/lib/libchm.so.0 /usr/lib/libchm.so.0
Yes, I made it!
9. Run it:
$ gnochm OReilly.Programming.Python.3rd.Edition.Aug.2006.chm
Or
right click on the file and select open by chm reader.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/74700/showart_1412295.html |
|