<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Looks like it finally works:<br>
      Here are the key lines from my spec file:<br>
      <br>
      <tt>%global pymajor %(python -c 'import sys; print "%s" %
        sys.version_info[0]')</tt><tt><br>
      </tt><tt>%global pyminor %(python -c 'import sys; print "%s" %
        sys.version_info[1]')</tt><tt><br>
      </tt><tt><br>
      </tt><tt>%global uses_systemd  %(test -f /usr/lib/systemd/systemd
        && echo 1 || echo 0)</tt><tt><br>
      </tt><tt>%global python27_native %(test %{pyminor} -ge 7
        && echo 1 || echo 0)</tt><tt><br>
      </tt><tt>%if %{python27_native}</tt><tt><br>
      </tt><tt>%else</tt><tt><br>
      </tt><tt>%global scl_python python27</tt><tt><br>
      </tt><tt>%global scl %{scl_python}</tt><tt><br>
      </tt><tt>%global _scl_root /opt/rh/%{scl_python}/root</tt><tt><br>
      </tt><tt>%global __python %{_scl_root}%{__python}</tt><tt><br>
      </tt><tt>%global scl_prefix %{scl_python}-</tt><tt><br>
      </tt><tt>%global __python_requires
        %{%{scl_python}_python_requires} </tt><tt><br>
      </tt><tt>%global __python_provides
        %{%{scl_python}_python_provides} </tt><tt><br>
      </tt><tt>%global __os_install_post %{python27_os_install_post}</tt><tt><br>
      </tt><tt>%global python_sitearch
        %{_scl_root}/%{_libdir}/python2.7/site-packages</tt><br>
      <tt>%endif</tt><br>
      <br>
      I've attached the whole thing for your reading pleasure.<br>
      <br>
      The only thing I defined that I didn't really need was the
      scl_python.  I could have used scl, but thought scl_python was
      clearer.  Note that you have to define more or less all the other
      things in the else condition of that if statement.<br>
      <br>
      On 07/18/2014 01:03 PM, Alan Robertson wrote:<br>
    </div>
    <blockquote cite="mid:53C96F7F.3000608@unix.sh" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Next error - not sure what to do
        about this one...<br>
        <br>
        <br>
        + scl enable python27
        '/usr/lib/rpm/redhat/brp-python-bytecompile-with-scl-python
        /usr/bin/python 1 %{_scl_root}'<br>
        Compiling
        /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/opt/rh/python27/root/usr/lib64/python2.7/site-packages/assimilation/assimcli.py

        ...<br>
        SyntaxError: ('invalid syntax',
        ('/opt/rh/python27/root/usr/lib64/python2.7/site-packages/assimilation/assimcli.py',

        157, 22, "options = {'language', 'format'}\n"))<br>
        <br>
        Compiling
        /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/opt/rh/python27/root/usr/lib64/python2.7/site-packages/assimilation/cmaconfig.py

        ...<br>
        SyntaxError: ('invalid syntax',
        ('/opt/rh/python27/root/usr/lib64/python2.7/site-packages/assimilation/cmaconfig.py',

        42, 53, "                                   
        {'linkdiscovery',       # listens for CMA/LLDP packets\n"))<br>
        <br>
                <b>[This syntax is >= 2.7 python only]</b><br>
        <br>
        error: Bad exit status from /var/tmp/rpm-tmp.FIkESm (%install)<br>
            Bad exit status from /var/tmp/rpm-tmp.FIkESm (%install)<br>
        <br>
        <blockquote type="cite">scl enable python27
          '/usr/lib/rpm/redhat/brp-python-bytecompile-with-scl-python
          /usr/bin/python 1 %{_scl_root</blockquote>
        <br>
        It is using /usr/bin/python to compile my python 2.7 programs. 
        What's up with that?<br>
        <br>
        <br>
        On 07/18/2014 11:15 AM, Alan Robertson wrote:<br>
      </div>
      <blockquote cite="mid:53C9564E.3080806@unix.sh" type="cite">Next
        error: <br>
        <br>
        extracting debug info from
/rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/usr/sbin/nanoprobe<br>
        1376 blocks <br>
        + /usr/lib/rpm/check-buildroot <br>
        + /usr/lib/rpm/brp-scl-compress '%{_scl_root}' <br>
        + /usr/lib/rpm/redhat/brp-strip /usr/bin/strip <br>
        + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip
        /usr/bin/objdump <br>
        + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip <br>
        + scl enable %scl
        '/usr/lib/rpm/redhat/brp-python-bytecompile-with-scl-python
        /usr/bin/python 1 %{_scl_root}' <br>
        Unable to open /etc/scl/prefixes/%scl! <br>
        error: Bad exit status from /var/tmp/rpm-tmp.eqUbD6 (%install) <br>
            Bad exit status from /var/tmp/rpm-tmp.eqUbD6 (%install) <br>
        <br>
        I'm guessing need to define %scl. <br>
        <br>
        It looks to me like these macros expect that you're *defining* a
        package, not using one.  Good thing I don't need more than one,
        or I'd be in a world of hurt (which is how it feels now anyway).
        <br>
        <br>
        <br>
        On 07/18/2014 11:10 AM, Alan Robertson wrote: <br>
        <blockquote type="cite">On 07/16/2014 02:30 AM, Bohuslav Kabrda
          wrote: <br>
          <blockquote type="cite">That's correct. The problem here is, I
            think, that the package places it's files into sitearch of
            the SCL, but it's not actually an SCL package. One of the
            results of having it as non-SCL package means, that
            %scl_package_override() function, present in the
            python27-build subpackage doesn't get invoked. This function
            looks like this (you need to 's/@scl@/python27/'): <br>
            <br>
            # override __os_install_post for this collection <br>
            # the python27_os_install_post macro is defined in
            macros.python2.python27 in python27-python-devel <br>
            # the name is intentionally hardcoded to always provide the
            same name <br>
            %scl_package_override()
            %{expand:%{?@scl@_os_install_post:%global __os_install_post
            %@scl@_os_install_post} <br>
            %global __python_requires %@scl@_python_requires <br>
            %global __python_provides %@scl@_python_provides <br>
          </blockquote>
          This looks like it has a typo in it. <br>
          <br>
          If @scl@ is python27, then <br>
          <br>
              %global __python_requires %@scl@_python_requires <br>
          becomes <br>
              %global __python_requires python27_python_requires <br>
          and <br>
              %global __python_provides %@scl@_python_provides <br>
          becomes <br>
              %global __python_provides python27_python_provides <br>
          <br>
          Why is the original spelled with two underscores
          ("__python_requires") but the replacement name
          ("python27_python_requires") only has one underscore? <br>
          <br>
          This seems a bit inconsistent...  It looks correct, but
          inconsistent... <br>
          <br>
          <br>
          I see that the python27_python_requires macro is defined in
          /etc/rpm/macros.python2.python27.  I see that
          __python_requires is defined in the file /usr/lib/rpm/macros.
          <br>
          The definition of python27_python_requires is: <br>
          %python27_python_provides /usr/lib/rpm/pythondeps-scl.sh
          --provides %{?scl_prefix} <br>
          %python27_python_requires /usr/lib/rpm/pythondeps-scl.sh
          --requires %{?scl_prefix} <br>
          <br>
          So, it expects you to set scl_prefix.  I set it to "python27-"
          From what I can see in the macro definitions, that's what I
          expect it would want. <br>
          <br>
          Well, at least now I get different problems! <br>
          <br>
          + install -p -D -m0755
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/init.d/cma
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/rc.d/init.d/assimilation-cma

          <br>
          + install -p -D -m0755
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/init.d/nanoprobe

          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/rc.d/init.d/assimilation-nanoprobe

          <br>
          + rm -f
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/init.d/cma
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/etc/init.d/nanoprobe

          <br>
          + mkdir -p
/rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/var/run/assimilation<br>
          + mkdir -p
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/var/run/nanoprobe
          <br>
          + mkdir -p
          /rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/usr/lib64
          <br>
          + mkdir -p
/rpmbuild/BUILDROOT/assimilation-cma-0.1.4-0.30.x86_64/opt/rh/python27/root//usr/lib64/python2.7/site-packages/assimilation/testcode<br>
          + /usr/lib/rpm/brp-scl-compress '%{_scl_root}' <br>
          /var/tmp/rpm-tmp.uQBlOW: line 59:
          /usr/lib/rpm/brp-scl-compress: No such file or directory <br>
          error: Bad exit status from /var/tmp/rpm-tmp.uQBlOW (%install)
          <br>
              Bad exit status from /var/tmp/rpm-tmp.uQBlOW (%install) <br>
          <br>
          Looks like that should come from scl-utils-build... <br>
          <br>
        </blockquote>
        <br>
        <br>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
    Alan Robertson <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:alanr@unix.sh"><alanr@unix.sh></a> - @OSSAlanR

"Openness is the foundation and preservative of friendship...  Let me claim from you at all times your undisguised opinions." - William Wilberforce
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SCLorg mailing list
<a class="moz-txt-link-abbreviated" href="mailto:SCLorg@redhat.com">SCLorg@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/sclorg">https://www.redhat.com/mailman/listinfo/sclorg</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
    Alan Robertson <a class="moz-txt-link-rfc2396E" href="mailto:alanr@unix.sh"><alanr@unix.sh></a> - @OSSAlanR

"Openness is the foundation and preservative of friendship...  Let me claim from you at all times your undisguised opinions." - William Wilberforce
</pre>
  </body>
</html>