summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Palus2022-03-31 21:36:11 (GMT)
committerJan Palus2022-03-31 21:36:11 (GMT)
commitc669bb421db66b93142157f25364e0c846ec73e5 (patch)
treec550aa9bd1394d8757ddff6268cb09e572c449d8
parente854141fab79799134f4010e2271b7b055ee73e6 (diff)
downloadsystem-config-printer-c669bb421db66b93142157f25364e0c846ec73e5.zip
system-config-printer-c669bb421db66b93142157f25364e0c846ec73e5.tar.gz
use macros to build and install python modules
-rw-r--r--system-config-printer.spec32
1 files changed, 19 insertions, 13 deletions
diff --git a/system-config-printer.spec b/system-config-printer.spec
index cadb179..cdca8f2 100644
--- a/system-config-printer.spec
+++ b/system-config-printer.spec
@@ -22,7 +22,7 @@ BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: python3-modules
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.21
+BuildRequires: rpmbuild(macros) >= 1.750
BuildRequires: tar >= 1:1.22
BuildRequires: udev-devel >= 172
BuildRequires: xmlto
@@ -93,6 +93,8 @@ printers.
%{__make} \
udevhelperdir=/lib/udev
+%py3_build
+
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
@@ -100,12 +102,16 @@ rm -rf $RPM_BUILD_ROOT
udevrulesdir=/lib/udev/rules.d \
DESTDIR=$RPM_BUILD_ROOT
+%if %{_ver_ge "%py3_ver" "3.10"}
+%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/python%{py3_ver}
+%endif
+
+%py3_install
+
%find_lang %{name}
%py3_comp $RPM_BUILD_ROOT%{_datadir}/%{name}
%py3_ocomp $RPM_BUILD_ROOT%{_datadir}/%{name}
-%py3_comp $RPM_BUILD_ROOT%{py_sitedir}/cupshelpers
-%py3_ocomp $RPM_BUILD_ROOT%{py_sitedir}/cupshelpers
%clean
rm -rf $RPM_BUILD_ROOT
@@ -194,16 +200,16 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/%{name}/statereason.py
%{_datadir}/%{name}/timedops.py
-%dir %{py3_sitedir}/cupshelpers
-%{py3_sitedir}/cupshelpers/__pycache__
-%{py3_sitedir}/cupshelpers/__init__.py
-%{py3_sitedir}/cupshelpers/config.py
-%{py3_sitedir}/cupshelpers/cupshelpers.py
-%{py3_sitedir}/cupshelpers/installdriver.py
-%{py3_sitedir}/cupshelpers/openprinting.py
-%{py3_sitedir}/cupshelpers/ppds.py
-%{py3_sitedir}/cupshelpers/xmldriverprefs.py
-%{py3_sitedir}/*.egg-info
+%dir %{py3_sitescriptdir}/cupshelpers
+%{py3_sitescriptdir}/cupshelpers/__pycache__
+%{py3_sitescriptdir}/cupshelpers/__init__.py
+%{py3_sitescriptdir}/cupshelpers/config.py
+%{py3_sitescriptdir}/cupshelpers/cupshelpers.py
+%{py3_sitescriptdir}/cupshelpers/installdriver.py
+%{py3_sitescriptdir}/cupshelpers/openprinting.py
+%{py3_sitescriptdir}/cupshelpers/ppds.py
+%{py3_sitescriptdir}/cupshelpers/xmldriverprefs.py
+%{py3_sitescriptdir}/*.egg-info
%files udev
%defattr(644,root,root,755)