Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1061155

Summary: Incorrect *.py[co] files placement
Product: Red Hat Enterprise Linux 7 Reporter: Branislav Náter <bnater>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: bfan, leiwang, mbooth, ptoscano, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.22.6-19.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 13:19:18 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:
Bug Depends On: 1062533, 1062890    
Bug Blocks:    

Description Branislav Náter 2014-02-04 13:01:48 UTC
Description of problem:
We are doing checks regarding correct placement of *.py[co] files in rpm packages.

In your x86_64 package, we found *.py[co] files placed under /usr/lib/ directory. In 64bit package *.py[co] files are expected to be placed in /usr/lib64/ dir or package to be build as noarch package.

Could you please move files to /usr/lib64?
Or should this package be build as noarch?

Version-Release number of selected component (if applicable):
python-libguestfs-1.22.6-18.el7.x86_64.rpm

Actual results:
python-libguestfs-1.22.6-18.el7.x86_64.rpm]: /usr/lib/python2.7/site-packages/guestfs.py
python-libguestfs-1.22.6-18.el7.x86_64.rpm]: /usr/lib/python2.7/site-packages/guestfs.pyc
python-libguestfs-1.22.6-18.el7.x86_64.rpm]: /usr/lib/python2.7/site-packages/guestfs.pyo

Expected results:
Correct placement of files under /usr/lib64 or package built as noarch

Comment 1 Richard W.M. Jones 2014-02-04 13:54:00 UTC
So the problem turns out to be the RPM spec file which does:

# Move Python libraries to sitelib.
if [ "$RPM_BUILD_ROOT%{python_sitearch}" != "$RPM_BUILD_ROOT%{python_sitelib}" ]; then
   mkdir -p $RPM_BUILD_ROOT%{python_sitelib}
   mv $RPM_BUILD_ROOT%{python_sitearch}/guestfs.py* \
     $RPM_BUILD_ROOT%{python_sitelib}/
fi

which is wrong since the Python package is not noarch.

I have removed this section from Rawhide now:

http://pkgs.fedoraproject.org/cgit/libguestfs.git/commit/?id=f36b756d0807ee958a6a60585fd520330033a56f

After the Rawhide fix:

$ rpm -qlp ./x86_64/python-libguestfs-1.25.32-2.fc21.x86_64.rpm 
/usr/lib64/python2.7/site-packages/guestfs.py
/usr/lib64/python2.7/site-packages/guestfs.pyc
/usr/lib64/python2.7/site-packages/guestfs.pyo
/usr/lib64/python2.7/site-packages/libguestfsmod.so
/usr/share/doc/python-libguestfs
/usr/share/doc/python-libguestfs/create_disk.py
/usr/share/doc/python-libguestfs/inspect_vm.py
/usr/share/man/man3/guestfs-python.3.gz

Comment 2 bfan 2014-02-06 02:37:48 UTC
Can reproduce with libguestfs-1.22.6-18.el7.x86_64

*.py file is in /usr/lib/python2.7/site-packages but not in /usr/lib64 now

Comment 4 bfan 2014-02-10 08:07:10 UTC
Verified with libguestfs-1.22.6-19.el7.x86_64

# rpm -qlp python-libguestfs-1.22.6-19.el7.x86_64.rpm
/usr/lib64/python2.7/site-packages/guestfs.py
/usr/lib64/python2.7/site-packages/guestfs.pyc
/usr/lib64/python2.7/site-packages/guestfs.pyo
/usr/lib64/python2.7/site-packages/libguestfsmod.so
/usr/share/doc/python-libguestfs-1.22.6
/usr/share/doc/python-libguestfs-1.22.6/create_disk.py
/usr/share/doc/python-libguestfs-1.22.6/inspect_vm.py
/usr/share/man/man3/guestfs-python.3.gz

Comment 5 Ludek Smid 2014-06-13 13:19:18 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.