From 5086eae4dc6b761fb1771d1e5c8700d266e34c43b01b252bae65d9bdf63445d6 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Mon, 19 Nov 2018 14:05:23 +0000 Subject: [PATCH] Accepting request 650202 from home:XRevan86 An autojump package. OBS-URL: https://build.opensuse.org/request/show/650202 OBS-URL: https://build.opensuse.org/package/show/utilities/autojump?expand=0&rev=1 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + autojump-22.5.1.tar.gz | 3 ++ autojump.changes | 4 ++ autojump.spec | 89 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 autojump-22.5.1.tar.gz create mode 100644 autojump.changes create mode 100644 autojump.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/autojump-22.5.1.tar.gz b/autojump-22.5.1.tar.gz new file mode 100644 index 0000000..f7b40f4 --- /dev/null +++ b/autojump-22.5.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:765fabda130eb4df70d1c1e5bc172e1d18f8ec22c6b89ff98f1674335292e99f +size 54721 diff --git a/autojump.changes b/autojump.changes new file mode 100644 index 0000000..a35a0bc --- /dev/null +++ b/autojump.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Wed Nov 14 19:01:41 UTC 2018 - sor.alexei@meowr.ru + +- Initial package. diff --git a/autojump.spec b/autojump.spec new file mode 100644 index 0000000..6b526f2 --- /dev/null +++ b/autojump.spec @@ -0,0 +1,89 @@ +# +# spec file for package autojump +# +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: autojump +Version: 22.5.1 +Release: 0 +Summary: A faster way to navigate the filesystem from a shell +License: GPL-3.0-or-later +Group: System/Console +URL: https://github.com/wting/autojump +Source: https://github.com/wting/autojump/archive/release-v%{version}.tar.gz#/%{name}-%{version}.tar.gz +BuildRequires: python3-devel +BuildRequires: python3-mock +BuildRequires: python3-pytest +BuildArch: noarch + +%description +autojump is a faster way to navigate one's filesystem. It works by +maintaining a database of the directories one uses the most from +the command line. + +Directories must be visited first before they can be jumped to. + +%prep +%setup -q -n %{name}-release-v%{version} +sed -i 's/env python$/python3/' bin/%{name} +sed -i '/env python$/s|^.*$|# -*- python -*-|' bin/%{name}_*.py + +%build +# Nothing to build. + +%install +python3 install.py \ + --destdir=%{buildroot} \ + --prefix=.%{_prefix} \ + --zshshare=.%{_datadir}/zsh/site-functions + +# Fix the path. +sed -i 's|%{buildroot}/.%{_prefix}|%{_prefix}|' \ + %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh + +# Redundant on Python 3. +rm %{buildroot}%{_bindir}/%{name}_argparse.py +sed -i 's/autojump_argparse/argparse/' %{buildroot}%{_bindir}/%{name}* + +# Make it a proper Python module instead of polluting bindir. +mkdir -p %{buildroot}%{python3_sitelib}/%{name}/ +echo "# -*- python -*-" > %{buildroot}%{python3_sitelib}/%{name}/__init__.py +for m in data match utils; do + mv "%{buildroot}%{_bindir}/%{name}_$m.py" \ + "%{buildroot}%{python3_sitelib}/%{name}/$m.py" +done +for m in data match utils; do + 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}/ + +%check +python3 -m pytest tests + +%files +%license LICENSE +%doc AUTHORS README.md +%config %{_sysconfdir}/profile.d/%{name}.sh +%{_bindir}/%{name} +%{_datadir}/%{name}/ +%{python3_sitelib}/%{name}/ +%dir %{_datadir}/zsh/ +%dir %{_datadir}/zsh/site-functions/ +%{_datadir}/zsh/site-functions/_j +%{_mandir}/man1/%{name}.1%{?ext_man} + +%changelog