This commit is contained in:
parent
5086eae4dc
commit
e61d53f8eb
@ -24,7 +24,7 @@ License: GPL-3.0-or-later
|
|||||||
Group: System/Console
|
Group: System/Console
|
||||||
URL: https://github.com/wting/autojump
|
URL: https://github.com/wting/autojump
|
||||||
Source: https://github.com/wting/autojump/archive/release-v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source: https://github.com/wting/autojump/archive/release-v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3
|
||||||
BuildRequires: python3-mock
|
BuildRequires: python3-mock
|
||||||
BuildRequires: python3-pytest
|
BuildRequires: python3-pytest
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
@ -38,8 +38,10 @@ Directories must be visited first before they can be jumped to.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-release-v%{version}
|
%setup -q -n %{name}-release-v%{version}
|
||||||
|
|
||||||
|
# Fix shebangs.
|
||||||
sed -i 's/env python$/python3/' bin/%{name}
|
sed -i 's/env python$/python3/' bin/%{name}
|
||||||
sed -i '/env python$/s|^.*$|# -*- python -*-|' bin/%{name}_*.py
|
sed -i '/env python$/s/^.*$/# -*- python -*-/' bin/%{name}_*.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Nothing to build.
|
# Nothing to build.
|
||||||
@ -59,16 +61,16 @@ rm %{buildroot}%{_bindir}/%{name}_argparse.py
|
|||||||
sed -i 's/autojump_argparse/argparse/' %{buildroot}%{_bindir}/%{name}*
|
sed -i 's/autojump_argparse/argparse/' %{buildroot}%{_bindir}/%{name}*
|
||||||
|
|
||||||
# Make it a proper Python module instead of polluting bindir.
|
# Make it a proper Python module instead of polluting bindir.
|
||||||
|
sed -Ei "s/^(import|from) %{name}_(data|match|utils)/\1 %{name}.\2/" \
|
||||||
|
%{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}_*.py
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{python3_sitelib}/%{name}/
|
mkdir -p %{buildroot}%{python3_sitelib}/%{name}/
|
||||||
echo "# -*- python -*-" > %{buildroot}%{python3_sitelib}/%{name}/__init__.py
|
|
||||||
for m in data match utils; do
|
for m in data match utils; do
|
||||||
mv "%{buildroot}%{_bindir}/%{name}_$m.py" \
|
mv "%{buildroot}%{_bindir}/%{name}_$m.py" \
|
||||||
"%{buildroot}%{python3_sitelib}/%{name}/$m.py"
|
"%{buildroot}%{python3_sitelib}/%{name}/$m.py"
|
||||||
done
|
done
|
||||||
for m in data match utils; do
|
echo "# -*- python -*-" > %{buildroot}%{python3_sitelib}/%{name}/__init__.py
|
||||||
sed -i "s/^from %{name}_$m import/from %{name}.$m import/" \
|
|
||||||
%{buildroot}%{_bindir}/%{name} %{buildroot}%{python3_sitelib}/%{name}/*.py
|
|
||||||
done
|
|
||||||
%py3_compile %{buildroot}%{python3_sitelib}/%{name}/
|
%py3_compile %{buildroot}%{python3_sitelib}/%{name}/
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
Loading…
Reference in New Issue
Block a user