File tarsnap.spec of Package tarsnap

#
# spec file for package tarsnap
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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:           tarsnap
Version:        1.0.41
Release:        0
Summary:        Backup tool for tarsnap.com
License:        NonFree
URL:            https://tarsnap.com
Source0:        %{url}/download/%{name}-autoconf-%{version}.tgz
BuildRequires:  pkgconfig
BuildRequires:  zsh
BuildRequires:  (pkgconfig(libattr) or libattr-devel)
BuildRequires:  pkgconfig(bash-completion)
BuildRequires:  pkgconfig(bzip2)
BuildRequires:  pkgconfig(ext2fs)
BuildRequires:  pkgconfig(libacl)
BuildRequires:  pkgconfig(liblzma)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(zlib)
Recommends:     (%{name}-bash-completion if bash-completion)
Recommends:     (%{name}-zsh-completion if zsh)

%description
Command line tool for managing and uploading backups to the tarsnap.com backup service.

%package bash-completion
Summary:        Bash completions for %{name}
Requires:       %{name}
Supplements:    (%{name} and bash-completion)
BuildArch:      noarch

%description bash-completion
%{summary}.

%package zsh-completion
Summary:        Zsh completions for %{name}
Requires:       %{name}
Supplements:    (%{name} and zsh)
BuildArch:      noarch

%description zsh-completion
%{summary}.

%prep
%autosetup -n %{name}-autoconf-%{version}

%build
export CFLAGS="%{optflags} -DOPENSSL_LOAD_CONF"
%configure \
  --with-conf-no-sample \
  --with-bash-completion-dir \
  --with-zsh-completion-dir=%{_datadir}/zsh/site-functions
%make_build

%install
%make_install

%check
%make_build test

%files
%license COPYING
%doc NEWS.md README.md STYLE
%config(noreplace) %{_sysconfdir}/%{name}.conf
%{_bindir}/%{name}
%{_bindir}/%{name}-keygen
%{_bindir}/%{name}-keymgmt
%{_bindir}/%{name}-keyregen
%{_bindir}/%{name}-recrypt
%{_mandir}/man?/%{name}-keygen.?%{?ext_man}
%{_mandir}/man?/%{name}-keymgmt.?%{?ext_man}
%{_mandir}/man?/%{name}-keyregen.?%{?ext_man}
%{_mandir}/man?/%{name}-recrypt.?%{?ext_man}
%{_mandir}/man?/%{name}.?%{?ext_man}
%{_mandir}/man?/%{name}.conf.?%{?ext_man}

%files bash-completion
%{_datadir}/bash-completion/completions/%{name}
%{_datadir}/bash-completion/completions/%{name}-keygen
%{_datadir}/bash-completion/completions/%{name}-keymgmt
%{_datadir}/bash-completion/completions/%{name}-keyregen
%{_datadir}/bash-completion/completions/%{name}-recrypt

%files zsh-completion
%{_datadir}/zsh/site-functions/_%{name}

%changelog
openSUSE Build Service is sponsored by