Red Hat Bugzilla – Bug 798485
Support out-of-tree builds
Last modified: 2012-10-30 23:11:15 EDT
Description of problem:
Integrating publican builds with autotools is a pain ATM since publican must be run from the source directory. automake's make distcheck sets up a separate _build directory from which publican will be run if it is hooked up correctly.
The config file can be specified on the commandline, but the source files cannot.
Version-Release number of selected component (if applicable):
Try to build from a directory elsewhere.
Steps to Reproduce:
1. publican create --name=foo
2. mkdir foo/_build # illustrates make distcheck structure
3. cd foo/_build
4. publican build --config=../publican.cfg --formats=html --lang=en-US
Can't locate required file: en-US/Book_Info.xml at /usr/bin/publican line 647
A --source commandline flag or somesuch to specify the location of the source tree.
Automake makes the source tree read-only, so Bug 798484 comes into play here
Added new option, src_dir, to allow specifying a directory to look for publican sources in. Since it seemed redundant to also specify the cfg file it looks for the cfg file relative to the source directory.
The main reason for the config_file parameter is it allows having multiple profiles for books, i.e. sharing a book between different versions or products, so it makes sense to do it this way.
$ grep tmp_dir /home/jfearn/publican/Users_Guide/publican.cfg
$ cd /tmp
$ publican build --formats=html --lang=en-US --src_dir=/home/jfearn/publican/Users_Guide
$ firefox /tmp/build/en-US/html/index.html
Committed revision 2048 to trunk.
Does this apply to brands as well?
i.e. can I specify the location of the brand source directory somehow?
Hi, I tried to verify this and failed:
[publican-tester@fedora books]$ publican create --name=out-of-tree
Processing file en-US/Author_Group.xml -> en-US/Author_Group.xml
Processing file en-US/Book_Info.xml -> en-US/Book_Info.xml
Processing file en-US/Chapter.xml -> en-US/Chapter.xml
Processing file en-US/Preface.xml -> en-US/Preface.xml
Processing file en-US/Revision_History.xml -> en-US/Revision_History.xml
Processing file en-US/out-of-tree.xml -> en-US/out-of-tree.xml
[publican-tester@fedora books]$ mkdir out-of-tree/_build
[publican-tester@fedora books]$ cd out-of-tree/_build/
[publican-tester@fedora _build]$ publican build --config=../publican.cfg --formats=html --lang=en-US
Can't locate required file: en-US/Book_Info.xml at /usr/bin/publican line 632
Out of tree builds need to test --src_dir not --config.
Ok, I tried again:
[publican-tester@fedora _build]$ cd ~/books/out-of-tree/_build/
[publican-tester@fedora _build]$ publican build --src_dir=.. --formats=html --lang=en-US
And it worked. If this concludes testing of this feature, I'd verify this BZ.
BTW, the "--src_dir" option seems to be missing from the User Guide. Should it be added there (I found brief description of it in the man page) ?
Documentation required for --src_dir option. Added this ticket to the Publican User Guide 3.0 ticket for tracking.