On Sun, Jun 16, 2019 at 2:21 PM Pavel Bar pbar@redhat.com wrote:
Looks good. Just 2 points to consider, see below:
On Wed, Jun 12, 2019 at 10:04 PM Nir Soffer nirsof@gmail.com wrote:
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 nsoffer@redhat.com
sanlock.spec.in | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/sanlock.spec.in b/sanlock.spec.in index 9ad2985..087076c 100644 --- a/sanlock.spec.in +++ b/sanlock.spec.in @@ -16,30 +16,23 @@ URL: https://pagure.io/sanlock/ BuildRequires: gcc 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 Requires(pre): /usr/sbin/useradd Requires(post): systemd-units Requires(post): systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units Source0: https://releases.pagure.org/sanlock/%%7Bname%7D-%%7Bversion%7D.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.
%prep @@ -51,11 +44,11 @@ The sanlock daemon manages leases for applications on hosts using shared storage %endif # upstream does not require configure # 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 rm -rf $RPM_BUILD_ROOT make -C src \ @@ -65,11 +58,11 @@ make -C wdmd \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT make -C python \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT \
PY_VERSION=2.7 # TODO: fix PY_VERSION to 3.6 when 2020 willarrive
PY_VERSION=3.62nd usage of the hardcoded "3.6" Python version. Consider declaring a constant to avoid the situation that someone in the future might change only one of the appearances.
Good idea, I wasted few minutes while preparing this patch when one call was using 3.6, and the other 2.7.
make -C reset \ install LIBDIR=%{_libdir} \ DESTDIR=$RPM_BUILD_ROOT
@@ -77,28 +70,28 @@ install -D -m 0644 init.d/sanlock.service.native $RPM_BUILD_ROOT/%{_unitdir}/san install -D -m 0755 init.d/wdmd $RPM_BUILD_ROOT/usr/lib/systemd/systemd-wdmd install -D -m 0644 init.d/wdmd.service.native $RPM_BUILD_ROOT/%{_unitdir}/wdmd.service 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 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 %systemd_post wdmd.service sanlock.service
@@ -144,25 +137,21 @@ access to the shared disks.
%package -n %{python_package} 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} The %{python_package} package contains a module that permits applications 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} Requires: %{name}-lib = %{version}-%{release}
@@ -201,8 +190,11 @@ common sanlock lockspace. %dir %attr(-,root,root) %{_rundir}/sanlk-resetd %{_mandir}/man8/sanlk-reset*
%changelog +* Wed Jun 12 2019 Nir Soffer nsoffer@redhat.com - 3.8.0-1 +- Convert spec to python 3
Not sure it's important to add to the changelog section: mixing tabs and spaces fix
This is internal change that does not affect the behavior so I don't think there is point to mention it in the changelog.
- Mon Mar 25 2019 Nir Soffer nsoffer@redhat.com - 3.7.0-1
- Import spec from Fedora master branch (371e11a)
- Fix spec to work on CentOS (20efe91)
-- 2.17.2
sanlock-devel@lists.fedorahosted.org