From 1fdae8ea67442df78d792f91ac029133ff7ded28 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Jun 12 2019 19:07:00 +0000 Subject: spec: Convert development spec to python 3 The development spec creates now only python 3 packages. This will be the base for Fedora 30 and CentOS 8.1 spec. Also make rpmlint happy about mixing tabs and spaces by using only spaces. Signed-off-by: Nir Soffer --- diff --git a/sanlock.spec.in b/sanlock.spec.in index 9ad2985..087076c 100644 --- a/sanlock.spec.in +++ b/sanlock.spec.in @@ -18,8 +18,8 @@ BuildRequires: libaio-devel BuildRequires: libblkid-devel BuildRequires: libuuid-devel BuildRequires: make -BuildRequires: python2 -BuildRequires: python2-devel +BuildRequires: python3 +BuildRequires: python3-devel BuildRequires: systemd-units Requires: %{name}-lib = %{version}-%{release} Requires(pre): /usr/sbin/groupadd @@ -30,14 +30,7 @@ Requires(preun): systemd-units Requires(postun): systemd-units Source0: https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz -# On Fedora we switched sanlock-python to python2-sanlock, as part of python 3 -# porting. This change was not done yet for RHEL. -# TODO: remove when RHEL switches to pythonN-sanlock. -%if 0%{?fedora} -%global python_package python2-%{name} -%else # centos/rhel -%global python_package %{name}-python -%endif +%global python_package python3-%{name} %description The sanlock daemon manages leases for applications on hosts using shared storage. @@ -53,7 +46,7 @@ The sanlock daemon manages leases for applications on hosts using shared storage # upstream does not support _smp_mflags CFLAGS=$RPM_OPT_FLAGS make -C wdmd CFLAGS=$RPM_OPT_FLAGS make -C src -CFLAGS=$RPM_OPT_FLAGS make -C python +CFLAGS=$RPM_OPT_FLAGS make -C python PY_VERSION=3.6 CFLAGS=$RPM_OPT_FLAGS make -C reset %install @@ -67,7 +60,7 @@ make -C wdmd \ make -C python \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT \ - PY_VERSION=2.7 # TODO: fix PY_VERSION to 3.6 when 2020 will arrive + PY_VERSION=3.6 make -C reset \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT @@ -79,13 +72,13 @@ install -D -m 0644 init.d/wdmd.service.native $RPM_BUILD_ROOT/%{_unitdir}/wdmd.s install -D -m 0644 init.d/sanlk-resetd.service $RPM_BUILD_ROOT/%{_unitdir}/sanlk-resetd.service install -D -m 0644 src/logrotate.sanlock \ - $RPM_BUILD_ROOT/etc/logrotate.d/sanlock + $RPM_BUILD_ROOT/etc/logrotate.d/sanlock install -D -m 0644 src/sanlock.conf \ - $RPM_BUILD_ROOT/etc/sanlock/sanlock.conf + $RPM_BUILD_ROOT/etc/sanlock/sanlock.conf install -D -m 0644 init.d/wdmd.sysconfig \ - $RPM_BUILD_ROOT/etc/sysconfig/wdmd + $RPM_BUILD_ROOT/etc/sysconfig/wdmd install -Dd -m 0755 $RPM_BUILD_ROOT/etc/wdmd.d install -Dd -m 0775 $RPM_BUILD_ROOT/%{_rundir}/sanlock @@ -93,10 +86,10 @@ install -Dd -m 0775 $RPM_BUILD_ROOT/%{_rundir}/sanlk-resetd %pre getent group sanlock > /dev/null || /usr/sbin/groupadd \ - -g 179 sanlock + -g 179 sanlock getent passwd sanlock > /dev/null || /usr/sbin/useradd \ - -u 179 -c "sanlock" -s /sbin/nologin -r \ - -g 179 -d /run/sanlock sanlock + -u 179 -c "sanlock" -s /sbin/nologin -r \ + -g 179 -d /run/sanlock sanlock /usr/sbin/usermod -a -G disk sanlock %post @@ -146,11 +139,7 @@ access to the shared disks. Summary: Python bindings for the sanlock library Requires: %{name}-lib = %{version}-%{release} %if 0%{?fedora} -%{?python_provide:%python_provide python2-%{name}} -# Remove before F30 -Provides: %{name}-python = %{version}-%{release} -Provides: %{name}-python%{?_isa} = %{version}-%{release} -Obsoletes: %{name}-python < %{version}-%{release} +%{?python_provide:%python_provide %{python_package}} %endif # fedora %description -n %{python_package} @@ -159,8 +148,8 @@ written in the Python programming language to use the interface supplied by the sanlock library. %files -n %{python_package} -%{python2_sitearch}/sanlock_python-*.egg-info -%{python2_sitearch}/sanlock.so +%{python3_sitearch}/sanlock_python-*.egg-info +%{python3_sitearch}/sanlock*.so %package devel Summary: Development files for %{name} @@ -203,6 +192,9 @@ common sanlock lockspace. %changelog +* Wed Jun 12 2019 Nir Soffer - 3.8.0-1 +- Convert spec to python 3 + * Mon Mar 25 2019 Nir Soffer - 3.7.0-1 - Import spec from Fedora master branch (371e11a) - Fix spec to work on CentOS (20efe91)