|
@@ -1,9 +1,15 @@
|
|
|
+%bcond_with systemd
|
|
|
+
|
|
|
Summary: Tools to manage multipath devices using device-mapper
|
|
|
Summary(ja): Device-mapper を使用してマルチパスデバイスを管理するためのツール集
|
|
|
Name: device-mapper-multipath
|
|
|
Version: 0.8.2
|
|
|
-Release: 1%{?_dist_release}
|
|
|
+Release: 2%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
Group: System Environment/Base
|
|
|
+Vendor: Project Vine
|
|
|
+Distribution: Vine Linux
|
|
|
+Packager: daisuke
|
|
|
+
|
|
|
License: GPLv2+
|
|
|
URL: http://christophe.varoqui.free.fr/
|
|
|
# The source for this package was pulled from upstream's git repo. Use the
|
|
@@ -46,22 +52,23 @@ Patch0030: 0030-RH-attempt-to-get-ANA-info-via-sysfs-first.patch
|
|
|
Patch0031: 0031-multipath-fix-issues-found-by-compiling-with-gcc-10.patch
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
-Requires(post): chkconfig
|
|
|
-Requires(preun): chkconfig
|
|
|
-Requires: kpartx = %{version}-%{release}
|
|
|
-Requires: device-mapper >= 1.02.39
|
|
|
BuildRequires: libsysfs-devel
|
|
|
BuildRequires: device-mapper-devel
|
|
|
#BuildRequires: libselinux-devel, libsepol-devel
|
|
|
BuildRequires: readline-devel, ncurses-devel
|
|
|
BuildRequires: libaio-devel
|
|
|
BuildRequires: userspace-rcu-devel
|
|
|
-BuildRequires: libudev-devel
|
|
|
BuildRequires: json-c-devel
|
|
|
-
|
|
|
-Vendor: Project Vine
|
|
|
-Distribution: Vine Linux
|
|
|
-Packager: daisuke
|
|
|
+Requires: kpartx = %{version}-%{release}
|
|
|
+Requires: device-mapper >= 1.02.39
|
|
|
+%if %{with systemd}
|
|
|
+BuildRequires: systemd-devel
|
|
|
+%{?systemd_requires}
|
|
|
+%else
|
|
|
+BuildRequires: libudev-devel
|
|
|
+Requires(post): chkconfig
|
|
|
+Requires(preun): chkconfig
|
|
|
+%endif
|
|
|
|
|
|
%description
|
|
|
%{name} provides tools to manage multipath devices by instructing the
|
|
@@ -128,6 +135,8 @@ device-mapper-multipath's libdmmp C API library
|
|
|
%setup -q -n multipath-tools-0.8.2
|
|
|
%autopatch -p1
|
|
|
|
|
|
+sed -i -e 's/ != TRUE/ == 0/g' libdmmp/libdmmp_private.h
|
|
|
+
|
|
|
|
|
|
%build
|
|
|
make %{?_smp_mflags} LIB=%{_lib} SYSTEMDPATH=/lib
|
|
@@ -149,16 +158,21 @@ make install \
|
|
|
install -d %{buildroot}/etc/multipath
|
|
|
install -m644 %{SOURCE1} %{buildroot}/etc/multipath.conf
|
|
|
|
|
|
+%if !%{with systemd}
|
|
|
install -d %{buildroot}%{_initdir}
|
|
|
install -m755 %{SOURCE2} %{buildroot}%{_initdir}/multipathd
|
|
|
-
|
|
|
+%endif
|
|
|
|
|
|
%clean
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
|
%post
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_post multipathd.service
|
|
|
+%else
|
|
|
/sbin/chkconfig --add multipathd
|
|
|
+%endif
|
|
|
if [ "$1" -gt "1" -a ! -e /etc/multipath/bindings -a \
|
|
|
-f /var/lib/multipath/bindings ]; then
|
|
|
mv /var/lib/multipath/bindings /etc/multipath/bindings
|
|
@@ -166,16 +180,27 @@ if [ "$1" -gt "1" -a ! -e /etc/multipath/bindings -a \
|
|
|
fi
|
|
|
|
|
|
%preun
|
|
|
-if [ "$1" = 0 ]; then
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_preun multipathd.service
|
|
|
+%else
|
|
|
+if [ "$1" = 0 -o -x /bin/systemctl ]; then
|
|
|
/sbin/service multipathd stop /dev/null 2>&1
|
|
|
/sbin/chkconfig --del multipathd
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
|
|
|
%postun
|
|
|
+if [ $1 -ge 1 ] ; then
|
|
|
+ /sbin/multipathd forcequeueing daemon > /dev/null 2>&1 || :
|
|
|
+fi
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_postun_with_restart multipathd.service
|
|
|
+%else
|
|
|
if [ "$1" -ge "1" ]; then
|
|
|
/sbin/service multipathd condrestart >/dev/null 2>&1 || :
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
%post libs -p /sbin/ldconfig
|
|
|
%postun libs -p /sbin/ldconfig
|
|
@@ -199,9 +224,14 @@ fi
|
|
|
%{_mandir}/man8/multipathd.8.gz
|
|
|
%{_mandir}/man8/mpathconf.8.gz
|
|
|
%{_mandir}/man8/mpathpersist.8.gz
|
|
|
-%config /etc/rc.d/init.d/multipathd
|
|
|
%config(noreplace) /etc/multipath.conf
|
|
|
%dir /etc/multipath
|
|
|
+%if %{with systemd}
|
|
|
+%{_unitdir}/multipathd.service
|
|
|
+%{_unitdir}/multipathd.socket
|
|
|
+%else
|
|
|
+%config /etc/rc.d/init.d/multipathd
|
|
|
+%endif
|
|
|
|
|
|
%files libs
|
|
|
%license LICENSES/GPL-2.0 LICENSES/LGPL-2.0
|
|
@@ -249,6 +279,10 @@ fi
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
+* Sat May 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.8.2-2
|
|
|
+- rebuilt with json-c-0.14.
|
|
|
+- added systemd support (disabled as default).
|
|
|
+
|
|
|
* Sat Mar 28 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.8.2-1
|
|
|
- new upstream release.
|
|
|
- replaced all patches with rawhide's.
|