commit 2e07ebf29d30cecfc14a499a0e3553d96a7d6151 Author: Arkadiusz Miśkiewicz <ar...@maven.pl> Date: Mon Feb 26 12:07:39 2024 +0100
Add python3 package python-fuse.spec | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 4 deletions(-) --- diff --git a/python-fuse.spec b/python-fuse.spec index d7e48b2..e40c86c 100644 --- a/python-fuse.spec +++ b/python-fuse.spec @@ -1,3 +1,7 @@ +# Conditional build: +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module +# %define module fuse Summary: Python interface to FUSE (Filesystem in USErspace) Summary(pl.UTF-8): Pythonowy interfejs do FUSE (systemu plików w przestrzeni użytkownika) @@ -11,7 +15,12 @@ Source0: https://github.com/libfuse/python-fuse/archive/refs/tags/v%{version}.ta URL: https://github.com/libfuse/python-fuse BuildRequires: libfuse-devel BuildRequires: pkgconfig +%if %{with python2} BuildRequires: python-devel >= 1:2.5 +%endif +%if %{with python3} +BuildRequires: python3-devel +%endif BuildRequires: rpm-pythonprov BuildRequires: rpmbuild(macros) >= 1.710 Requires: python-modules @@ -24,19 +33,57 @@ Python interface to FUSE (Filesystem in USErspace). Pythonowy interfejs do FUSE (Filesystem in USErspace - systemu plików w przestrzeni użytkownika). + +%package -n python3-%{module} +Summary: Python interface to FUSE (Filesystem in USErspace) +Summary(pl.UTF-8): Pythonowy interfejs do FUSE (systemu plików w przestrzeni użytkownika) +Group: Libraries/Python +Requires: python3-modules >= 1:3.2 + +%description -n python3-%{module} +Python interface to FUSE (Filesystem in USErspace). + +%description -n python3-%{module} -l pl.UTF-8 +Pythonowy interfejs do FUSE (Filesystem in USErspace - systemu plików +w przestrzeni użytkownika). + %prep %setup -q -n python-fuse-%{version} %build +%if %{with python2} %py_build +%endif + +%if %{with python3} +%py3_build +%endif %install rm -rf $RPM_BUILD_ROOT -%py_install -install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}-%{release} -cp -p example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}-%{release} +%if %{with python2} +%py_install %py_postclean +%endif + +%if %{with python3} +%py3_install +%endif + +%if %{with python2} +install -d $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} +cp -a example/* $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} +find $RPM_BUILD_ROOT%{_examplesdir}/python-%{module}-%{version} -name '*.py' \ + | xargs sed -i '1s|^#!.*python\b|#!%{__python}|' +%endif + +%if %{with python3} +install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} +cp -a example/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} +find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \ + | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|' +%endif %clean rm -rf $RPM_BUILD_ROOT @@ -49,4 +96,18 @@ rm -rf $RPM_BUILD_ROOT %{py_sitedir}/fuseparts/*.py[co] %attr(755,root,root) %{py_sitedir}/fuseparts/*.so %{py_sitedir}/fuse_python-%{version}-py*.egg-info -%{_examplesdir}/%{name}-%{version}-%{release} +%{_examplesdir}/%{name}-%{version} + +%if %{with python3} +%files -n python3-%{module} +%defattr(644,root,root,755) +%doc AUTHORS FAQ README* +%{py3_sitedir}/%{module}.py +%{py3_sitedir}/__pycache__ +%{py3_sitedir}/fuseparts/*.py +%attr(755,root,root) %{py3_sitedir}/fuseparts/*.so +%{py3_sitedir}/fuseparts/__pycache__ +%{py3_sitedir}/%{module}_*-%{version}-py*.egg-info +%{_examplesdir}/python3-%{module}-%{version} +%endif + ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/python-fuse.git/commitdiff/2e07ebf29d30cecfc14a499a0e3553d96a7d6151 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit