Angus Salkeld 12dcdb9
Name:           sanlock
5930ed8
Version:        3.8.4
3a02154
Release:        1%{?dist}
e380b4f
Summary:        A shared storage lock manager
Angus Salkeld 12dcdb9
d3e4a61
License:        GPLv2 and GPLv2+ and LGPLv2+
9cf0c87
URL:            https://pagure.io/sanlock/
4728e42
BuildRequires:  gcc
8bd28ed
BuildRequires:  libaio-devel
8bd28ed
BuildRequires:  libblkid-devel
8bd28ed
BuildRequires:  libuuid-devel
8bd28ed
BuildRequires:  make
1b0b340
BuildRequires:  python3
1b0b340
BuildRequires:  python3-devel
768d5dd
BuildRequires:  systemd-units
3778194
Requires:       %{name}-lib = %{version}-%{release}
949ca9b
Requires(pre):  /usr/sbin/groupadd
949ca9b
Requires(pre):  /usr/sbin/useradd
c6e393e
Requires(post): systemd-units
c6e393e
Requires(post): systemd-sysv
c6e393e
Requires(preun): systemd-units
c6e393e
Requires(postun): systemd-units
d297165
Source0:        https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
3a02154
3a02154
# Patch0: 0001-foo.patch
771637f
Angus Salkeld 12dcdb9
%description
27b16d4
The sanlock daemon manages leases for applications on hosts using shared storage.
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%prep
Angus Salkeld 12dcdb9
%setup -q
3a02154
# %patch0 -p1
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%build
26a4ffd
%set_build_flags
Angus Salkeld 12dcdb9
# upstream does not require configure
Angus Salkeld 12dcdb9
# upstream does not support _smp_mflags
11fb958
CFLAGS=$RPM_OPT_FLAGS make -C wdmd
11fb958
CFLAGS=$RPM_OPT_FLAGS make -C src
1b0b340
CFLAGS=$RPM_OPT_FLAGS make -C python PY_VERSION=3
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%install
Angus Salkeld 12dcdb9
rm -rf $RPM_BUILD_ROOT
11fb958
make -C src \
fcd8b9e
        install LIBDIR=%{_libdir} \
Angus Salkeld 12dcdb9
        DESTDIR=$RPM_BUILD_ROOT
2a871d0
make -C wdmd \
fcd8b9e
        install LIBDIR=%{_libdir} \
2a871d0
        DESTDIR=$RPM_BUILD_ROOT
3778194
make -C python \
fcd8b9e
        install LIBDIR=%{_libdir} \
1b0b340
        DESTDIR=$RPM_BUILD_ROOT \
1b0b340
        PY_VERSION=3
d3e4a61
c6e393e
640f0fe
install -D -m 0644 init.d/sanlock.service.native $RPM_BUILD_ROOT/%{_unitdir}/sanlock.service
640f0fe
install -D -m 0755 init.d/wdmd $RPM_BUILD_ROOT/usr/lib/systemd/systemd-wdmd
640f0fe
install -D -m 0644 init.d/wdmd.service.native $RPM_BUILD_ROOT/%{_unitdir}/wdmd.service
d3e4a61
e95c8df
install -D -m 0644 src/logrotate.sanlock \
1b0b340
    $RPM_BUILD_ROOT/etc/logrotate.d/sanlock
d3e4a61
27b16d4
install -D -m 0644 src/sanlock.conf \
1b0b340
    $RPM_BUILD_ROOT/etc/sanlock/sanlock.conf
27b16d4
b990917
install -D -m 0644 init.d/wdmd.sysconfig \
1b0b340
    $RPM_BUILD_ROOT/etc/sysconfig/wdmd
bceaa98
e95c8df
install -Dd -m 0755 $RPM_BUILD_ROOT/etc/wdmd.d
e95c8df
install -Dd -m 0775 $RPM_BUILD_ROOT/%{_localstatedir}/run/sanlock
59eef4e
3778194
%pre
d3e4a61
getent group sanlock > /dev/null || /usr/sbin/groupadd \
1b0b340
    -g 179 sanlock
d3e4a61
getent passwd sanlock > /dev/null || /usr/sbin/useradd \
1b0b340
    -u 179 -c "sanlock" -s /sbin/nologin -r \
1b0b340
    -g 179 -d /var/run/sanlock sanlock
bceaa98
/usr/sbin/usermod -a -G disk sanlock
3778194
3778194
%post
c6e393e
%systemd_post wdmd.service sanlock.service
Angus Salkeld 12dcdb9
3778194
%preun
640f0fe
%systemd_preun wdmd.service sanlock.service
3778194
3778194
%postun
3ec7562
%systemd_postun wdmd.service sanlock.service
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%files
640f0fe
/usr/lib/systemd/systemd-wdmd
07c4039
%{_unitdir}/sanlock.service
07c4039
%{_unitdir}/wdmd.service
Angus Salkeld 12dcdb9
%{_sbindir}/sanlock
2a871d0
%{_sbindir}/wdmd
27b16d4
%dir %{_sysconfdir}/wdmd.d
27b16d4
%dir %{_sysconfdir}/sanlock
59eef4e
%dir %attr(-,sanlock,sanlock) %{_localstatedir}/run/sanlock
fcd8b9e
%{_mandir}/man8/wdmd*
fcd8b9e
%{_mandir}/man8/sanlock*
d3e4a61
%config(noreplace) %{_sysconfdir}/logrotate.d/sanlock
27b16d4
%config(noreplace) %{_sysconfdir}/sanlock/sanlock.conf
bceaa98
%config(noreplace) %{_sysconfdir}/sysconfig/wdmd
640f0fe
%doc init.d/sanlock
640f0fe
%doc init.d/sanlock.service
640f0fe
%doc init.d/wdmd.service
3778194
3778194
%package        lib
27b16d4
Summary:        A shared storage lock manager library
3778194
3778194
%description    lib
3778194
The %{name}-lib package contains the runtime libraries for sanlock,
e380b4f
a shared storage lock manager.
3778194
Hosts connected to a common SAN can use this to synchronize their
3778194
access to the shared disks.
3778194
5a9f4e5
%ldconfig_scriptlets lib
3778194
3778194
%files          lib
Angus Salkeld 12dcdb9
%{_libdir}/libsanlock.so.*
fcd8b9e
%{_libdir}/libsanlock_client.so.*
3778194
%{_libdir}/libwdmd.so.*
3778194
1b0b340
%package        -n python3-sanlock
1b0b340
%{?python_provide:%python_provide python3-sanlock}
3778194
Summary:        Python bindings for the sanlock library
fcd8b9e
Requires:       %{name}-lib = %{version}-%{release}
3778194
1b0b340
%description    -n python3-sanlock
3778194
The %{name}-python package contains a module that permits applications
3778194
written in the Python programming language to use the interface
3778194
supplied by the sanlock library.
3778194
1b0b340
%files          -n python3-sanlock
1b0b340
%{python3_sitearch}/sanlock_python-*.egg-info
1b0b340
%{python3_sitearch}/sanlock*.so
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%package        devel
Angus Salkeld 12dcdb9
Summary:        Development files for %{name}
fcd8b9e
Requires:       %{name}-lib = %{version}-%{release}
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%description    devel
Angus Salkeld 12dcdb9
The %{name}-devel package contains libraries and header files for
Angus Salkeld 12dcdb9
developing applications that use %{name}.
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%files          devel
3778194
%{_libdir}/libwdmd.so
3778194
%{_includedir}/wdmd.h
Angus Salkeld 12dcdb9
%{_libdir}/libsanlock.so
fcd8b9e
%{_libdir}/libsanlock_client.so
Angus Salkeld 12dcdb9
%{_includedir}/sanlock.h
3778194
%{_includedir}/sanlock_rv.h
3778194
%{_includedir}/sanlock_admin.h
Angus Salkeld 12dcdb9
%{_includedir}/sanlock_resource.h
3778194
%{_includedir}/sanlock_direct.h
27b16d4
%{_libdir}/pkgconfig/libsanlock.pc
27b16d4
%{_libdir}/pkgconfig/libsanlock_client.pc
Angus Salkeld 12dcdb9
Angus Salkeld 12dcdb9
%changelog
5930ed8
* Thu Jun 03 2021 David Teigland <teigland@redhat.com> 3.8.4-1
5930ed8
- New upstream release
5930ed8
3a02154
* Wed Feb 24 2021 David Teigland <teigland@redhat.com> 3.8.3-1
3a02154
- New upstream release
3a02154
- Drop sanlk-reset which is not used.
3a02154
ef71a7e
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-8
ef71a7e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
ef71a7e
83af04f
* Sat Aug 08 2020 Nir Soffer <nsoffer@redhat.com> - 3.8.1-7
83af04f
- Enable LTO
83af04f
762de81
* Sun Aug 02 2020 Nir Soffer <nsoffer@redhat.com> - 3.8.1-6
762de81
- Removing extra linkeer args, hopefully fix python build
762de81
5cfea2e
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-5
5cfea2e
- Second attempt - Rebuilt for
5cfea2e
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
5cfea2e
dd16bea
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.1-4
dd16bea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
dd16bea
bc33d44
* Tue Jul 08 2020 Jeff Law <law@redhat.com> - 3.8.1-3
bc33d44
- Disable LTO
bc33d44
2d57e37
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.8.1-2
2d57e37
- Rebuilt for Python 3.9
2d57e37
67235ab
* Sat May 2 2020 Nir Soffer <nsoffer@redhat.com> - 3.8.1-1
67235ab
- Update to sanlock-3.8.1
67235ab
35c783b
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-4
35c783b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
35c783b
f6a1951
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.8.0-3
f6a1951
- Rebuilt for Python 3.8
f6a1951
1799ebd
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-2
1799ebd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
1799ebd
1b0b340
* Wed Jun 12 2019 Nir Soffer <nsoffer@redhat.com> - 3.8.0-1
1b0b340
- Update to sanlock-3.8.0
1b0b340
- Convert spec to python 3
1b0b340
8bd28ed
* Tue May 21 2019 Nir Soffer <nsoffer@redhat.com> - 3.7.3-1
8bd28ed
- Update to sanlock-3.7.3
8bd28ed
- Add missing BuildRequires and Requires
8bd28ed
c74119d
* Fri Apr 12 2019 Nir Soffer <nsoffer@redhat.com> - 3.7.1-2
c74119d
- Cleanup up align and sector constants
c74119d
dbcbd08
* Mon Apr 8 2019 Nir Soffer <nsoffer@redhat.com> - 3.7.1-1
253c91d
- Update to sanlock 3.7.1
253c91d
- Fix read_resource_owners (414abfe)
253c91d
bda28c8
* Wed Mar 20 2019 Nir Soffer <nsoffer@redhat.com> - 3.7.0-1
bda28c8
- remove unneeded with_systemd macro
bda28c8
- update to sanlock 3.7.0
bda28c8
d9222aa
* Sat Feb 2 2019 Nir Soffer <nsoffer@redhat.com> - 3.6.0-8
d9222aa
- fix build on Fedora rawhide
d9222aa
67adc73
* Thu Jan 24 2019 David Teigland <teigland@redhat.com> - 3.6.0-7
67adc73
- lockfile ownership
67adc73
ad4036a
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.0-6
ad4036a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ad4036a
84f36bf
* Thu Apr 12 2018 Iryna Shcherbina <shcherbina.iryna@gmail.com> - 3.6.0-5
84f36bf
- Update Python 2 dependency declarations to new packaging standards
84f36bf
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
84f36bf
e6c3221
* Wed Mar 14 2018 David Teigland <teigland@redhat.com> - 3.6.0-4
e6c3221
- change makefile flags
e6c3221
e8d9439
* Wed Mar 14 2018 David Teigland <teigland@redhat.com> - 3.6.0-3
26a4ffd
- rebuild with set_build_flags
26a4ffd
7d3b0ed
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.0-2
7d3b0ed
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
7d3b0ed
9cf0c87
* Tue Dec 12 2017 David Teigland <teigland@redhat.com> - 3.6.0-1
9cf0c87
- Update to sanlock-3.6.0, drop fence_sanlock
9cf0c87
4625ee4
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.5.0-6
4625ee4
- Add Provides for the old name without %%_isa
4625ee4
f6cda7b
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.5.0-5
f6cda7b
- Add Provides for the old name without %%_isa
f6cda7b
8219437
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.5.0-4
8219437
- Python 2 binary package renamed to python2-sanlock
8219437
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
8219437
28ebb67
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-3
28ebb67
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
28ebb67
3347265
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.0-2
3347265
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
3347265
d297165
* Mon May 01 2017 David Teigland <teigland@redhat.com> - 3.5.0-1
d297165
- Update to sanlock-3.5.0
d297165
d9e16ac
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-3
d9e16ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
d9e16ac
36b0cc4
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.0-2
36b0cc4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
36b0cc4
b05c391
* Fri Jun 10 2016 David Teigland <teigland@redhat.com> - 3.4.0-1
b05c391
- Update to sanlock-3.4.0
b05c391
b1fafa2
* Tue Feb 23 2016 David Teigland <teigland@redhat.com> - 3.3.0-2
b1fafa2
- remove exclusive arch
b1fafa2
640f0fe
* Mon Feb 22 2016 David Teigland <teigland@redhat.com> - 3.3.0-1
640f0fe
- Update to sanlock-3.3.0
640f0fe
640f0fe
* Tue Dec 01 2015 David Teigland <teigland@redhat.com> - 3.2.4-2
640f0fe
- wdmd: prevent probe while watchdog is used
640f0fe
27b16d4
* Fri Jun 19 2015 David Teigland <teigland@redhat.com> - 3.2.4-1
27b16d4
- Update to sanlock-3.2.4
27b16d4
640f0fe
* Fri May 22 2015 David Teigland <teigland@redhat.com> - 3.2.3-2
640f0fe
- add pkgconfig files
cc63344
640f0fe
* Wed May 20 2015 David Teigland <teigland@redhat.com> - 3.2.3-1
640f0fe
- Update to sanlock-3.2.3
640f0fe
640f0fe
* Thu Oct 30 2014 David Teigland <teigland@redhat.com> - 3.2.2-2
640f0fe
- checksum endian fix
e68913b
640f0fe
* Mon Sep 29 2014 David Teigland <teigland@redhat.com> - 3.2.2-1
640f0fe
- Update to sanlock-3.2.2
4b03f6b
a3ff38c
* Thu Aug 21 2014 David Teigland <teigland@redhat.com> - 3.2.1-1
a3ff38c
- Update to sanlock-3.2.1
a3ff38c
d5d7f86
* Mon Aug 18 2014 David Teigland <teigland@redhat.com> - 3.2.0-1
d5d7f86
- Update to sanlock-3.2.0
d5d7f86
640f0fe
* Wed Jan 29 2014 David Teigland <teigland@redhat.com> - 3.1.0-2
640f0fe
- version interface
349308d
640f0fe
* Tue Jan 07 2014 David Teigland <teigland@redhat.com> - 3.1.0-1
56b00a7
- Update to sanlock-3.1.0
56b00a7
640f0fe
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.0.1-3
640f0fe
- Mass rebuild 2013-12-27
640f0fe
640f0fe
* Thu Aug 01 2013 David Teigland <teigland@redhat.com> - 3.0.1-2
640f0fe
- use /usr/lib instead of /lib
640f0fe
640f0fe
* Wed Jul 31 2013 David Teigland <teigland@redhat.com> - 3.0.1-1
640f0fe
- Update to sanlock-3.0.1
facd973
e380b4f
* Wed Jul 24 2013 David Teigland <teigland@redhat.com> - 3.0.0-1
e380b4f
- Update to sanlock-3.0.0
Angus Salkeld 12dcdb9