--- /dev/null
+Name: python3-MarkupSafe
+Version: 2.1.1
+Release: 0
+Summary: Implements a XML/HTML/XHTML Markup safe string for Python
+License: BSD-3-Clause
+Group: Development/Languages/Python
+Url: https://palletsprojects.com/p/markupsafe/
+Source: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+
+Provides: python3-markupsafe = %{version}
+Obsoletes: python3-markupsafe < %{version}
+
+%description
+Implements a unicode subclass that supports HTML strings. This can be used to
+safely encode strings for dynamically generated web pages.
+
+%prep
+%setup -q -n %{name}-%{version}
+
+%build
+cp %{SOURCE1001} .
+export CFLAGS="%{optflags}"
+%{_bindir}/python3 setup.py build
+
+%install
+%{_bindir}/python3 setup.py install --prefix=%{_prefix} --install-lib=%{python3_sitelib} --root=%{buildroot}
+
+# Move library
+%ifarch x86_64 aarch64
+mkdir -p %{buildroot}%{_libdir}/python%{python3_version}/site-packages/markupsafe
+mv %{buildroot}%{python3_sitelib}/markupsafe/_speedups*.so %{buildroot}%{_libdir}/python%{python3_version}/site-packages/markupsafe
+%endif
+
+%remove_docs
+
+%files
+%manifest %{name}.manifest
+%license LICENSE.rst
+%{python3_sitelib}/markupsafe/
+%{python3_sitelib}/MarkupSafe-%{version}-py*.egg-info
+%{_libdir}/python%{python3_version}/site-packages/markupsafe/