Blame python-ouimeaux.spec

213e69d
%global srcname ouimeaux
213e69d
213e69d
# This is the correct folder for firewalld service files, even on x86_64
213e69d
# It is not used for shared objects
213e69d
%global fw_services %{_prefix}/lib/firewalld/services
213e69d
213e69d
Name: python-%{srcname}
213e69d
Version: 0.8.2
f8b57f6
Release: 16%{?dist}
213e69d
Summary: Open source control for Belkin WeMo devices
213e69d
d18ca0c
License: BSD and ASL 2.0 and MIT
213e69d
Url: https://github.com/iancmcc/ouimeaux
213e69d
Source0: https://github.com/iancmcc/%{srcname}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
213e69d
Source1: README.firewall
213e69d
Source2: ouimeaux.xml
213e69d
213e69d
# https://patch-diff.githubusercontent.com/raw/iancmcc/ouimeaux/pull/204.patch
213e69d
Patch0:  python-ouimeaux-cElementTree.patch
213e69d
# https://github.com/knight-of-ni/ouimeaux/commit/2cea05f127499f42179b3699866b8e1444761b9f.patch
213e69d
Patch1:  python-ouimeaux-unbundle-pysignals.patch
213e69d
213e69d
# https://github.com/iancmcc/ouimeaux/commit/607bfb3627c32937ca7e542e462053bbb124ee06.patch
213e69d
Patch2:  python-ouimeaux-move-statechange.patch
213e69d
4d30877
# https://github.com/iancmcc/ouimeaux/commit/531c9d2c12d11ddaa6a5eaf2f87d5afc386f1d9a.patch
4d30877
Patch3: python-ouimeaux-jquery.patch
4d30877
b7c7025
# https://github.com/iancmcc/ouimeaux/commit/40cdcf352cc883bfc815c1a7a15aeb5520a63aaa.patch
b7c7025
Patch4: python-ouimeaux-getchildren.patch
b7c7025
213e69d
BuildArch: noarch
213e69d
BuildRequires: python3-devel
5386b3c
BuildRequires: %{py3_dist setuptools}
213e69d
BuildRequires: findutils
213e69d
BuildRequires: sed
213e69d
BuildRequires: coreutils
213e69d
BuildRequires: firewalld-filesystem
213e69d
213e69d
# Required for check
213e69d
BuildRequires: %{py3_dist gevent} >= 1.3
213e69d
BuildRequires: %{py3_dist requests} >= 2.3.0
213e69d
BuildRequires: %{py3_dist pyyaml}
213e69d
BuildRequires: %{py3_dist six}
213e69d
BuildRequires: %{py3_dist future}
213e69d
BuildRequires: %{py3_dist pysignals}
213e69d
213e69d
%global _description %{expand:
213e69d
Open source control for Belkin WeMo devices
213e69d
213e69d
- Supports WeMo Switch, Light Switch, Insight Switch and Motion
213e69d
- Command-line tool to discover and control devices in your environment
213e69d
- REST API to obtain information and perform actions on devices
213e69d
- Simple responsive Web app provides device control on mobile
213e69d
- Python API to interact with device at a low level
213e69d
}
213e69d
213e69d
%description %_description
213e69d
213e69d
%package -n python3-%{srcname}
213e69d
Requires: firewalld-filesystem
f10ac77
Requires: glyphicons-halflings-fonts
213e69d
Requires: %{py3_dist pysignals}
213e69d
Requires(post): firewalld-filesystem
213e69d
213e69d
Summary:        %{summary}
213e69d
%{?python_provide:%python_provide python3-%{srcname}}
213e69d
213e69d
%description -n python3-%{srcname} %_description
213e69d
213e69d
%prep
213e69d
%autosetup -p 1 -n %{srcname}-%{version}
213e69d
213e69d
install -pm 0644 %{SOURCE1} .
213e69d
213e69d
# Dont build examples, add to docs instead
213e69d
mv ouimeaux/examples examples
213e69d
rm examples/__init__.py
213e69d
213e69d
# Remove python shebang from __init__.py
213e69d
sed -i -e '/^#!\//, 1d' ouimeaux/__init__.py
213e69d
213e69d
# fix python shebang and non-executable-script errors
213e69d
find \( -name device.py -or -name service.py -or -name watch.py \) -type f -exec chmod +x {} \; -exec sed -i 's\^#!/usr/bin/env python$\#!%{python3}\' {} \;
213e69d
213e69d
%build
213e69d
%py3_build
213e69d
213e69d
%install
213e69d
%py3_install
213e69d
f10ac77
# remove non-ttf fonts and link the ttf font to the packaged file with the same name
f10ac77
rm -f %{buildroot}%{python3_sitelib}/%{srcname}/server/static/fonts/glyphicons-halflings-regular.*
f10ac77
ln -sf /usr/share/fonts/glyphicons-halflings/glyphicons-halflings-regular.ttf %{buildroot}%{python3_sitelib}/%{srcname}/server/static/fonts/glyphicons-halflings-regular.ttf
213e69d
213e69d
# Install firewalld config
213e69d
mkdir -p %{buildroot}%{fw_services}
213e69d
install -pm 0644 %{SOURCE2} %{buildroot}%{fw_services}/
213e69d
213e69d
%post
213e69d
%{?firewalld_reload}
213e69d
213e69d
%check
213e69d
%{python3} setup.py test
213e69d
213e69d
%files -n python3-%{srcname}
213e69d
%license LICENSE
213e69d
%doc README.md HISTORY.rst AUTHORS.rst CONTRIBUTING.rst README.firewall examples/
213e69d
%{python3_sitelib}/%{srcname}-*.egg-info/
213e69d
%{python3_sitelib}/%{srcname}/
213e69d
%{_bindir}/wemo
213e69d
%{fw_services}/%{srcname}.xml
213e69d
213e69d
%changelog
f8b57f6
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-16
f8b57f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
f8b57f6
39bda1c
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-15
39bda1c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
39bda1c
f6d27e1
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.8.2-14
f6d27e1
- Rebuilt for Python 3.10
f6d27e1
f10ac77
* Wed Feb 10 2021 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-13
f10ac77
- replace webfts runtime requirement with glyphicons-halflings-fonts
f10ac77
- remove all non-ttf glyphicons fonts from package
f10ac77
eede4dd
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-12
eede4dd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
eede4dd
d35b740
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.2-11
d35b740
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d35b740
b7c7025
* Sun Jul 05 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-10
b7c7025
- ElementTree getchildren method deprecated. Use list instead.
b7c7025
4d30877
* Mon Jun 22 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-9
4d30877
- Patch3 was missing in last build
4d30877
d18ca0c
* Mon Jun 22 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-8
d18ca0c
- rebundle jquery and update to latest 1.12.x
d18ca0c
213e69d
* Wed Jun 17 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-7
213e69d
- unbundle statechange class from pysignals
213e69d
213e69d
* Wed Jun 17 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-6
213e69d
- unbundle pysignals into separate pacakge
213e69d
213e69d
* Tue Jun 16 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-5
213e69d
- patch for python 3.9 compatbility
213e69d
- move runtime requirements into subpackage
213e69d
- unbundle glyphicons-halflings
213e69d
- bootstrap java files are ASL 2.0 license
213e69d
- unbundle jquery
213e69d
213e69d
* Mon Jun 15 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-4
213e69d
- Author updated releases page to match version in source, dropping git commit
213e69d
213e69d
* Mon May 25 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-3.git.6b6984b
213e69d
- Define fw_services macro
213e69d
213e69d
* Mon May 25 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-2.git.6b6984b
213e69d
- Add firewalld config and readme
213e69d
- move examples to docs
213e69d
213e69d
* Sun May 17 2020 Andrew Bauer <zonexpertconsulting@outlook.com> - 0.8.2-1.git.6b6984b
213e69d
- Initial package
213e69d