File gallery-dl.spec of Package gallery-dl

#
# spec file for package gallery-dl
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2022 hieru <genei.jin@hotmail.com>
#
# 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:           gallery-dl
Version:        1.27.5
Release:        0
Summary:        Command-line program to download image galleries and collections
License:        GPL-2.0-only
Group:          Productivity/Multimedia/Other
URL:            https://github.com/mikf/gallery-dl
Source:         https://github.com/mikf/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  fish
BuildRequires:  python3
BuildRequires:  python3-setuptools
BuildRequires:  python3-wheel
BuildRequires:  pkgconfig(sqlite3)
Requires:       python3
Requires:       python3-requests
Recommends:     ffmpeg
Recommends:     yt-dlp
BuildArch:      noarch

%description
%{name} is a command-line program to download image galleries and collections
from several image hosting sites.

%package        bash-completion
Summary:        Bash completion for %{name}
Group:          System/Shells
Requires:       bash-completion
Supplements:    (%{name} and bash)
BuildArch:      noarch

%description    bash-completion
Bash command line completion support for %{name}.

%package        fish-completion
Summary:        Fish completion for %{name}
Group:          System/Shells
Requires:       fish
Supplements:    (%{name} and fish)
BuildArch:      noarch

%description    fish-completion
Fish command line completion support for %{name}.

%package        zsh-completion
Summary:        Zsh Completion for %{name}
Group:          System/Shells
BuildRequires:  zsh
Requires:       zsh
Supplements:    (%{name} and zsh)
BuildArch:      noarch

%description zsh-completion
ZSH command line completion support for %{name}.

%prep
%autosetup
sed -i -e '/^#!/d' gallery_dl/__main__.py

%build
%make_build
%python3_build

%install
install -dm 755 %{buildroot}%{_sysconfdir}
%python3_install
install -m 644 docs/%{name}-example.conf %{buildroot}%{_sysconfdir}
install -m 644 docs/%{name}.conf %{buildroot}%{_sysconfdir}
%fdupes %{buildroot}%{python3_sitelib}

%check

%files
%doc README.rst CHANGELOG.md
%doc docs/configuration.rst docs/supportedsites.md docs/formatting.md
%license LICENSE
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_mandir}/man5/%{name}.conf.5%{?ext_man}
%config(noreplace) %{_sysconfdir}/%{name}.conf
%config %{_sysconfdir}/%{name}-example.conf
%{_bindir}/%{name}
%dir %{python3_sitelib}/gallery_dl
%{python3_sitelib}/gallery_dl/*
%{python3_sitelib}/gallery_dl-%{version}-py%{python3_version}.egg-info

%files bash-completion
%{_datadir}/bash-completion/completions/%{name}

%files fish-completion
%{_datadir}/fish/vendor_completions.d/%{name}.fish

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

%changelog
openSUSE Build Service is sponsored by