Blob Blame History Raw
Name:           python-matrix-nio
Version:        0.21.2
Release:        %autorelease
Summary:        A Matrix client library

# ASL:
# matrix_nio-0.21.2//nio/crypto/ Apache License 2.0
# matrix_nio-0.21.2//nio/crypto/ Apache License 2.0
# matrix_nio-0.21.2//nio/store/ Apache License 2.0
# matrix_nio-0.21.2//nio/store/ Apache License 2.0

# All other files: ISC

License:        ISC and Apache-2.0
Source0:        %{pypi_source matrix_nio}

BuildArch:      noarch

%global _description %{expand:
nio is a multilayered Matrix client library. The underlying base layer doesn't
do any network IO on its own, but on top of that is a full fledged
batteries-included asyncio layer using aiohttp. File IO is only done if you
enable end-to-end encryption (E2EE).}

%description %_description

%package -n python3-matrix-nio
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  python3-toml
BuildRequires:  python3-logbook

%description -n python3-matrix-nio %_description

%autosetup -n matrix_nio-%{version}
# Update BRs
sed \
    -e 's/^aiohttp-socks.*/aiohttp-socks = "*"/' \
    -e 's/^aiofiles.*/aiofiles = "*"/' \
    -e 's/^cachetools.*/cachetools = "*"/' \
    -e 's/^h11.*/h11 = "*"/' \
    -e 's/^h2.*/h2 = "*"/' \
    -e 's/^pycryptodome.*/pycryptodomex = "*"/' \
    -e 's/^jsonschema.*/jsonschema = "*"/' \
    -i pyproject.toml
# Remove backup file
rm -fv nio/events/

# use cryptodomex instead of crypto
find . -name "*.py" -exec sed -i 's/^from Crypto/from Cryptodome/'  '{}' \;

%pyproject_buildrequires -x e2e


%pyproject_save_files nio


%files -n python3-matrix-nio  -f %{pyproject_files}