%global bundled 1 Name: python-hass-nabucasa Version: 0.78.0 Release: 0.03 Summary: Home Assistant cloud integration by Nabu Casa, Inc. # Check if the automatically generated License and its spelling is correct for Fedora # https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ License: GPL-3.0-only URL: https://pypi.org/project/hass-nabucasa/ Source: %{pypi_source hass-nabucasa} Source1: %{pypi_source cryptography 42.0.5} BuildArch: noarch BuildRequires: python3-devel %if 0%{?bundled} > 0 BuildRequires: python3-pip # for python-cryptography BuildRequires: python3-setuptools >= 61.0.0 # should actually be 1.7.0 BuildRequires: python3-setuptools-rust >= 1.6.0 BuildRequires: openssl-devel BuildRequires: python-wheel BuildRequires: python3-cffi >= 1.12 #Provides: python3-cryptography = 42.0.5 #Obsoletes: python3-cryptography < 42.0.5 %endif # Fill in the actual package description to submit package to Fedora %global _description %{expand: This is package 'hass-nabucasa' generated automatically by pyp2spec.} %description %_description %package -n python3-hass-nabucasa %if 0%{?bundled} > 0 # but since we used to bundle it with previous python-homeassistants Obsoletes: python3-homeassistant < 2024.4.0~b0 %endif Summary: %{summary} %description -n python3-hass-nabucasa %_description # For official Fedora packages, review which extras should be actually packaged # See: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#Extras #Error: The package name contains an extras name `test` that was not found in the metadata. #Check if the extras were removed from the project. If so, consider removing the subpackage and obsoleting it from another. #%%pyproject_extras_subpkg -n python3-hass-nabucasa test %prep %autosetup -p1 -n hass-nabucasa-%{version} # atomicwrites is provided by fedora sed -i -e 's/\(atomicwrites\)-homeassistant/\1/' setup.py %generate_buildrequires %if 0%{?bundled} > 0 cp -a setup.py{,.bak} # things we are going to bundle sed -i -e '/"cryptography[>=]=/d' setup.py cat setup.py >&2 %endif %pyproject_buildrequires # Keep only those extras which you actually want to package or use during tests %pyproject_buildrequires -x test #%if 0%{?bundled} > 0 #mv setup.py{.bak,} #%endif %build %pyproject_wheel %install %if 0%{?bundled} < 1 %pyproject_install # For official Fedora packages, including files with '*' +auto is not allowed # Replace it with a list of relevant Python modules/globs and list extra files in %%files %pyproject_save_files '*' +auto %else # cryptography pip install --no-build-isolation --no-index --root %{buildroot} %SOURCE1 . %endif %check %if 0%{?bundled} < 1 %pyproject_check_import %endif %if 0%{?bundled} < 1 %files -n python3-hass-nabucasa -f %{pyproject_files} %else %files -n python3-hass-nabucasa %{python3_sitelib}/* #%%{python3_sitearch}/* %endif %changelog * Wed Apr 24 2024 Brian J. Murrell - 0.78.0-0.03 - Remove Conflicts * Wed Apr 24 2024 Brian J. Murrell - 0.78.0-0.02 - Update Conflicts/Obsoletes * Mon Apr 22 2024 Brian J. Murrell - 0.78.0-0.01 - Initial release - Use python-atomicwrites from fedora - Bundle python-cryptography until Fedora has a 42.x release