Skip to content

Commit

Permalink
Use sed rather than perl for substitutions
Browse files Browse the repository at this point in the history
We are only doing simple substitutions, so
use sed instead of perl. This will speed up
the construction of the mock environment
because it is a much smaller package.
  • Loading branch information
benmwebb committed Aug 6, 2024
1 parent 9b093b6 commit 9a6318c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tools/rpm/IMP-copr.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ BuildRequires: python3-devel
BuildRequires: gcc-c++, hdf5-devel >= 1.8
BuildRequires: swig >= 3.0
BuildRequires: gsl-devel, fftw-devel
BuildRequires: zlib-devel, perl, eigen3-devel, cereal-devel
BuildRequires: zlib-devel, sed, eigen3-devel, cereal-devel
%if 0%{?fedora} || 0%{?rhel} <= 7
BuildRequires: ann-devel
%endif
Expand Down Expand Up @@ -277,8 +277,8 @@ rm -rf %{buildroot}%{_prefix}/bin/imp_example_app \

# Make sure all Python applications and build tools use the same Python
# we built with
perl -pi -e 's@^#!.*python.*$@#!/usr/bin/python3@' %{buildroot}%{_prefix}/bin/*
find %{buildroot}%{_prefix}/share/IMP/tools -name '*.py' -exec perl -pi -e 's#/usr/bin/env python\b#/usr/bin/env python3#' \{\} \;
sed -i -e 's@^#!.*python.*$@#!/usr/bin/python3@' %{buildroot}%{_prefix}/bin/*
find %{buildroot}%{_prefix}/share/IMP/tools -name '*.py' -exec sed -i -e 's#/usr/bin/env python\b#/usr/bin/env python3#' \{\} \;

%check
defver=`python3 -c "import sys; print('%d.%d' % sys.version_info[:2])"`
Expand Down
6 changes: 3 additions & 3 deletions tools/rpm/IMP.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BuildRequires: python3-devel
BuildRequires: gcc-c++, hdf5-devel >= 1.8
BuildRequires: swig >= 3.0
BuildRequires: gsl-devel, fftw-devel
BuildRequires: zlib-devel, perl, eigen3-devel, cereal-devel
BuildRequires: zlib-devel, sed, eigen3-devel, cereal-devel
%if 0%{?fedora} || 0%{?rhel} <= 7
BuildRequires: ann-devel
%endif
Expand Down Expand Up @@ -350,8 +350,8 @@ rm -rf ${RPM_BUILD_ROOT}%{_prefix}/bin/imp_example_app \

# Make sure all Python applications and build tools use the same Python
# we built with
perl -pi -e 's@^#!.*python.*$@#!/usr/bin/python3@' ${RPM_BUILD_ROOT}%{_prefix}/bin/*
find ${RPM_BUILD_ROOT}%{_prefix}/share/IMP/tools -name '*.py' -exec perl -pi -e 's#/usr/bin/env python\b#/usr/bin/env python3#' \{\} \;
sed -i -e 's@^#!.*python.*$@#!/usr/bin/python3@' ${RPM_BUILD_ROOT}%{_prefix}/bin/*
find ${RPM_BUILD_ROOT}%{_prefix}/share/IMP/tools -name '*.py' -exec sed -i -e 's#/usr/bin/env python\b#/usr/bin/env python3#' \{\} \;

%files
%defattr(-,root,root)
Expand Down

0 comments on commit 9a6318c

Please sign in to comment.