]> git.pld-linux.org Git - packages/sanlock.git/blobdiff - sanlock.spec
rebuild with python 3.10
[packages/sanlock.git] / sanlock.spec
index 61f8fe00c5beebb70251da6d0b2bbef8402ab11b..a4a29236b552f6d9d29a851a9dbe95ed5a1a24fd 100644 (file)
@@ -1,22 +1,25 @@
+#
+# Conditional build:
+%bcond_without python2 # CPython 2.x module
+%bcond_without python3 # CPython 3.x module
+
 Summary:       Shared storage lock manager
 Summary(pl.UTF-8):     Zarządca blokad dla współdzielonego składowania danych
 Name:          sanlock
-Version:       3.4.0
-Release:       1
+Version:       3.8.4
+Release:       3
 License:       LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
 Group:         Networking
-# older releases: https://fedorahosted.org/releases/s/a/sanlock/%{name}-%{version}.tar.gz
-#Source0Download: https://git.fedorahosted.org/cgit/sanlock.git/
-Source0:       https://git.fedorahosted.org/cgit/sanlock.git/snapshot/%{name}-%{version}.tar.xz
-# Source0-md5: d882beb5f188abff545b64cc3cbe9c79
-Patch0:                %{name}-link.patch
-Patch1:                %{name}-init-pld.patch
-URL:           https://fedorahosted.org/sanlock/
+Source0:       https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
+# Source0-md5: c064756c07a86e83119cfdd7695cf449
+Patch0:                %{name}-init-pld.patch
+URL:           https://pagure.io/sanlock
 BuildRequires: gcc >= 5:3.4
 BuildRequires: libaio-devel
 BuildRequires: libblkid-devel
 BuildRequires: libuuid-devel
-BuildRequires: python-devel
+%{?with_python2:BuildRequires: python-devel >= 1:2.5}
+%{?with_python3:BuildRequires: python3-devel >= 1:3.2}
 BuildRequires: rpmbuild(macros) >= 1.228
 BuildRequires: tar >= 1:1.22
 BuildRequires: xz
@@ -99,21 +102,32 @@ Header files for sanlock libraries.
 Pliki nagłówkowe bibliotek sanlock.
 
 %package -n python-sanlock
-Summary:       Python binding for sanlock library
-Summary(pl.UTF-8):     Wiązanie Pythona do biblioteki sanlock
+Summary:       Python binding for sanlock library
+Summary(pl.UTF-8):     Wiązanie Pythona do biblioteki sanlock
 Group:         Libraries/Python
 Requires:      %{name}-libs = %{version}-%{release}
 
 %description -n python-sanlock
-Python binding for sanlock library.
+Python binding for sanlock library.
 
 %description -n python-sanlock -l pl.UTF-8
-Wiązanie Pythona do biblioteki sanlock.
+Wiązanie Pythona 2 do biblioteki sanlock.
+
+%package -n python3-sanlock
+Summary:       Python 3 binding for sanlock library
+Summary(pl.UTF-8):     Wiązanie Pythona 3 do biblioteki sanlock
+Group:         Libraries/Python
+Requires:      %{name}-libs = %{version}-%{release}
+
+%description -n python3-sanlock
+Python 3 binding for sanlock library.
+
+%description -n python3-sanlock -l pl.UTF-8
+Wiązanie Pythona 3 do biblioteki sanlock.
 
 %prep
 %setup -q
 %patch0 -p1
-%patch1 -p1
 
 %build
 export CFLAGS="%{rpmcflags}"
@@ -140,9 +154,14 @@ CFLAGS= \
        LDFLAGS="%{rpmldflags}" \
        OPTIMIZE_FLAG="%{rpmcflags}"
 
-# note (as of 3.3.0): python3 is not supported
 cd python
+%if %{with python2}
 %py_build
+%endif
+
+%if %{with python3}
+%py3_build
+%endif
 cd ..
 
 %install
@@ -164,7 +183,13 @@ rm -rf $RPM_BUILD_ROOT
        DESTDIR=$RPM_BUILD_ROOT
 
 cd python
+%if %{with python2}
 %py_install
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
 cd ..
 
 /sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
@@ -289,7 +314,16 @@ fi
 %{_pkgconfigdir}/libsanlock.pc
 %{_pkgconfigdir}/libsanlock_client.pc
 
+%if %{with python2}
 %files -n python-sanlock
 %defattr(644,root,root,755)
 %attr(755,root,root) %{py_sitedir}/sanlock.so
 %{py_sitedir}/sanlock_python-%{version}_-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-sanlock
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py3_sitedir}/sanlock.cpython-*.so
+%{py3_sitedir}/sanlock_python-%{version}_-py*.egg-info
+%endif
This page took 0.108077 seconds and 4 git commands to generate.