Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-16-2009, 01:46 AM   #16
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Hooray, I had success building calibre-0.4.137-1.x86_64.rpm and its src.rpm for Fedora 10, using the system odfpy, pyPdf, and python-{cherrypy,cssutils} packages.

I wound up deleting the bits about the postinstall, as I wasn't in the mood to solve that one (possibly don't execute that section if RPM_BUILD_ROOT is defined, but I don't know, nor do I feel like messing with exceptions from os.environ for a simple unset envvar. I did mention I dislike coding in python... )

I also made good use of the packaging info here, as I tend not to package python much: http://fedoraproject.org/wiki/Packaging/Python
heyjohn is offline   Reply With Quote
Old 02-16-2009, 06:47 AM   #17
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by heyjohn
- Is the calibre_postinstall thing just a validation/test script to see whether all the site-python bits were really installed? If so, it'll make more sense to put a python one-liner into the %post section of the .spec file.
calibre_postinstall does things like generate and install the FDI used by hal for device detection on Linux. It also sets up bash completion, and installs the desktop integration files (icons and .desktop). Take a look at post_install() in src/calibre/linux.py to see what it fully does. Some of it can be handled by the package manager.

Quote:
Originally Posted by heyjohn
- What are cherrypy, pyPdf, odfpy, and python-cssutils doing as part of this package? Are they modified versions, or taken straight from other projects? I already have them on my system, and do not want to overwrite my distro's versions. That's why I do this RPM thing and not binary installers...
They are part of the package because systems Windows does not provide a Linux like package manager. Also, distributing them this way avoids issues with the system package being out of date. Further it allows the building of the binary installer package. There should be no issue replacing them with the system package provided the versions are the same or compatible. Kovid has a tendency to require the latest and greatest.
user_none is offline   Reply With Quote
Advert
Old 02-16-2009, 08:02 AM   #18
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by user_none View Post
There should be no issue replacing them with the system package provided the versions are the same or compatible. Kovid has a tendency to require the latest and greatest.
The 'cssutils' package has a change calibre requires for Mobipocket and LIT generation which has been pushed upstream but exists only in the most recently released 'cssutils'. The 'odf' package has a change that I haven't push upstream yet, but it's only a fairly minor enhancement.
llasram is offline   Reply With Quote
Old 02-21-2009, 02:34 AM   #19
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Last I looked, calibre_postinstall also does inappropriate things for an RPM, such as checking the Qt version (4.4.2, unlike the 4.4.0 in the install info on the wiki). That sort of thing is done with a 'Requires:', and the package doesn't get onto the system without the right Qt version. (The right version should be automagically pulled in by the package manager, if needed.)

Can you do a 'calibre_rpm_postinstall' that can be run once all the dependencies are met, and which can be easily called from the %post of an RPM?

Once the other changes are pushed upstream (cssutils/other forks), everything else pretty much works. The "because Windows doesn't have it" stuff is deleted in the .spec file I've written. It would be a minor time-saver to avoid building it if not isWindows (or isRpmLinux).

Right now, a default rpmbuild of 0.4.139 on Fedora 10 gives me:
You must be root to run this command.
Traceback (most recent call last):
File "setup.py", line 183, in <module>
subprocess.check_call('calibre_postinstall', shell=True)
File "/usr/lib64/python2.5/subprocess.py", line 462, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'calibre_postinstall' returned non-zero exit status 1
error: Bad exit status from /var/tmp/rpm-tmp.bOlTyc (%install)

So I'll have to re-hack that for the time being.
heyjohn is offline   Reply With Quote
Old 02-21-2009, 03:18 AM   #20
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,211
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If the rpm package manager is going to ensure an appropriate version of Qt then checking the Qt ersion in calibre-Postinstall is perfectly harmless. As for the require root have you run

calibre_postinstall --help

It has various options, including an option to skip the root check.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-21-2009, 07:24 AM   #21
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Take a look at the Debian package. I realize it's pretty different than RPM but looking at how they're handing the install might help.
user_none is offline   Reply With Quote
Old 02-21-2009, 02:42 PM   #22
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Cool, will have look to see what others are doing with the packaging; will also try to see what's going on with the post-install. Probably next weekend, the way things are going. Thanks.
heyjohn is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] New to Calibre--problems converting files rxmom03 Calibre 4 07-04-2012 09:46 PM
Converting Mobipocket PRC files HarryT Sony Reader 7 12-16-2011 01:46 PM
Help! Newbie having problems converting HTML/CSS files jackie_w Calibre 6 09-14-2009 04:53 PM
Error in converting files html --> Mobipocket adamsloco Calibre 0 08-29-2009 10:30 PM
Problems Converting files using libprs500 nosfuerato Calibre 3 12-27-2007 08:33 AM


All times are GMT -4. The time now is 06:24 PM.


MobileRead.com is a privately owned, operated and funded community.