Bug 1011222

Summary: img_dir not taken into account when locating icon.svg
Product: [Community] Publican Reporter: Stephen Gordon <sgordon>
Component: publicanAssignee: Jeff Fearn 🐞 <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1CC: aigao, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-19 02:46:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen Gordon 2013-09-23 20:18:11 UTC
Description of problem:

I used publican package to generate an SRPM for a book that has "img_dir: figures" in the publican.cfg file. When rebuilding the resultant SRPM using `rpmbuild -ba` I received this error:

cp: cannot stat 'en-US/images/icon.svg': No such file or directory
error: Bad exit status from /home/sgordon/rpmbuild/tmp/rpm-tmp.gMz4U3 (%install)

Looking in the tar file inside the SRPM I can see that icon.svg was packaged correctly (in the figures directory):

$ tar -tf Red_Hat_Enterprise_Linux_OpenStack_Platform-Configuration_Reference_Guide-4-web-en-US-4-1.tgz | grep icon.svg
Red_Hat_Enterprise_Linux_OpenStack_Platform-Configuration_Reference_Guide-4-web-en-US-4/en-US/figures/icon.svg

Line 77 of the spec file however is hard coded to expect the file to be located at en-US/images/icon.svg:

cp en-US/images/icon.svg  $RPM_BUILD_ROOT/usr/share/icons/hicolor/scalable/apps/Red_Hat_Enterprise_Linux_OpenStack_Platform-Configuration_Reference_Guide-4-en-US.svg;

Version-Release number of selected component (if applicable):

publican-3.2.1

How reproducible:

Reproducer attached.

Steps to Reproduce:
1. publican create --name "Test Book"
2. cd Test_Book
3. mv en-US/images en-US/figures
4. echo "img_dir: figures" >> publican.cfg
5. publican package --lang=en-US
6. rpmbuild --rebuild /tmp/Image_Test/tmp/rpm/Documentation-Test_Book-0.1-web-en-US-0.0-0.fc18.src.rpm

Actual results:

+ cp en-US/images/icon.svg /home/sgordon/rpmbuild/BUILDROOT/Documentation-Image_Test-0.1-web-en-US-0.0-0.fc18.x86_64/usr/share/icons/hicolor/scalable/apps/Documentation-Image_Test-0.1-en-US.svg
cp: cannot stat 'en-US/images/icon.svg': No such file or directory
error: Bad exit status from /home/sgordon/rpmbuild/tmp/rpm-tmp.OKiyeG (%install)


RPM build errors:
    Bad exit status from /home/sgordon/rpmbuild/tmp/rpm-tmp.OKiyeG (%install)

Expected results:

Spec file correctly updated to use img_dir.

Comment 2 HSS Product Manager 2013-09-23 22:37:33 UTC
HSS-QE has reviewed and declined this request. QE for this bug will be handled by IED.

Comment 3 Jeff Fearn 🐞 2013-09-23 23:20:00 UTC
Update path in rpm_templates/spec.tmpl

To ssh://git.fedorahosted.org/git/publican.git
   87804ea..6347b27  HEAD -> devel

Comment 4 Ruediger Landmann 2013-10-11 03:38:06 UTC
Verified with publican-3.9.9-0.fc19.t4.noarch