Make it clear that the spec should be used only for development, and point to the distribution spec.
When building on centos/rhel, keep the python package as sanlock-python. Using python2-sanlock will break developer setup when trying to upgrade the distribution sanlock.
Nir Soffer (2): spec: Clean up the spec spec: Keep sanlock-python on centos/rhel
sanlock.spec.in | 141 ++++++++++-------------------------------------- 1 file changed, 29 insertions(+), 112 deletions(-)
- Add note about using this spec only for development - Remove irrelevant changelog entries. This spec started when we imported it from Fedora.
Signed-off-by: Nir Soffer nsoffer@redhat.com --- sanlock.spec.in | 116 +++++------------------------------------------- 1 file changed, 11 insertions(+), 105 deletions(-)
diff --git a/sanlock.spec.in b/sanlock.spec.in index 0bd9e34..8bc80aa 100644 --- a/sanlock.spec.in +++ b/sanlock.spec.in @@ -1,5 +1,13 @@ +# NOTE: this spec should be used only for developmemnt. +# +# To find the real sanlock spec use: +# - Fedora: fedpkg clone sanlock +# - RHEL: rhpkg clone sanlock +# +# This spec was created from Fedora spec and modified to work on CentOS. + Name: sanlock Version: @VERSION@ Release: @RELEASE@%{?dist} Summary: A shared storage lock manager
@@ -176,110 +184,8 @@ common sanlock lockspace. %dir %attr(-,root,root) %{_localstatedir}/run/sanlk-resetd %{_mandir}/man8/sanlk-reset*
%changelog -* Wed Mar 20 2019 Nir Soffer nsoffer@redhat.com - 3.7.0-1 -- remove unneeded with_systemd macro -- update to sanlock 3.7.0 - -* Sat Feb 2 2019 Nir Soffer nsoffer@redhat.com - 3.6.0-8 -- fix build on Fedora rawhide - -* Thu Jan 24 2019 David Teigland teigland@redhat.com - 3.6.0-7 -- lockfile ownership - -* Sat Jul 14 2018 Fedora Release Engineering releng@fedoraproject.org - 3.6.0-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Thu Apr 12 2018 Iryna Shcherbina shcherbina.iryna@gmail.com - 3.6.0-5 -- Update Python 2 dependency declarations to new packaging standards - (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) - -* Wed Mar 14 2018 David Teigland teigland@redhat.com - 3.6.0-4 -- change makefile flags - -* Wed Mar 14 2018 David Teigland teigland@redhat.com - 3.6.0-3 -- rebuild with set_build_flags - -* Fri Feb 09 2018 Fedora Release Engineering releng@fedoraproject.org - 3.6.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Tue Dec 12 2017 David Teigland teigland@redhat.com - 3.6.0-1 -- Update to sanlock-3.6.0, drop fence_sanlock - -* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl - 3.5.0-6 -- Add Provides for the old name without %%_isa - -* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl - 3.5.0-5 -- Add Provides for the old name without %%_isa - -* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek zbyszek@in.waw.pl - 3.5.0-4 -- Python 2 binary package renamed to python2-sanlock - See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 - -* Thu Aug 03 2017 Fedora Release Engineering releng@fedoraproject.org - 3.5.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering releng@fedoraproject.org - 3.5.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Mon May 01 2017 David Teigland teigland@redhat.com - 3.5.0-1 -- Update to sanlock-3.5.0 - -* Sat Feb 11 2017 Fedora Release Engineering releng@fedoraproject.org - 3.4.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Tue Jul 19 2016 Fedora Release Engineering rel-eng@lists.fedoraproject.org - 3.4.0-2 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Pac... - -* Fri Jun 10 2016 David Teigland teigland@redhat.com - 3.4.0-1 -- Update to sanlock-3.4.0 - -* Tue Feb 23 2016 David Teigland teigland@redhat.com - 3.3.0-2 -- remove exclusive arch - -* Mon Feb 22 2016 David Teigland teigland@redhat.com - 3.3.0-1 -- Update to sanlock-3.3.0 - -* Tue Dec 01 2015 David Teigland teigland@redhat.com - 3.2.4-2 -- wdmd: prevent probe while watchdog is used - -* Fri Jun 19 2015 David Teigland teigland@redhat.com - 3.2.4-1 -- Update to sanlock-3.2.4 - -* Fri May 22 2015 David Teigland teigland@redhat.com - 3.2.3-2 -- add pkgconfig files - -* Wed May 20 2015 David Teigland teigland@redhat.com - 3.2.3-1 -- Update to sanlock-3.2.3 - -* Thu Oct 30 2014 David Teigland teigland@redhat.com - 3.2.2-2 -- checksum endian fix - -* Mon Sep 29 2014 David Teigland teigland@redhat.com - 3.2.2-1 -- Update to sanlock-3.2.2 - -* Thu Aug 21 2014 David Teigland teigland@redhat.com - 3.2.1-1 -- Update to sanlock-3.2.1 - -* Mon Aug 18 2014 David Teigland teigland@redhat.com - 3.2.0-1 -- Update to sanlock-3.2.0 - -* Wed Jan 29 2014 David Teigland teigland@redhat.com - 3.1.0-2 -- version interface - -* Tue Jan 07 2014 David Teigland teigland@redhat.com - 3.1.0-1 -- Update to sanlock-3.1.0 - -* Fri Dec 27 2013 Daniel Mach dmach@redhat.com - 3.0.1-3 -- Mass rebuild 2013-12-27 - -* Thu Aug 01 2013 David Teigland teigland@redhat.com - 3.0.1-2 -- use /usr/lib instead of /lib - -* Wed Jul 31 2013 David Teigland teigland@redhat.com - 3.0.1-1 -- Update to sanlock-3.0.1 - -* Wed Jul 24 2013 David Teigland teigland@redhat.com - 3.0.0-1 -- Update to sanlock-3.0.0 - +* 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)
On fedora we switched to python2-sanlock as part of python 3 porting but on rhel we still build the package as sanlock-python. Change the spec so we keep the name used by the distribution.
Signed-off-by: Nir Soffer nsoffer@redhat.com --- sanlock.spec.in | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/sanlock.spec.in b/sanlock.spec.in index 8bc80aa..c31599d 100644 --- a/sanlock.spec.in +++ b/sanlock.spec.in @@ -23,10 +23,19 @@ 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 + %description The sanlock daemon manages leases for applications on hosts using shared storage.
%prep %setup -q @@ -125,25 +134,27 @@ access to the shared disks. %files lib %{_libdir}/libsanlock.so.* %{_libdir}/libsanlock_client.so.* %{_libdir}/libwdmd.so.*
-%package -n python2-sanlock -%{?python_provide:%python_provide python2-sanlock} +%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} -Summary: Python bindings for the sanlock library -Requires: %{name}-lib = %{version}-%{release} +%endif # fedora
-%description -n python2-sanlock -The %{name}-python package contains a module that permits applications +%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 python2-sanlock +%files -n %{python_package} %{python2_sitearch}/sanlock_python-*.egg-info %{python2_sitearch}/sanlock.so
%package devel Summary: Development files for %{name}
sanlock-devel@lists.fedorahosted.org