[Slackbuilds-users] Problems with chm2pdf and chmlib.

Antonio Hernández Blas hba.nihilismus at gmail.com
Tue Sep 1 03:22:52 UTC 2009


Hi all.

First thing, http://slackbuilds.org/repository/13.0/misc/chm2pdf/ says
that chmlib is required, wich its not quite true since chmlib its
already in slackware 13.0

Second, once i have installed chm2pdf (with its dependencies) and
trying to use it, i get the next error:

$ /usr/bin/chm2pdf --webpage abcdef.chm abcdef.pdf
rm: cannot remove `/tmp/chm2pdf/orig/abcdef/*': No such file or directory
rm: cannot remove `/tmp/chm2pdf/work/abcdef/*': No such file or directory
sh: /tmp/chm2pdf/work/abcdef/urlslist.txt: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/chm2pdf", line 1111, in <module>
    main(sys.argv)
  File "/usr/bin/chm2pdf", line 1107, in main
    convert_to_pdf(cfile, filename, outputfilename, options)
  File "/usr/bin/chm2pdf", line 326, in convert_to_pdf
    objective_urls=get_objective_urls_list(filename)
  File "/usr/bin/chm2pdf", line 114, in get_objective_urls_list
    flist=open(CHM2PDF_WORK_DIR+'/urlslist.txt','rU')
IOError: [Errno 2] No such file or directory:
'/tmp/chm2pdf/work/abcdef/urlslist.txt'
$

To fix this problem i applied a patch to chm2pdf from gentoo:
http://mirror.yandex.ru/gentoo-portage/app-text/chm2pdf/files/tempdir.patch

This patch fix a security problem with temporary dirs created at
runtime by chm2pdf:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501959

Once i reinstall chm2pdf (with the patch from gentoo) and try to use
it, i get this error:

$ /usr/bin/chm2pdf --webpage abcdef.chm abcdef.pdf
sh: enum_chmLib: command not found
Something wrong happened when launching htmldoc.
exit value:  256
Check if output exists or if it is good.
Done.
$

To fix this i've rebuilded the slackware chmlib package. The problem
its that 'enum_chmLib' is part of some example programs inside chmlib
source code and to get it inside the final package the option
'--enable-examples' should be passed to configure.

Check these URLs:
http://slackbuilds.org/slackbuilds/12.2/libraries/chmlib/chmlib.SlackBuild
http://slackware.mirrors.tds.net/pub/slackware/slackware-13.0/source/l/chmlib/chmlib.SlackBuild

Notice that rworkman's SlackBuild use this option but pat's own not,
so in the end the slackware chmlib package lacks of 'enum_chmLib' (and
other tools from chmlib).

Once i rebuild chmlib using '--enable-examples' and install it, i can
use chm2pdf without any problem:

$ /usr/bin/chm2pdf --webpage abcdef.chm abcdef.pdf
PAGES: 396
BYTES: 1344184
Written file abcdef.pdf
Done.
$

Finally, im attaching my own chm2pdf SlackBuild (BUILD=2 with gentoo's
patch and fixed README).

Thats all :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chm2pdf.tar.gz
Type: application/x-gzip
Size: 3541 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20090831/ee152f39/attachment.bin>


More information about the SlackBuilds-users mailing list