File password-store-age.spec of Package password-store-age

#
# spec file for package password-store-age
#
# Copyright (c) 2021 SUSE LLC
#
# 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:           password-store-age
Version:        1.7.4a2
Release:        0
Summary:        Utility to store, retrieve, generate and synchronize passwords
License:        GPL-2.0-or-later
URL:            https://github.com/FiloSottile/passage
Source:         %{name}-%{version}.tar.gz
BuildRequires:  bash-completion
BuildRequires:  git-core
BuildRequires:  age
BuildRequires:  qrencode
BuildRequires:  tree
BuildRequires:  xz
BuildRequires:  zsh
Recommends:     (xclip or wl-clipboard)
Requires:       age
Requires:       qrencode
Requires:       tree >= 1.7.0
Recommends:     pwgen
Suggests:       git-core
BuildArch:      noarch
%if 0%{?suse_version} > 1320
BuildRequires:  fish
%endif
Provides:       password-store = %{version}

%description
With password-store-age, each password lives inside of a age encrypted file whose
filename is the title of the website or resource that requires the password.
These encrypted files may be organized into meaningful folder hierarchies,
copied from computer to computer, and, in general, manipulated using standard
command line file management utilities.

%prep
%autosetup -n passage-%{version} -p1
for shell_script in src/password-store.sh; do
    sed -i "s|#\!%{_bindir}/env bash|#\!/bin/bash|" $shell_script
done

%build

%install
%make_install FISHCOMP_PATH=%{buildroot}%{_datadir}/fish/completions WITH_ALLCOMP="yes"
# own extensions directory for pass plugins
mkdir -p %{buildroot}%{_prefix}/lib/password-store/extensions
# own linked extensions directory for passage plugins
rm -fr %{buildroot}%{_prefix}/lib/passage/extensions
ln -s ../password-store/extensions %{buildroot}%{_prefix}/lib/passage

%files
%license COPYING
%doc README
%{_bindir}/passage
%if 0%{?suse_version} <= 1320
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%endif
%{_datadir}/bash-completion/completions/passage
%{_datadir}/fish/vendor_completions.d/passage.fish
%{_datadir}/zsh/site-functions/_passage
%dir %{_prefix}/lib/passage
%{_prefix}/lib/passage/extensions
%dir %{_prefix}/lib/password-store
%dir %{_prefix}/lib/password-store/extensions

%changelog
openSUSE Build Service is sponsored by