Managing your e-book collection
In an earlier post, I hinted about a Slackware package I was trying to create for Calibre. The reason being that I bought my wife an e-reader: a Sony PRS650 with a touch screen using infrared instead of a touch-sensitive layer and pearl e-ink technology. Both those features make for an extremely pleasant reading experience.
However, the Sony Reader software that accompanies the device, is a Windows-only application (of course…) and second, it is not all that much of an application either. Even for Windows, the usual advice you get it is to install Calibre for managing your e-books – including uploading them to your device.
So, I needed to have Calibre available on my Slackware computers. In fact, I used to have a package for Calibre already! At some point in time the Calibre developer decided to increase the required version of the Python interpreter to 2.7.1. And since Slackware ships Python 2.6.6 to this day, I was no longer able to compile updated packages (I got stuck at 0.7.23 but I guess it would have been possible to keep compiling Calibre as far as 0.7.45).
I still wanted a recent version of Calibre, the software has updates about once a week! So I spent quite a lot of time researching how I could add an embedded Python interpreter plus several supporting Python modules into the Calibre package.
And I think I succeeded. I have uploaded Slackware packages for calibre-0.8.6 to my repository yesterday (for Slackware 13.1 as well as Slackware 13.37). During the period where I did not actually have an e-reader at my disposition (it arrived at the house only a few days ago) I used the testing genius of my pal mrgoblin who happened to have an e-reader device in his possession. His beta tests made me realize that I was missing the dbus-python module which is needed for Calibre to recognize when a device is plugged into the computer.
I must say, using Calibre is a lot of fun! I have a small collection of e-books and after installing the Slackware package, I was able to transfer my books to the Sony device and read them there. Then, I managed to almost brick the device by ripping out the USB cable before selecting “Eject Device” in Calibre… let that be a warning for prospective users! It took a lot of reading about soft and hard resets before I had a working e-reader again. I had to reset the device to factory defaults – which means you lose all the books that were already present on the device. It was a good learning experience with only minor inconvenience (because I had transfered only two books to the e-reader at the time) but I kept feeling my wife’s prying eyes in the back of my neck… she was not too pleased with seeing her birthday present getting bricked only 15 minutes after unpacking it!
Calibre will also be very useful for everyone who owns a Kindle (Amazon’s own e-reader). The Kindle only accepts Amazon’s own MOBI format and refuses the “open” EPUB format (which is the most commonly used e-book format outside the US). Using Calibre, you can easily convert your EPUB collection to MOBI format – when you select an EPUB file and tell it to upload it to a Kindle, Calibre will show a dialog that prompts for the automatic conversion to the Kindle’s format. Perfect!
OK, enough talk. Get a package and/or SlackBuild script at:
- http://slackware.com/~alien/slackbuilds/calibre/
- or its mirror http://taper.alienbase.nl/mirrors/people/alien/slackbuilds/calibre/
and don’t forget to also install the icu4c and podofo packages; these two are the only dependencies now. If you want to build the package yourself, be warned if you are running Slackware-current. There is a bug in the “file” utility in Slackware-current which prevents it from recognizing a ZIP file as such, and this bug will cause the SlackBuild script to fail. Thanks to Francesco Allertsen who first ran into this issue and reported it to me, a quick fix is to change the line 235 in the calibre.SlackBuild script:
if $(file ${SOURCE[$i]} | grep -qi “: zip”); then
to:
if $(echo ${SOURCE[$i]} | grep -qi “.zip$”); then
I hope to see a fixed “file” soon. A bugfix has been applied to the file repository already, so file-5.08 should detect ZIP files correctly when it gets released.
Have fun! Eric
Even after changing “file” to “echo” I still get the following error:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors
calibre.SlackBuild FAILED at line 238
Good job, Eric!
Simply adding backported ‘importlib’, ‘counter’, and ‘ordereddict’ does not work any more with calibre-0.8.4, in which more features from python 2.7 were introduced. Your solution is simple and straightforward.
Awesome job Eric! I had got stuck with calibre 0.7.49 or something because of the python requirement too. Time to check out those 0.8 features!
Never mind my post above. I have it working. Thanks Eric.
Hi Eric. Thanks again for your great job. There is a typo in the description provided in the rss feed. It should be:
podofo: updated to 0.9.1
Hi Eric. I think there is a typo in the 0.8.12 version of calibre.SlackBuild. Should
export PKG_CONFIG_PATH=”/usr/lib${LIBDIRSUFFIX}/calibre/lib/pkgconfig:$PKG_CONFIG_PATH”
be
export PKG_CONFIG_PATH=”/usr/lib${LIBDIRSUFFIX}/calibre/lib/pkgconfig:$PATH”
I am getting an error otherwise.
Hi Brad
Actually it must be the way I have it in the SlackBuild – that line expands the list of directories where pkg-config looks for files. The $PATH must not be included at the end, but $PKG_CONFIG_PATH must (this variable is usually empty though).
What is your error? It may be caused by somethng else concerning the value of your $PATH variable
Eric
Hi.
Since my screw-up with that “file” command bug and I didn’t check this post recently I have flooded somehow the #slackware channel on freenode irc network. But the even with the changed line: “if $(echo ${SOURCE[$i]} | grep -qi “.zip$”); then” it didn’t work here. So I guess I have annoyed Eric with it. Sorry Eric.
One of the member of the channel, mancha, did purpose something that work.
He change that line to:
if [ $(echo ${SOURCE[$i]} | awk -F. ‘{print $NF}’ | tr ‘A-Z’ ‘a-z’) == “zip” ]; then
And it work for me so far. This is all about Slackware-current.
Here it is a link with the all SlackBuild: http://pastebin.com/KiTX9E5C
Anyhow the program is great so as the Slackware package for it. I am really grateful.
Thank you Eric!
Hi Arvent
The problem lies in the “file” package of Slackware-current. I build my packages on Slackware 13.37 so I am not affected by the “file” bug. Nevertheless, I updated the calibre.SlackBuild script so that it works around this bug. I did it differently than mancha suggested (looking at a file’s extension is so Windows… in Linux we can do better). The fixed SlackBuild script is already in my repository.
And no, you did not annoy me. I just “stopped” responding because it was Saturday night, and I do have a life. I did not look at my computer until Sunday morning.
Eric
Thank You!
Hi Eric. I have never earned an e-reader, and I would like, if you got the time, to tell me about Sony PRS650. I just wanna read my pdfs and open-format books. Would it be suitable to me? I don’t care about this “tablet wave” by now – I like desktops. Even notebooks annoy me a bit. Thank you, Eric.
The Sony PRS650 is a very nice e-reader device. My wife owns this one and uses it every day. I have the newer PRS-T1 which also allows for Wireless network connection. This has the same wonderful touch screen, but it is cheaper because it is build from cheaper material (for instance, the PRS650 has a metal body while my T-1 is all plastic).
If you can get one, it’s worth the price. Reading books is much more comfortable using an e-reader… never use a tablet computer for this, unless your room is dark. An e-reader screen is easier to read when there is more sunlight! No tablet computer or notebook can accomplish that.
PDF and EPUB format are both supported. And using Calibre, you can convert all kinds of other formats to EPUB and load them into the e-reader. I have been releasing Calibre updates every week since I wrote this post, and I use Calibre all the time (it fetches an EPUB version of my daily newspaper every day).
Eric
Thank you, Eric. I will give them a try and use your pkgs for Calibre.
Hi Eric,
Many thanks for your excellent jobs. The problem is almost surely not on your side.
It seems to me that new version of calibre (0.8.49) does not work properly. I have just upgraded from 0.8.42 to it but all conversions fail. Restoring to an older version (0.8.35, I have no 0.8.42 now) all function is working.
Although calibre’s versions have very short lifetimes, but it would be useful to reach some older versions. Is it possible, at all?
asnobli
Hi Eric.
I can see that you’ve upgraded your Calibre package to the latest version. I might also want to upgrade cssutils to =>0.9.9. Otherwise Calibre won’t convert from pdf to epub.
regards
sycamorex
Thanks sycamorex & asnobli9
I use Calibre mainly as a library tool and not so much for converting, so the error message remained hidden for me until I read your posts and tried to convert a book.
I have uploaded new builds of my calibre packages by now. The rebuilt package contains several updated internal libraries (PyQt, sip and of course cssutils) and I verified that converting an ebook works now.
Cheers, Eric
HI Eric,
Thank you for your efforts and the rebuilt version! I upgraded it to your new build and it works again nicely.
Good luck, asnobli9
Thanks Eric,
Works fine.
Do jpegs display in your latest version? I rebuilt and I am now getting “IOError: encoder jpeg not available” for most book covers in the ebook-viewer.
Hi Brad
I don’t have those issues with the package I built and installed here.
The error seems to be caused by the Python Image Library (which is compiled into the Calibre package). Perhaps you have another copy of it on your computer and that is being picked up instead?
Eric
Hi!
Calibre somehow misses css-utils residing within it’s tree and argues it con not find them. Any ideas rather than install them system-wide?
mea culpa – i used the one built by myself… i solved the problem by installing one from your repository