0

I have a problem with my Fedora 34. I was trying to recompile xfce 4.12 on Fedora 34 using rpmbuild —rebuild from version 22 to 34, I recompiled some packages but one gave me an error which I can't repair:

ERROR: ambiguous python shebang in /usr/lib64/xfce4/exo-1/exo-Composteli-mail-1: #!/usr/bin/python -tt. Change it to python3 (or python2) explicitly. mangling shebang in /usr/bin/exo-preffered-applications from /bin/sh to #!/usr/bin/sh

3
  • It looks as if the error message includes both the cause of the error and instructions about how to go for how to fix it. Commented Oct 2, 2021 at 13:39
  • Yeah, but it is an sourcerpm, all of source files are in this file, or in temp, the /usr/lib64/exo... doesn't exist, cause it is in the temp during the instalation process Commented Oct 2, 2021 at 13:42
  • This process is building an binary file, no install binary to the disk, you should understand i think Commented Oct 2, 2021 at 13:45

1 Answer 1

1

The error says what you need to do: change /usr/lib64/xfce4/exo-1/exo-compose-mail-1 (the check actually runs at the very end of the build so this is path where the RPM you are building will install the file with the wrong shebang) to use either #!/usr/bin/python3 or #!/usr/bin/python2 explicitly, since Fedora 30 rpmbuild checks files in the RPM and using #!/usr/bin/python shebang without version is considered error -- you are rebuilding SRPM from Fedora 22 where this wasn't enforced, so the build will fails because of this.

You can use the special pathfix.py script (from python3-devel) to fix the shebangs during the build (this will require changing the SPEC file in the dox SRPM), see the F30 change decription for more details, but in this case it would be way easier to simply change it manually because the offending file is one of the "extra" sources, the mailtoparse.py script, so you can simply change the first line to #!/usr/bin/python2 -tt to make it work.

If you want to use the script, just add

pathfix.py -pni "%{__python2} %{py2_shbang_opts}" %{buildroot}%{_libdir}/xfce4/exo-1/exo-compose-mail-1

to the %install section after the exo-compose-mail-1 file is installed.

4
  • Can you tell me how to use pathfix.py for my RPM? What command should I use? Commented Oct 2, 2021 at 18:05
  • And what should I add to spec file. Commented Oct 2, 2021 at 18:13
  • It's either using the pathfix.py script or changing the mailtoparse.py manually which I suggest, but if you really want to use the script, it's described in the F30 change I linked, just add pathfix.py -pni "%{__python2} %{py2_shbang_opts}" %{buildroot}%{_libdir}/xfce4/exo-1/exo-compose-mail-1 to the %install section after the exo-compose-mail-1 file is installed. Commented Oct 2, 2021 at 18:28
  • Thank you! It is working, thanks for help! Commented Oct 2, 2021 at 19:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.