--- /dev/null
+diff --color -urN rpm-4.16.0.orig/fileattrs/pythondist.attr rpm-4.16.0/fileattrs/pythondist.attr
+--- rpm-4.16.0.orig/fileattrs/pythondist.attr 2020-12-09 12:38:21.203961862 +0100
++++ rpm-4.16.0/fileattrs/pythondist.attr 2020-12-09 12:58:43.178952892 +0100
+@@ -1,3 +1,3 @@
+ %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
+ %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
+-%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
++%__pythondist_path /(lib(64|x32)?|share)/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
--- /dev/null
+Summary: Python macros, which simplifies creation of RPM packages with Python software
+Summary(pl.UTF-8): Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w Pythonie
+Name: python-rpm-packaging
+Version: 1
+Release: 0.1
+License: GPL v2
+Group: Base
+Source0: https://github.com/rpm-software-management/python-rpm-packaging/archive/main/%{name}-%{version}.tar.gz
+# Source0-md5: cee60e26bdd3977b5e64f6def07a1571
+Patch0: x32.patch
+Patch1: noarch.patch
+URL: https://github.com/rpm-software-management/python-rpm-packaging
+BuildRequires: rpm-build >= 4.6
+Requires: python3
+Requires: python3-modules
+Requires: python3-setuptools
+Requires: rpm
+Provides: rpm-pythonprov = 1:4.17
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define _rpmlibdir /usr/lib/rpm
+
+%description
+Python macros, which simplifies creation of RPM packages with Python
+software.
+
+%description -l pl.UTF-8
+Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w
+Pythonie.
+
+%prep
+%setup -q -n %{name}-main
+%patch0 -p1
+%patch1 -p1
+
+%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' scripts/pythondistdeps.py
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_rpmlibdir}/fileattrs
+
+cp -p fileattrs/*.attr $RPM_BUILD_ROOT%{_rpmlibdir}/fileattrs
+cp -p scripts/pythondistdeps.py $RPM_BUILD_ROOT%{_rpmlibdir}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README
+%attr(755,root,root) %{_rpmlibdir}/pythondistdeps.py
+%{_rpmlibdir}/fileattrs/python.attr
+%{_rpmlibdir}/fileattrs/pythondist.attr
--- /dev/null
+diff -ur rpm-4.16.1.2/fileattrs/python.attr rpm-4.16.1.2.x32/fileattrs/python.attr
+--- rpm-4.16.1.2/fileattrs/python.attr 2020-08-31 11:14:07.991087349 +0200
++++ rpm-4.16.1.2.x32/fileattrs/python.attr 2021-03-21 21:50:04.127398387 +0100
+@@ -14,14 +14,15 @@
+ %__python_requires() %{lua:
+ -- Match buildroot paths of the form
+ -- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and
+- -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
++ -- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/ and
++ -- /PATH/OF/BUILDROOT/usr/libx32/pythonMAJOR.MINOR/
+ -- generating a line of the form:
+ -- python(abi) = MAJOR.MINOR
+ local path = rpm.expand('%1')
+- if path:match('/usr/lib%d*/python%d+%.%d+/.*') then
+- local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1')
++ if path:match('/usr/lib%w*/python%d+%.%d+/.*') then
++ local requires = path:gsub('.*/usr/lib%w*/python(%d+%.%d+)/.*', 'python(abi) = %1')
+ print(requires)
+ end
+ }
+
+-%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
++%__python_path ^((%{_prefix}/lib(64|x32)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
+diff -ur rpm-4.16.1.2/fileattrs/pythondist.attr rpm-4.16.1.2.x32/fileattrs/pythondist.attr
+--- rpm-4.16.1.2/fileattrs/pythondist.attr 2020-05-28 12:04:25.026136626 +0200
++++ rpm-4.16.1.2.x32/fileattrs/pythondist.attr 2021-03-21 21:50:04.127398387 +0100
+@@ -1,3 +1,3 @@
+ %__pythondist_provides %{_rpmconfigdir}/pythondistdeps.py --provides --majorver-provides
+ %__pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires
+-%__pythondist_path /lib(64)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$
++%__pythondist_path /lib(64|x32)?/python[[:digit:]]\\.[[:digit:]]+/site-packages/[^/]+\\.(dist-info|egg-info|egg-link)$