Use correct shebang substitution for python scripts

This is a follow up for rhbz#1538238
This commit is contained in:
Tom Stellard 2018-10-02 00:23:05 +00:00
parent 468c6f2a1a
commit 15d2b4b54e

View File

@ -58,7 +58,7 @@
Name: %pkg_name Name: %pkg_name
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 1%{?dist} Release: 2%{?dist}
Summary: A C language family front-end for LLVM Summary: A C language family front-end for LLVM
License: NCSA License: NCSA
@ -227,6 +227,12 @@ suite can be run with any compiler, not just clang.
%else %else
%setup -T -q -b 1 -n %{clang_tools_srcdir} %setup -T -q -b 1 -n %{clang_tools_srcdir}
pathfix.py -i %{__python3} -pn \
clang-tidy/tool/*.py
pathfix.py -i %{__python2} -pn \
include-fixer/find-all-symbols/tool/run-find-all-symbols.py
%setup -T -q -b 2 -n %{test_suite_srcdir} %setup -T -q -b 2 -n %{test_suite_srcdir}
pathfix.py -i %{__python2} -pn \ pathfix.py -i %{__python2} -pn \
@ -239,6 +245,7 @@ pathfix.py -i %{__python2} -pn \
MicroBenchmarks/libs/benchmark-1.3.0/tools/compare_bench.py MicroBenchmarks/libs/benchmark-1.3.0/tools/compare_bench.py
%setup -q -n %{clang_srcdir} %setup -q -n %{clang_srcdir}
%patch0 -p1 -b .lit-search-path %patch0 -p1 -b .lit-search-path
%patch1 -p1 -b .fstack-clash-protection %patch1 -p1 -b .fstack-clash-protection
%patch2 -p1 -b .vendor-gcc %patch2 -p1 -b .vendor-gcc
@ -251,6 +258,7 @@ mv ../%{clang_tools_srcdir} tools/extra
pathfix.py -i %{__python3} -pn \ pathfix.py -i %{__python3} -pn \
tools/clang-format/*.py \ tools/clang-format/*.py \
tools/clang-format/git-clang-format \
utils/hmaptool/hmaptool \ utils/hmaptool/hmaptool \
tools/scan-view/bin/scan-view tools/scan-view/bin/scan-view
%endif %endif
@ -324,8 +332,6 @@ mv %{buildroot}/%{install_includedir}/clang-c %{buildroot}/%{pkg_includedir}/
%else %else
sed -i -e 's~#!/usr/bin/env python~#!%{_bindir}/python2~' %{buildroot}%{_bindir}/git-clang-format
# install clang python bindings # install clang python bindings
mkdir -p %{buildroot}%{python2_sitelib}/clang/ mkdir -p %{buildroot}%{python2_sitelib}/clang/
install -p -m644 bindings/python/clang/* %{buildroot}%{python2_sitelib}/clang/ install -p -m644 bindings/python/clang/* %{buildroot}%{python2_sitelib}/clang/
@ -340,11 +346,6 @@ for f in clang-format.el clang-rename.el clang-include-fixer.el; do
mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f
done done
#Fix python shebang
for f in clang-tidy-diff.py clang-format-diff.py run-clang-tidy.py run-find-all-symbols.py; do
sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{_datadir}/clang/$f
done
# remove editor integrations (bbedit, sublime, emacs, vim) # remove editor integrations (bbedit, sublime, emacs, vim)
rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py* rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
@ -447,6 +448,9 @@ false
%endif %endif
%changelog %changelog
* Tue Oct 02 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-2
- Use correct shebang substitution for python scripts
* Mon Sep 24 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1 * Mon Sep 24 2018 Tom Stellard <tstellar@redhat.com> - 7.0.0-1
- 7.0.0 Release - 7.0.0 Release