Few weeks ago I bought a new netbook. I wanted it to serve also as my encyclopedia. The solution is to install on it offline Wikipedia.
Inbar Hovav explained, in her Hebrew language blog, how to accomplish this using kiwix.
לפני כמה שבועות רכשתי נטבוק חדש. רציתי שזה ישמש אותי גם כאנציקלופדיה. הפתרון הוא להתקין עליו גירסא לא מקוונת של הויקיפדיה.
ענבר חובב הסבירה בבלוג שלה איך לבצע זאת תוך שימוש ב-kiwix.
Unfortunately, kiwix was built for Ubuntu but not for Debian. I downloaded the source code and found that it contains the Debian control files needed to build a .deb from it. Nice, except for a problem: it declared dependencies upon package versions, which exist in Ubuntu but not in Debian.
I solved the problem by editing the debian/control and debian/changelog files, installing dependencies which exist in Debian Wheezy and building the package (using dpkg-buildpackage -us -uc).
To save you some work, I created a diff file which shows what I changed:
diff -r kiwix-0.9/debian/changelog kiwix-0.9.patched/debian/changelog
1c1,13
< kiwix (0.9-alpha7.1) maverick; urgency=low
---
> kiwix (0.9-alpha7.1oz2) wheezy; urgency=low
>
> * Changed to depend upon libxapian22 instead of libxapian15
>
> -- Omer Zak <[email protected]> Wed, 29 Jun 2011 06:50:00 +0300
>
> kiwix (0.9-alpha7.1oz1) wheezy; urgency=low
>
> * Same code as 0.9-alpha7, simply change debian/control and rebuild.
>
> -- Omer Zak <[email protected]> Wed, 29 Jun 2011 06:04:04 +0300
>
> kkiwix (0.9-alpha7.1) maverick; urgency=low
diff -r kiwix-0.9/debian/control kiwix-0.9.patched/debian/control
12c12
< xulrunner-1.9.2-dev,
---
> xulrunner-dev,
26,27c26,27
< libicu42,
< libxapian15,
---
> libicu44,
> libxapian22,
30c30
< xulrunner-1.9.2,
---
> xulrunner-1.9.1,
54c54
< * Tabs navigation
\ No newline at end of file
---
> * Tabs navigation
The full sequence of steps is as follows.
If you are not using Debian Wheezy, you’ll have to modify some details below.
- Download kiwix-0.9-alpha7-src.tar.bz2.
- tar jxvf kiwix-0.9-alpha7-src.tar.bz2
- cd kiwix-0.9 and modify two files as described above
- Install any missing packages you need for building and installing. The debian/control file lists the packages you need.
- Build the .deb file by: dpkg-buildpackage -us -uc
- You’ll find the .deb file in the parent directory of kiwix-0.9 under the name: kiwix_0.9-alpha7.1oz_ARCH.deb where ARCH is the name of the architecture under which you built it.
Now, become root and do:
- cd ..
- dpkg –install kiwix_0.9-alpha7.1oz_ARCH.deb
- cd /usr/local/bin
- ln -s /usr/bin/xulrunner-1.9.1 xulrunner
The next step is to become again a regular user and download the *.zim files that you want and open them inside kiwix. Please be prepared to wait patiently while kiwix indexes the files when you open them for the first time.
Kiwix is now in Debian Wheezy.
http://packages.debian.org/sid/kiwix