sanlock/sanlock.spec

164 lines
5.2 KiB
RPMSpec
Raw Normal View History

2019-12-04 18:23:11 +08:00
Name: sanlock
2021-01-28 15:56:35 +08:00
Version: 3.8.2
Release: 1
2019-12-04 18:23:11 +08:00
Summary: A shared storage lock manager
License: GPLv2 and GPLv2+ and LGPLv2+
URL: https://pagure.io/sanlock/
Source0: https://releases.pagure.org/sanlock/%{name}-%{version}.tar.gz
2020-10-30 14:44:26 +08:00
BuildRequires: libblkid-devel libaio-devel python3 python3-devel systemd-units
2019-12-04 18:23:11 +08:00
Requires(pre): shadow
Requires(post): systemd-units systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
Provides: sanlock-lib = %{version}-%{release}
Obsoletes: sanlock-lib < %{version}-%{release}
%description
The sanlock daemon manages leases for applications running on a cluster of hosts
with shared storage. All lease management and coordination is done through reading
and writing blocks on the shared storage.
%package devel
Summary: libraries and header files for sanlock
Requires: %{name} = %{version}-%{release}
%description devel
The sanklock-devel package contains libraries and header files
for developing applications that use sanlock.
%package help
Summary: maninfo for sanlock
Requires: %{name} = %{version}-%{release}
%description help
The sanklock-help package contains maninfo for sanlock.
2020-10-30 14:44:26 +08:00
%package -n python3-sanlock
%{?python_provide:%python_provide python3-sanlock}
Summary: Python bindings for the sanlock library
Requires: %{name} = %{version}-%{release}
%description -n python3-sanlock
The python3-sanlock package contains a module that
2019-12-04 18:23:11 +08:00
permits applications written in the Python programming language
to use the interface supplied by the sanlock library.
%package -n sanlk-reset
Summary: Host reset daemon and client using sanlock
Requires: sanlock = %{version}-%{release}
%description -n sanlk-reset
The sanlk-reset package contains the reset daemon and client.
A cooperating host running the daemon can be reset by a host
running the client, so long as both maintain access to a
common sanlock lockspace.
%prep
%autosetup -n %{name}-%{version} -p1
%build
%set_build_flags
CFLAGS=$RPM_OPT_FLAGS make -C wdmd
CFLAGS=$RPM_OPT_FLAGS make -C src
2020-10-30 14:44:26 +08:00
CFLAGS=$RPM_OPT_FLAGS make -C python PY_VERSION=3
2019-12-04 18:23:11 +08:00
CFLAGS=$RPM_OPT_FLAGS make -C reset
%install
make -C src install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
make -C wdmd install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
2020-10-30 14:44:26 +08:00
make -C python install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT PY_VERSION=3
2019-12-04 18:23:11 +08:00
make -C reset install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
install -D -m 0644 init.d/sanlock.service.native $RPM_BUILD_ROOT/%{_unitdir}/sanlock.service
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
install -D -m 0644 src/sanlock.conf $RPM_BUILD_ROOT/etc/sanlock/sanlock.conf
install -D -m 0644 init.d/wdmd.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/wdmd
install -Dd -m 0755 $RPM_BUILD_ROOT/etc/wdmd.d
install -Dd -m 0775 $RPM_BUILD_ROOT/%{_localstatedir}/run/sanlock
install -Dd -m 0775 $RPM_BUILD_ROOT/%{_localstatedir}/run/sanlk-resetd
%pre
getent group sanlock > /dev/null || /usr/sbin/groupadd -g 179 sanlock
getent passwd sanlock > /dev/null || /usr/sbin/useradd \
-u 179 -c "sanlock" -s /sbin/nologin -r \
-g 179 -d /var/run/sanlock sanlock
/usr/sbin/usermod -a -G disk sanlock
%post
%systemd_post wdmd.service sanlock.service
/sbin/ldconfig
%preun
%systemd_preun wdmd.service sanlock.service
%postun
%systemd_postun wdmd.service sanlock.service
/sbin/ldconfig
%files
%defattr(-,root,root,-)
/usr/lib/systemd/systemd-wdmd
%{_unitdir}/sanlock.service
%{_unitdir}/wdmd.service
%{_sbindir}/sanlock
%{_sbindir}/wdmd
%dir %{_sysconfdir}/wdmd.d
%dir %{_sysconfdir}/sanlock
%dir %attr(-,sanlock,sanlock) %{_localstatedir}/run/sanlock
%config(noreplace) %{_sysconfdir}/logrotate.d/sanlock
%config(noreplace) %{_sysconfdir}/sanlock/sanlock.conf
%config(noreplace) %{_sysconfdir}/sysconfig/wdmd
%doc init.d/sanlock
%doc init.d/sanlock.service
%doc init.d/wdmd.service
%{_libdir}/libsanlock*.so.*
%{_libdir}/libwdmd.so.*
%files help
%defattr(-,root,root,-)
%{_mandir}/man8/wdmd*
%{_mandir}/man8/sanlock*
%{_mandir}/man8/sanlk-reset*
%files devel
%defattr(-,root,root,-)
%{_libdir}/libwdmd.so
%{_includedir}/wdmd.h
%{_libdir}/libsanlock*.so
%{_includedir}/sanlock*.h
%{_libdir}/pkgconfig/libsanlock*.pc
2020-10-30 14:44:26 +08:00
%files -n python3-sanlock
2019-12-04 18:23:11 +08:00
%defattr(-,root,root,-)
2020-10-30 14:44:26 +08:00
%{python3_sitearch}/sanlock_python-*.egg-info
%{python3_sitearch}/sanlock*.so
2019-12-04 18:23:11 +08:00
%files -n sanlk-reset
%defattr(-,root,root,-)
%{_sbindir}/sanlk-reset*
%{_unitdir}/sanlk-resetd.service
%dir %attr(-,root,root) %{_localstatedir}/run/sanlk-resetd
%changelog
2021-01-28 15:56:35 +08:00
* Thu Jan 14 2020 yanglongkang <yanglongkang@huawei.com> - 3.8.2-1
- update package to 3.8.2
2020-10-30 14:44:26 +08:00
* Fri Oct 30 2020 yanglongkang <yanglongkang@huawei.com> - 3.8.1-2
- remove python2 dependency
2020-07-16 19:30:15 +08:00
* Thu Jul 16 2020 yanglongkang <yanglongkang@huawei.com> - 3.8.1-1
- update package to 3.8.1
2019-12-04 18:23:11 +08:00
* Sat Nov 30 2019 zoushuangshuang<zoushuangshuang@huawei.com> - 3.6.0-7
- Package init