packaging: fix Fedora RPM dependency
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Wed, 5 Mar 2014 13:18:50 +0000 (15:18 +0200)
committerLi Jinjing <jinjingx.li@intel.com>
Wed, 14 Jan 2015 11:35:11 +0000 (19:35 +0800)
commitbafe9e81a7aac529598118e928ec5e4f65f64441
tree39628a8e719d7afe6d79c731bac43f391199ddab
parentc73ff01d849a435e95ea685e5b40582669f5793d
packaging: fix Fedora RPM dependency

This patch fixes a problem with the following symptom:

$ sudo yum update python
Loaded plugins: langpacks, refresh-packagekit
Resolving Dependencies
--> Running transaction check
---> Package python.x86_64 0:2.7.5-9.fc20 will be updated
---> Package python.x86_64 0:2.7.5-11.fc20 will be an update
--> Processing Dependency: python-libs(x86-64) = 2.7.5-11.fc20 for package: python-2.7.5-11.fc20.x86_64
--> Running transaction check
---> Package python-libs.x86_64 0:2.7.5-9.fc20 will be updated
---> Package python-libs.x86_64 0:2.7.5-11.fc20 will be an update
--> Processing Dependency: /bin/python for package: bmap-tools-3.2-1.15.1.noarch
--> Finished Dependency Resolution
Error: Package: bmap-tools-3.2-1.15.1.noarch (@tools)
           Requires: /bin/python
           Removing: python-2.7.5-9.fc20.x86_64 (@fedora)
               Not found
           Updated By: python-2.7.5-11.fc20.x86_64 (updates)
               Not found
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

This happened on a Fedora system, which had the bmap-tools package installed,
and where I tried to update the python package.

The RPM build logs had this:
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/python python(abi) = 2.7

So there was a "/bin/python" requirement.

The theory is that "python.x86_64 0:2.7.5-9.fc20" had "Provides: /bin/python",
but this line was removed in "python.x86_64 0:2.7.5-11.fc20". But I did not
check this theory.

And the other theory is that rpm build picks "/bin/python" instead of
"/usr/bin/python" simply because "/bin" goes first in the PATH environment
variable in the build root environment.

Fedora says that the right way to call 'setpu.py' is

%{__python} setup.py

see https://fedoraproject.org/wiki/Packaging:Python,
and this is what this patch does.

Change-Id: I58460f724c16ea99bad70f572698a540fc400942
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
packaging/bmap-tools.spec