#755 "Turn off the brp-python-bytecompile script" simplification
Closed: fixed 6 years ago Opened 6 years ago by churchyard.

In https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation

In the example, please replace

# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

With

# Turn off automatic python bytecompilation
# Will bytecompile manually with Python 2 and 3 separately
%undefine __brp_python_bytecompile

Explanation

See https://pagure.io/packaging-committee/issue/749. This way:

  • is simpler
  • adds proper explanation about why is the BRP script disabled as is now required

With this change, existence of brp-python-bytecompile script becomes
an implementation detail, IMHO, hence should not be pointed out in
the comment like that.

Changed to " Turn off automatic python bytecompilation"

I agree, but note that this doesn't work on F26. Needless to day, it doesn't work in any EPEL release, either.

Using %undefine py_auto_byte_compile works across all Fedora releases, but still doesn't help with EPEL. I think the method currently shown (or something like it is the only thing that will work on EPEL.

My suggestion is to wait until we get closer to F26 EOL date, then adopt the %undefine method. I can then move the old method off to an EPEL page (which should probably be made generic).

It would technically be possible to whip up a macro called %disable_brp or something that will do the right things across releases, but this should be done so rarely that I don't think it's worth the effort.

Metadata Update from @tibbs:
- Issue assigned to tibbs

6 years ago

Also note that we have https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation and we will have to split this part of the guidelines into old vs. new, so we can do it together with that.

I just went ahead and implemented this, and made a note that the old method would need to be used for F27 and earlier. But to be honest, I have to wonder what the point really is; there are no specs in Fedora which do anything with brp_python_bytecompile (though I think python-requests did at one point).

Metadata Update from @tibbs:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

I've seen plenty.

pypy, pypy3, all pythons, bu also "ordinary packages":

https://src.fedoraproject.org/rpms/clufter/c/b377517e305f7625a00761e54578b6f61245ad9b?branch=master

https://src.fedoraproject.org/rpms/recoll/c/6cecdf959b37ce79162f44e828233030b5081c77

And those are only the ones I remember, i.e. I didn't try to query it trough the specs

python*.spec have this crazy code that needs to be fixed i guess:
%global __os_install_post /usr/lib/rpm/brp-compress \
  %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
  /usr/lib/rpm/brp-strip-static-archive %{__strip} \
  /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
  /usr/lib/rpm/brp-python-hardlink

waf.spec
7:# Turn off the brp-python-bytecompile script
8:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

blender.spec
3:# Turn off the brp-python-bytecompile script
4:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

liblouis.spec
2:# Turn off the brp-python-bytecompile script
3:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
224:- Rebuild for brp-python-bytecompile

wesnoth.spec
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

lnst.spec
8:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

pymol.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

skeinforge.spec
46:# Turn off the brp-python-bytecompile postprocessing script
49:  %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

dreampie.spec
3:# Turn off the brp-python-bytecompile script
4:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

lcgdm.spec
9:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

recoll.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

sfact.spec
52:# Turn off the brp-python-bytecompile postprocessing script
55:  %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

pyjamas.spec
6:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
112:( RPM_BUILD_ROOT=$RPM_BUILD_ROOT/%{python_sitelib}/; export RPM_BUILD_ROOT; /usr/lib/rpm/brp-python-bytecompile %{__python} )

python-django.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

python-pmw.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

jython.spec
3:# Turn off the brp-python-bytecompile script
5:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
341:- Disable _python_bytecompile_errors_terminate_build.

system-config-printer.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

clufter.spec
10:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

python-dirq.spec
10:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') 

eclipse-pydev.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

insight.spec
7:# Turn off the brp-python-bytecompile script
8:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

emacs.spec
89:# Turn off the brp-python-bytecompile script since this script doesn't
92:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
1034:  python binaries - requires turning off brp-python-bytecompile script

LuxRender.spec
1:# [Fedora] Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

pypy3.spec
130:# Turn off the brp-python-bytecompile postprocessing script
133:  %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
562:/usr/lib/rpm/brp-python-bytecompile \

pypy.spec
135:# Turn off the brp-python-bytecompile postprocessing script
138:  %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
505:/usr/lib/rpm/brp-python-bytecompile \

YafaRay.spec
10:# [Fedora] Turn off the brp-python-bytecompile script 
11:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

monkeystudio.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

mailman.spec
1:# Turn off the brp-python-bytecompile script
2:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

cherrytree.spec
3:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

uwsgi.spec
115:%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')

Indeed, I didn't grep for the right thing. (looked for brp_python_bytecompile instead of brp-python-bytecompile.

Login to comment on this ticket.

Metadata