[Risolto] python-setuptools richiesto solo in EPEL

Sono il maintainer del pacchetto https://admin.fedoraproject.org/pkgdb/package/rpms/python-libcnml/. Ieri mi sono messo all’opera per capire come mai non compilasse su F22 ed EPEL7. Ora lasciamo da parte F22 e dedichiamoci ad EPEL7. Praticamente quando facevo partire la build

http://koji.fedoraproject.org/koji/taskinfo?taskID=13228259

ottenevo un risultato del tipo

[code]Mock Version: 1.2.15
Mock Version: 1.2.15
ENTER do(‘bash’, ‘–login’, ‘-c’, ‘/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec’], chrootPath=’/var/lib/mock/epel7-build-5137737-586864/root’gid=425user='mockbuild’uid=1000shell=Falsetimeout=172800env={‘SHELL’: ‘/bin/bash’, ‘TERM’: ‘vt100’, ‘HOME’: ‘/builddir’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘printf “\x1b]0;\x07”’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’, ‘LANG’: ‘en_US.UTF-8’}logger=<mockbuild.trace_decorator.getLog object at 0x7f2835488dd8>printOutput=False)
Executing command: ‘bash’, ‘–login’, ‘-c’, ‘/usr/bin/rpmbuild -bs --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec’] with env {‘SHELL’: ‘/bin/bash’, ‘TERM’: ‘vt100’, ‘HOME’: ‘/builddir’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘printf “\x1b]0;\x07”’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’, ‘LANG’: ‘en_US.UTF-8’} and shell False
sh: /usr/bin/python2: No such file or directory
warning: Could not canonicalize hostname: buildvm-25.phx2.fedoraproject.org
Building target platforms: noarch
Building for target noarch
Wrote: /builddir/build/SRPMS/python-libcnml-0.9.4-1.el7.src.rpm
Child return code was: 0
LEAVE do -->

ENTER do(‘bash’, ‘–login’, ‘-c’, '/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec ‘], private_network=TruechrootPath=’/var/lib/mock/epel7-build-5137737-586864/root’gid=425user='mockbuild’uid=1000shell=Falsetimeout=172800env={‘SHELL’: ‘/bin/bash’, ‘TERM’: ‘vt100’, ‘HOME’: ‘/builddir’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘printf “\x1b]0;\x07”’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’, ‘LANG’: ‘en_US.UTF-8’}logger=<mockbuild.trace_decorator.getLog object at 0x7f2835488dd8>printOutput=False)
Executing command: ‘bash’, ‘–login’, ‘-c’, '/usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec '] with env {‘SHELL’: ‘/bin/bash’, ‘TERM’: ‘vt100’, ‘HOME’: ‘/builddir’, ‘HOSTNAME’: ‘mock’, ‘PROMPT_COMMAND’: ‘printf “\x1b]0;\x07”’, ‘PATH’: ‘/usr/bin:/bin:/usr/sbin:/sbin’, ‘LANG’: ‘en_US.UTF-8’} and shell False
Building target platforms: noarch
Building for target noarch
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.IXGP8d

  • umask 022
  • cd /builddir/build/BUILD
  • cd /builddir/build/BUILD
  • rm -rf libcnml-0.9.4
  • /usr/bin/gzip -dc /builddir/build/SOURCES/libcnml-0.9.4.tar.gz
  • /usr/bin/tar -xf -
  • STATUS=0
  • ‘’ 0 -ne 0 ‘]’
  • cd libcnml-0.9.4
  • /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
  • rm -rf libcnml.egg-info
  • exit 0
    Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.vDDy4v
  • umask 022
  • cd /builddir/build/BUILD
  • cd libcnml-0.9.4
  • CFLAGS=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic’
  • /usr/bin/python2 setup.py build ‘–executable=/usr/bin/python2 -s’
    Traceback (most recent call last):
    File “setup.py”, line 4, in
    from setuptools import setup
    ImportError: No module named setuptools
    error: Bad exit status from /var/tmp/rpm-tmp.vDDy4v (%build)
    Bad exit status from /var/tmp/rpm-tmp.vDDy4v (%build)
    RPM build errors:
    Child return code was: 1
    EXCEPTION: Command failed. See logs for output.

bash --login -c /usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec

Traceback (most recent call last):
File “/usr/lib/python3.4/site-packages/mockbuild/trace_decorator.py”, line 88, in trace
result = func(*args, **kw)
File “/usr/lib/python3.4/site-packages/mockbuild/util.py”, line 547, in do
raise exception.Error(“Command failed. See logs for output.\n # %s” % (command,), child.returncode)
mockbuild.exception.Error: Command failed. See logs for output.

bash --login -c /usr/bin/rpmbuild -bb --target noarch --nodeps /builddir/build/SPECS/python-libcnml.spec

LEAVE do --> EXCEPTION RAISED

[/code]

Errore che ho potuto risolvere inserendo nel file spec

BuildRequires: python-setuptools

Ora non capisco come mai solo su EPEL7 è richiesto tale pacchetto, quando su F{22,23,24,25} compila anche senza…

Forse perché python-setuptools è già richiesto da python?

Esatto:
http://pkgs.fedoraproject.org/cgit/rpms/python.git/tree/python.spec#n173

Allora vorrei utilizzare una macro affinché io possa utilizzare un unico file spec per tutte le branch. Pensate che per EPEL7 una cosa del genere possa andar bene come dichiarazione in cima al file spec?

%if 0%{?rhel} = 7 %global needs_python_setuptools 1 %endif

Risolto con http://pkgs.fedoraproject.org/cgit/rpms/python-libcnml.git/tree/python-libcnml.spec#n15