File fenrir.spec of Package fenrir

#
# spec file for package fenrir
#
# Copyright (c) 2020 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 http://bugs.opensuse.org/
#


Name:           fenrir
Version:        1.9.7
Release:        0
Summary:        TTY screen reader for Linux
License:        LGPL-3
Group:          System/Daemons
URL:            https://github.com/chrys87/fenrir

Source0:        https://github.com/chrys87/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz

#BuildRequires:  fdupes
#BuildRequires:  gettext
#BuildRequires:  pkg-config
BuildRequires:  python3
BuildRequires:  python3-setuptools
#BuildRequires:  python3-devel
#BuildRequires:  systemd-devel
#BuildRequires:  systemd-rpm-macros
#BuildRequires:  pkgconfig(speech-dispatcher)
#%{?systemd_requires}
Requires:       python3-daemonize

%description
A modern, modular, flexible and fast console screenreader.

%prep
%autosetup -p1
find . -iname \*.py -exec sed -i -e '1 s@/usr/bin/python$@%{_bindir}/python3@' '{}' \;
find . -iname \*.py -exec sed -i -e '1 s@/bin/python$@%{_bindir}/python3@' '{}' \;

%build
python3 setup.py build

%install
python3 setup.py install -O1 --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{_unitdir}
install -D autostart/systemd/Arch/%{name}.service %{buildroot}%{_unitdir}

#%fdupes -s %{buildroot}%{_mandir}
#%fdupes -s %{buildroot} 

%pre
%service_add_pre %{name}.service

%post 
%service_add_post %{name}.service

%preun 
%service_del_preun %{name}.service

%postun
%service_del_postun %{name}.service

%files
%defattr(-, root, root)
#%doc LICENSE-GPL LICENSE-LGPL README README.SUSE Documents/ChangeLog Documents/CONTRIBUTORS Documents/HISTORY Documents/README.Bluetooth Documents/TODO
#%config(noreplace) %{_sysconfdir}/brltty.conf
%{_bindir}/fenrir
%{_bindir}/fenrir-daemon
%{_datadir}/fenrirscreenreader/
%{_datadir}/sounds/fenrirscreenreader/
%{_mandir}/man1/%{name}.1*
%{_sysconfdir}/fenrirscreenreader/
%{_unitdir}/%{name}.service
%{python3_sitelib}/fenrirscreenreader*/
%{python3_sitelib}/fenrir_screenreader*.egg-info/

%changelog
openSUSE Build Service is sponsored by