File media-subscriptions.spec of Package media-subscriptions

#
# spec file for package media-subscriptions
#
# Copyright (c) 2022 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:           media-subscriptions
Version:        0.0
Release:        0%{?dist}
Summary:        Download subscriptions from YouTube
License:        SUSE-Public-Domain
Group:          Productivity/Networking/Web/Utilities
URL:            https://github.com/jaimeMF/media-subscriptions
Source:         %{name}-%{version}.tar.xz
BuildArch:      noarch
BuildRequires:  python-rpm-macros
BuildRequires:  python3
BuildRequires:  python3-Pygments
BuildRequires:  python3-colorama
BuildRequires:  python3-docutils
BuildRequires:  python3-pyxdg
BuildRequires:  python3-setuptools
BuildRequires:  python3-youtube-dl
Requires:       python3-colorama
Requires:       python3-pyxdg
Requires:       python3-youtube-dl

%description
media-subscriptions is command line program for downloading the most recent videos from a YouTube user. You just add two lines to ~/.config/media-subscriptions/config:

    [youtube]
    url = https://www.youtube.com/user/youtube

and when you run media-subscriptions the new videos will be downloaded (with youtube-dl) to ~/Movies/subscriptions/youtube.

For more information read the manual.

%prep
%setup -q
# remove .py form rst tools
for tool in rst2man rst2html; do
    sed -i "s|${tool}.py|${tool}|" Makefile
done
sed -i 's|python dev|$(PYTHON) dev|' Makefile

%build
%python3_build
make %{?_smp_mflags} PYTHON=%__python3 %{name}.1

%install
%python3_install
make %{?_smp_mflags} VENV= VENV_ACTIVATE=true PYTHON=%__python3 PYTHONPATH=%{buildroot}/%{python3_sitelib} %{name}.fish
install -d %{buildroot}%{_datadir}/fish/completions
install -m 644 %{name}.fish %{buildroot}%{_datadir}/fish/completions/%{name}.fish

%files
%defattr(-,root,root)
%doc README.rst
%license LICENSE
%{_bindir}/%{name}
%{_mandir}/man1/*
%{python3_sitelib}
%dir %{_datadir}/fish
%{_datadir}/fish/completions/

%changelog
openSUSE Build Service is sponsored by