Fix shebangs

This commit is contained in:
leigh123linux 2018-02-01 14:32:44 +00:00
parent 4dbeb9ec7a
commit d83add7fb5

View File

@ -13,7 +13,7 @@
Name: pygtk2
Version: 2.24.0
Release: 18%{?dist}
Release: 19%{?dist}
License: LGPLv2+
Group: Development/Languages
Summary: Python bindings for GTK+
@ -100,6 +100,7 @@ This package contains documentation files for %{name}.
%setup -q -n pygtk-%{version}
%patch0 -p1 -b .Fix-leaks-of-Pango-objects
%build
%configure --enable-thread --enable-numpy
%{make_build}
@ -108,6 +109,17 @@ This package contains documentation files for %{name}.
%{make_install}
find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f
# Fix shebangs to system Python2.x
for file in $(%{_bindir}/find %{buildroot} -name '*.py' -type f)
do
%{__sed} -i.orig \
-e 's~#![ \t]*%{_bindir}/python$~#!%{__python2}~'\
-e 's~#![ \t]*%{_bindir}/env[ \t]*python[2]*$~#!%{__python2}~' \
${file}
/bin/touch -r ${file}.orig ${file}
%{__rm} -f ${file}.orig
done
%files
%doc AUTHORS NEWS README MAPPING
%license COPYING
@ -137,6 +149,9 @@ find %{buildroot} -name '*.la' -or -name '*.a' | xargs rm -f
%{_datadir}/gtk-doc/html/pygtk/
%changelog
* Thu Feb 01 2018 Leigh Scott <leigh123linux@googlemail.com> - 2.24.0-19
- Fix shebangs
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.24.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild