![]() |
#1 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83
Karma: 888
Join Date: May 2010
Device: Nook Touch, iPad1, iPad2, iPod Touch 4G, Pixel Qi
|
[HOW TO] Install Calibre in Intel-Based NAS
I think I should write up the instruction for installing Calibre on Intel-based NAS. Please refer to the following instruction. If you have any question, please let me know.
Best regards, Anat Ruangrassamee -------------------------------------------------------------------------------- How to install Calibre in Intel-Based NAS 18 September 2011 I successfully install Calibre on a Synology DS411+II NAS to run news fetching and the content server. I tried to compile libc but had several problems. The key to the success is “Debian 6 chroot environment”. This instruction may work for other Intel-based NASes for example QNAP. NOTE: The instruction for the ARM-based NAS was added by smintman in the following posts. Prerequisite Bootstrapped NAS For Synology, refer to http://forum.synology.com/wiki/index...trap,_ipkg_etc http://forum.synology.com/wiki/index...tall_Bootstrap Steps 1. Preparing chroot environment on a PC I followed the instruction in the following websites with slight modifications to create Debian 6.0.0 packages for i386 targets which is required by Calibre http://kristof.vanhertum.be/?p=132 http://www.nslu2-linux.org/wiki/DS101/Debian Code:
debootstrap --foreign --arch i386 squeeze chroottarget "http://ftp.de.debian.org/debian" http://www.mediafire.com/?dbjgsc8v7u1dxps 2. Setup the chroot environment in your NAS 2.1 Copy the chroot target to a HDD in your NAS (/volume1/debian/ in this instruction) by any approach (FTP, NFS,etc). From now, you should use a terminal program to execute commands. 2.2 At the directory /volume1/debian/, uncompress the chroot target file using this command (Note: Don’t type # and anything in front of #) Code:
ds # tar -xvf chroottarget.tar.gz Code:
ds # chroot chroottarget /debootstrap/debootstrap --second-stage Code:
ds # cp /etc/resolv.conf /volume1/debian/chroottarget/etc/ ds # cp /etc/hostname /volume1/debian/chroottarget/etc/ At the directory /volume1/debian/, input this command: Code:
ds # chroot chroottarget /bin/bash Code:
ds-chroot # mount -t proc proc /proc Code:
ds-chroot# echo "deb ftp://ftp.debian.org/debian stable main contrib non-free" > /etc/apt/sources.list ds-chroot# apt-get update Code:
ds-chroot# apt-get install calibre ds-chroot# apt-get install python ds-chroot# apt-get install bzip2 ds-chroot# apt-get install unzip 5.1 Make the directory “calibre” in the directory “/opt” 5.2 Download Calibre from http://sourceforge.net/projects/calibre/files/ . You may use the newest version for i686 (I use Calibre 0.8.15 on my NAS.). You can download the file to your PC and then copy to /volume1/debian/chroottarget/opt/calibre. Then uncompress the file in the directory /opt/calibre Code:
ds-chroot# bzip2 -dv calibre-0.8.15-i686.tar.bz2 ![]() 6. Use Calibre 6.1 The recipes are in /opt/calibre/resources/ builtin_recipes.zip. Unzip the file and move the recipe you want to /opt/calibre 6.2 Make a directory “serve” in /opt/calibre for storing ebooks. 6.3 Run the content server by this command Code:
/opt/calibre/calibre-server --with-library /opt/calibre/serve/ --port 8081 –-daemonize Code:
/opt/calibre/ebook-convert /opt/calibre/***.recipe /opt/calibre/***.epub /opt/calibre/calibredb add --duplicates --with-library /opt/calibre/serve/ /opt/calibre/***.epub I use APScheduler 2.0.2 for python. Follow the instruction in this website: http://pypi.python.org/pypi/APScheduler/ This is my script (script.py): Code:
import os import time from apscheduler.scheduler import Scheduler # Start the scheduler sched = Scheduler() sched.start() def job_function1(): os.system("/opt/calibre/ebook-convert /opt/calibre/cnn.recipe /opt/calibre/cnn.epub") os.system("/opt/calibre/calibredb add --duplicates --with-library /opt/calibre/serve/ /opt/calibre/cnn.epub") os.system('/opt/calibre/ebook-convert /opt/calibre/cnn.recipe /opt/calibre/cnn.mobi') os.system('/opt/calibre/calibre-smtp -r smtp.gmail.com -v --port 587 --username XXXXX@gmail.com --password YYYYY --a /opt/calibre/cnn.mobi --s "News Delivery" XXXXX@gmail.com ZZZZZ@free.kindle.com ""') # Schedule sched.add_cron_job(job_function1, day_of_week='mon-sun', hour=4, minute=0) while True: time.sleep(10) Code:
nohup python script.py & Code:
cd /volume1/debian/ chroot chroottarget /bin/bash mount -t proc proc /proc cd opt/calibre/ /opt/calibre/calibre-server --with-library /opt/calibre/serve/ --port 8081 --daemonize nohup python script.py & Last edited by aruangra; 09-22-2011 at 10:45 PM. |
![]() |
![]() |
![]() |
#2 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() Posts: 475
Karma: 590
Join Date: Aug 2009
Location: Bangkok, Thailand
Device: Kindle Paperwhite
|
Great and very clear instruction.
Last edited by bthoven; 09-18-2011 at 06:28 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2011
Device: Kindle3
|
Modification for ARM based NAS (Synology DS211j)
After one day of experimenting.
Step 1. I installed debian on VirtualPC. I followed instructions in to create Debian 6.0.0 packages for armel target http://kristof.vanhertum.be/?p=132 with small change debootstrap --foreign --arch armel lenny chroottarget "http://ftp.de.debian.org/debian" Step 4. I installed calibre with apt-get, but later I removed it. Step 5. I used Source install from http://calibre-ebook.com/download_linux, becouse there is no binaries for ARM architecture. After instalation of all packages and succesfull compiling - calibre is working ![]() Thanks aruangra. Last edited by smintman; 09-20-2011 at 04:12 PM. |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83
Karma: 888
Join Date: May 2010
Device: Nook Touch, iPad1, iPad2, iPod Touch 4G, Pixel Qi
|
smintman,
Good to hear that it works. 1. To make the debian 6.0.0 package, we must specify "squeeze" instead of "lenny" debootstrap --foreign --arch armel squeeze chroottarget "http://ftp.de.debian.org/debian" Am I correct? 2. I am interested to know how you compile the source. Could you please elaborate more? For example...What is the command for compiling ? What dependencies do you need to install before compiling? and How? 3. Does Calibre in your 211j work for both fetching news and serving contents as a webserver ? I have several ARM-based PCs lying around. So, it would be useful if I can run calibre on it. Last edited by aruangra; 09-20-2011 at 10:28 PM. |
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2011
Device: Kindle3
|
Quote:
Ad1. It was my first attempt with linux ![]() Ad2. With compiling it was bigger problem ![]() So I tried procedure Source install from http://calibre-ebook.com/download_linux. 1. One problem was with python, i didn't have version 2.7.1. I followed instructions on page http://www.gossamer-threads.com/list.../python/918238. I added "deb http://ftp.uk.debian.org/debian/ unstable main contrib non-free" to #/etc/apt/sources.list and installed python2.7. 2. I thought, that I have all dependencies, so I continued. 3. Code:
wget -O- http://status.calibre-ebook.com/dist/src | tar xvz 4. I entered Code:
python2.7 setup.py install Code:
apt-get install xxxxxxx 5. Everything was compiled, I had calibre commands and I thought that I finished, but it didn't work when I tried to start calibre server. Error was "no such file python2:" And answer from google: Code:
ln -s /usr/bin/python2.7 /usr/bin/python2 Ad 3. I tried to fetch news as test. Code:
ebook-convert /opt/calibre/recipes/dilbert.recipe /opt/calibre/serve/dilbert.mobi --output-profile kindle ![]() After it I tried to add it to server and start. Code:
calibredb add --duplicates --with-library /opt/calibre/serve/ /opt/calibre/serve/dilbert.mobi calibre-server --with-library /opt/calibre/serve/ --port 8081 daemonize ![]() Scheduling and mailing is also working, there is only one little problem, that in scheduling system there is UTC time, that is probably from debian setup. So it was hard for me, because I had no experience with linux,debian,arm till this week, I didn't understand most of things that I did and some steps may be obsolete or funny for linux geeks. But big my thanks goes to google and kovid for calibre. So if it can be done easier, let me know. Today I will try to setup scheduler, based on your step 7. Last edited by smintman; 09-23-2011 at 04:09 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83
Karma: 888
Join Date: May 2010
Device: Nook Touch, iPad1, iPad2, iPod Touch 4G, Pixel Qi
|
smintman,
Thanks for your clear answer. I will try it on my ARM PC tonight. I am also very new to Linux and google helps a lot ![]() Regards, aruangra |
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83
Karma: 888
Join Date: May 2010
Device: Nook Touch, iPad1, iPad2, iPod Touch 4G, Pixel Qi
|
I am compiling Calibre on my ARM-based pc and got this error. I have both "python-qt4" and python-qt4-dev" packages installed before compiling.
Code:
root@localhost:/opt/calibre# python2.7 setup.py install Traceback (most recent call last): File "setup.py", line 13, in <module> import setup.commands as commands File "/opt/calibre/setup/commands.py", line 34, in <module> from setup.extensions import Build, BuildPDF2XML File "/opt/calibre/setup/extensions.py", line 12, in <module> from PyQt4.pyqtconfig import QtGuiModuleMakefile ImportError: No module named PyQt4.pyqtconfig root@localhost:/opt/calibre# |
![]() |
![]() |
![]() |
#8 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Sep 2011
Device: Kindle3
|
Quote:
Last edited by smintman; 09-24-2011 at 02:27 AM. |
|
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83
Karma: 888
Join Date: May 2010
Device: Nook Touch, iPad1, iPad2, iPod Touch 4G, Pixel Qi
|
smintman,
Thank you for the list. Calibre 0.7.7 that came with Debian 6.0.0 works well. So, I didn't try to compile the new version. ![]() Best regards, Anat |
![]() |
![]() |
![]() |
#10 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2010
Device: Kindle 3
|
Was able to get through it all, but get the following error when I finally try to run calibre. Seems it might be a GLIBC version issue; any ideas? ...would an earlier version of calibre work better (I pulled the latest 0.9.15)?
Code:
WARNING: Failed to set default libc locale, using en_US.UTF-8 Traceback (most recent call last): File "site.py", line 53, in main File "site.py", line 13, in set_default_encoding File "locale.py", line 539, in setlocale Error: unsupported locale setting |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre on Qnap NAS TS419P | 2012 | Related Tools | 6 | 10-04-2016 01:28 PM |
Error when running on Atom D525-based DS411+II NAS server | aruangra | Related Tools | 15 | 09-19-2011 03:15 AM |
Calibre Content server and Iomega NAS | subivan | Devices | 9 | 08-12-2011 05:26 PM |
Using Calibre on a NAS | Shawn_KY | Calibre | 9 | 01-07-2011 01:24 AM |
Calibre hangs on startup after moving to NAS | smartin | Calibre | 4 | 09-26-2010 04:21 PM |