2007-01-16 00:25:57 +01:00
|
|
|
#
|
2011-04-05 18:02:12 +02:00
|
|
|
# spec file for package multipath-tools
|
2007-01-16 00:25:57 +01:00
|
|
|
#
|
2017-02-21 11:40:05 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:25:57 +01:00
|
|
|
#
|
2008-08-29 00:55:27 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2008-04-30 00:47:42 +02:00
|
|
|
|
2017-03-20 13:52:30 +01:00
|
|
|
# Workaround for Leap 42.1 bug, bsc#940315
|
|
|
|
%if 0%{?suse_version} == 1315
|
|
|
|
%if 0%{?is_opensuse} == 1
|
|
|
|
%if 0%{?sle_version} == 0
|
|
|
|
%define sle_version 120100
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Whether to build with RADOS support
|
2017-03-21 13:21:19 +01:00
|
|
|
# Default YES on openSUSE factory and leap >= 42.2 and SLES12 >= SP3
|
|
|
|
# (but only on architectures for which ceph is enabled).
|
2017-03-20 13:52:30 +01:00
|
|
|
# Default NO on SLES 12 >= SP2
|
|
|
|
# Always NO on other distros
|
2017-04-28 11:13:05 +02:00
|
|
|
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?suse_version} == 1315
|
|
|
|
%if 0%{?is_opensuse} == 1
|
2017-04-28 11:13:05 +02:00
|
|
|
#### Leap 42.x: Support from 42.2 on, for ceph-supported archs
|
|
|
|
#### (see ExclusiveArch in ceph spec file)
|
|
|
|
%ifarch x86_64 aarch64 ppc64 ppc64le
|
2017-03-21 13:21:19 +01:00
|
|
|
%if 0%{?sle_version} >= 120200
|
|
|
|
%bcond_without rados
|
|
|
|
%endif # 0%{?sle_version} >= 120200
|
2017-04-28 11:13:05 +02:00
|
|
|
%endif # arch
|
2017-03-21 13:21:19 +01:00
|
|
|
%else # 0%{?is_opensuse} == 1
|
2017-04-28 11:13:05 +02:00
|
|
|
#### SLE12: Support from SP3 on, for ceph-supported archs
|
|
|
|
#### (see ExclusiveArch in ceph spec file *on IBS*)
|
2017-03-23 14:37:08 +01:00
|
|
|
%ifarch x86_64 aarch64
|
2017-03-21 13:21:19 +01:00
|
|
|
%if 0%{?sle_version} >= 120300
|
2017-03-20 13:52:30 +01:00
|
|
|
%bcond_without rados
|
2017-03-21 13:21:19 +01:00
|
|
|
%else # 0%{?sle_version} >= 120300
|
2017-04-28 11:13:05 +02:00
|
|
|
#### SLE12 SP2: rados can be enabled here using --with rados
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?sle_version} >= 120200
|
|
|
|
%bcond_with rados
|
2017-03-21 13:21:19 +01:00
|
|
|
%endif # 0%{?sle_version} >= 120200
|
|
|
|
%endif # 0%{?sle_version} >= 120300
|
|
|
|
%endif # arch
|
|
|
|
%endif # 0%{?is_opensuse} == 1
|
|
|
|
%else # 0%{?suse_version} == 1315
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?suse_version} >= 1330
|
2017-04-28 11:13:05 +02:00
|
|
|
#### Factory / Tumbleweed
|
|
|
|
#### (see ExclusiveArch in ceph spec file)
|
2017-03-21 13:21:19 +01:00
|
|
|
%ifarch x86_64 aarch64 ppc64 ppc64le
|
2017-03-20 13:52:30 +01:00
|
|
|
%bcond_without rados
|
2017-03-21 13:21:19 +01:00
|
|
|
%endif # arch
|
|
|
|
%endif # 0%{?suse_version} >= 1330
|
|
|
|
%endif # 0%{?suse_version} == 1315
|
2017-03-20 13:52:30 +01:00
|
|
|
|
|
|
|
# Whether to build libdmmp
|
|
|
|
# Default YES on openSUSE factory and leap
|
|
|
|
# Default NO on SLES 12
|
|
|
|
# Always NO on other distros
|
|
|
|
%if 0%{?suse_version} == 1315
|
|
|
|
%if 0%{?is_opensuse} == 1
|
|
|
|
%bcond_without libdmmp
|
2017-03-21 13:21:19 +01:00
|
|
|
%else # 0%{?is_opensuse} == 1
|
2017-03-20 13:52:30 +01:00
|
|
|
%bcond_with libdmmp
|
2017-03-21 13:21:19 +01:00
|
|
|
%endif # 0%{?is_opensuse} == 1
|
|
|
|
%else # 0%{?is_opensuse} == 1
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?suse_version} >= 1330
|
|
|
|
%bcond_without libdmmp
|
2017-03-21 13:21:19 +01:00
|
|
|
%endif # 0%{?suse_version} >= 1330
|
|
|
|
%endif # 0%{?suse_version} == 1315
|
2017-03-20 13:52:30 +01:00
|
|
|
|
|
|
|
# This should match the version in libdmmp/Makefile
|
|
|
|
%define _libdmmp_version 0.1.0
|
|
|
|
%define libdmmp_version %(echo %{_libdmmp_version} | tr . _)
|
2016-06-14 14:45:24 +02:00
|
|
|
|
2017-03-24 16:23:05 +01:00
|
|
|
# path prefix for systemd unit files and udev rules
|
|
|
|
%define _sysdir usr/lib
|
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
Name: multipath-tools
|
2017-03-24 16:23:05 +01:00
|
|
|
Url: http://christophe.varoqui.free.fr/
|
2017-10-26 23:24:34 +02:00
|
|
|
Version: 0.7.3+13+suse.db431514
|
2017-03-24 16:23:05 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Tools to Manage Multipathed Devices with the device-mapper
|
|
|
|
License: GPL-2.0
|
|
|
|
Group: System/Base
|
|
|
|
Source: multipath-tools-%{version}.tar.xz
|
|
|
|
Source1: multipath.conf
|
2017-09-03 01:30:12 +02:00
|
|
|
# SUSE policy: disable partition deletion by default
|
|
|
|
Source2: dont-del-part-nodes.rules
|
|
|
|
# Dracut conf file to make sure 11-dm-parts.rules is included in initrd
|
|
|
|
Source3: dm-parts.conf
|
2017-03-24 16:23:05 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%{?systemd_requires}
|
2012-04-20 10:35:35 +02:00
|
|
|
BuildRequires: device-mapper-devel
|
|
|
|
BuildRequires: libaio-devel
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?with_rados} == 1
|
|
|
|
BuildRequires: librados-devel
|
|
|
|
%endif
|
|
|
|
%if 0%{?with_libdmmp} == 1
|
|
|
|
BuildRequires: libjson-c-devel
|
|
|
|
%endif
|
2013-02-01 11:10:56 +01:00
|
|
|
BuildRequires: libudev-devel
|
2016-07-04 10:20:41 +02:00
|
|
|
BuildRequires: liburcu-devel
|
2012-04-20 10:35:35 +02:00
|
|
|
BuildRequires: readline-devel
|
2014-03-03 10:00:19 +01:00
|
|
|
BuildRequires: udev
|
2016-06-14 14:45:24 +02:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
2017-09-03 01:30:12 +02:00
|
|
|
# dracut owns dracut.conf.d
|
|
|
|
BuildRequires: dracut
|
2014-03-27 15:52:32 +01:00
|
|
|
Requires: device-mapper >= 1.2.78
|
2012-04-20 10:35:35 +02:00
|
|
|
Requires: kpartx
|
2017-03-20 13:52:30 +01:00
|
|
|
Requires: sg3_utils
|
2017-09-21 14:58:04 +02:00
|
|
|
Recommends: multipath-tools-rbd = %{version}
|
2017-02-21 11:40:05 +01:00
|
|
|
PreReq: coreutils grep
|
2007-01-16 00:25:57 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
This package provides the tools to manage multipathed devices by
|
|
|
|
instructing the device-mapper multipath module what to do. The tools
|
|
|
|
are:
|
|
|
|
|
|
|
|
- multipath: scans the system for multipathed devices, assembles
|
|
|
|
them, and updates the device-mapper's maps
|
|
|
|
|
|
|
|
- multipathd: waits for maps events then execs multipath
|
|
|
|
|
|
|
|
- devmap-name: provides a meaningful device name to udev for devmaps
|
|
|
|
|
|
|
|
- kpartx: maps linear devmaps to device partitions, which makes
|
|
|
|
multipath maps partionable
|
|
|
|
|
2007-05-21 18:10:25 +02:00
|
|
|
%package -n kpartx
|
|
|
|
Summary: Manages partition tables on device-mapper devices
|
|
|
|
Group: System/Base
|
2007-08-02 22:50:38 +02:00
|
|
|
Requires: device-mapper
|
2007-05-21 18:10:25 +02:00
|
|
|
|
|
|
|
%description -n kpartx
|
|
|
|
The kpartx program maps linear devmaps to device partitions, which
|
|
|
|
makes multipath maps partionable.
|
|
|
|
|
2013-02-01 11:10:56 +01:00
|
|
|
%package devel
|
|
|
|
Summary: Development libraries for multipath-tools
|
2017-03-24 16:23:05 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2013-02-01 11:10:56 +01:00
|
|
|
Requires: device-mapper
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains the development libraries for multipath-tools
|
|
|
|
and libmpath_persist.
|
|
|
|
|
2017-09-21 14:58:04 +02:00
|
|
|
%if 0%{?with_rados} == 1
|
|
|
|
%package rbd
|
|
|
|
Summary: RADOS support for multipath-tools
|
|
|
|
Group: System/Libraries
|
|
|
|
Requires: multipath-tools = %{version}
|
|
|
|
|
|
|
|
%description rbd
|
|
|
|
This package contains the path checker for RADOS block devices
|
|
|
|
(provided by the Ceph distributed storage system) for multipath-tools.
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?with_libdmmp} == 1
|
|
|
|
%package -n libdmmp%{libdmmp_version}
|
|
|
|
Summary: C API for multipath-tools
|
|
|
|
Group: System/Libraries
|
|
|
|
Requires: multipath-tools
|
|
|
|
|
|
|
|
%description -n libdmmp%{libdmmp_version}
|
|
|
|
This library enables the use of libmultipath commands from C code.
|
|
|
|
|
|
|
|
%package -n libdmmp-devel
|
|
|
|
Summary: Header files for multipath-tools C API
|
2017-03-24 16:23:05 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2017-03-20 13:52:30 +01:00
|
|
|
Requires: libdmmp%{libdmmp_version}
|
|
|
|
|
|
|
|
%description -n libdmmp-devel
|
|
|
|
This package provides development files and documentation for libdmmp.
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%define makeflags %{!?with_rados:ENABLE_RADOS=0} %{!?with_libdmmp:ENABLE_LIBDMMP=0}
|
2017-06-14 12:17:22 +02:00
|
|
|
%define dirflags LIB=%{_lib} usr_prefix=%{_prefix} SYSTEMDPATH=%{_sysdir}
|
2017-03-20 13:52:30 +01:00
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
%prep
|
2014-01-29 11:09:28 +01:00
|
|
|
%setup -q -n multipath-tools-%{version}
|
2013-02-01 11:10:56 +01:00
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
%build
|
2017-06-20 11:04:28 +02:00
|
|
|
[ -n "$SOURCE_DATE_EPOCH" ] && export KBUILD_BUILD_TIMESTAMP=@$SOURCE_DATE_EPOCH
|
2017-06-14 12:17:22 +02:00
|
|
|
make CC="%__cc" OPTFLAGS="%{optflags}" %{dirflags} %{makeflags}
|
2007-01-16 00:25:57 +01:00
|
|
|
|
|
|
|
%install
|
2017-06-14 12:17:22 +02:00
|
|
|
make DESTDIR=%{buildroot} %{dirflags} %{makeflags} install
|
2017-03-24 16:23:05 +01:00
|
|
|
mkdir -p %{buildroot}/var/cache/multipath/
|
|
|
|
rm %{buildroot}/%_lib/*.so
|
2017-06-14 12:17:22 +02:00
|
|
|
%if 0%{?with_libdmmp} == 1
|
|
|
|
rm %{buildroot}/%_libdir/*.so
|
|
|
|
%endif
|
2017-03-24 16:23:05 +01:00
|
|
|
mkdir -p %{buildroot}/usr/sbin
|
|
|
|
ln -sf /usr/sbin/service %{buildroot}/usr/sbin/rcmultipathd
|
|
|
|
mkdir -p %{buildroot}/usr/lib/modules-load.d
|
|
|
|
install -m 644 -D %{SOURCE1} "%{buildroot}/usr/lib/modules-load.d/multipath.conf"
|
2017-09-03 01:30:12 +02:00
|
|
|
install -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir}/00-dont-del-part-nodes.rules
|
|
|
|
install -m 644 -D %{SOURCE3} %{buildroot}/usr/lib/dracut/dracut.conf.d/dm-parts.conf
|
2007-01-16 00:25:57 +01:00
|
|
|
|
2010-07-06 16:27:45 +02:00
|
|
|
%pre
|
|
|
|
[ -f /.buildenv ] && exit 0
|
|
|
|
if [ -f /etc/init.d/multipathd ] && dmsetup --target multipath table | grep -q multipath ; then
|
2013-02-01 11:10:56 +01:00
|
|
|
/etc/init.d/multipathd stop
|
2015-04-22 15:52:56 +02:00
|
|
|
%service_add_pre multipathd.socket
|
2013-02-01 11:10:56 +01:00
|
|
|
%service_add_pre multipathd.service
|
2010-07-06 16:27:45 +02:00
|
|
|
fi
|
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
%post
|
2010-07-06 16:27:45 +02:00
|
|
|
[ -f /.buildenv ] && exit 0
|
2013-02-01 11:10:56 +01:00
|
|
|
%{run_ldconfig}
|
2010-07-06 16:27:45 +02:00
|
|
|
if dmsetup --target multipath table | grep -q multipath ; then
|
2015-04-22 15:52:56 +02:00
|
|
|
%service_add_post multipathd.socket
|
2013-02-01 11:10:56 +01:00
|
|
|
%service_add_post multipathd.service
|
2010-07-06 16:27:45 +02:00
|
|
|
fi
|
2014-09-04 10:41:18 +02:00
|
|
|
%{?regenerate_initrd_post}
|
2008-09-06 00:44:23 +02:00
|
|
|
exit 0
|
2012-04-20 10:35:35 +02:00
|
|
|
|
2007-08-02 22:50:38 +02:00
|
|
|
%preun
|
2012-11-04 03:57:33 +01:00
|
|
|
%service_del_preun multipathd.service
|
2015-04-22 15:52:56 +02:00
|
|
|
%service_del_preun multipathd.socket
|
2007-08-02 22:50:38 +02:00
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
%postun
|
2014-09-18 11:03:03 +02:00
|
|
|
%{?regenerate_initrd_post}
|
2012-11-04 03:57:33 +01:00
|
|
|
%service_del_postun multipathd.service
|
2015-04-22 15:52:56 +02:00
|
|
|
%service_del_postun multipathd.socket
|
2013-02-01 11:10:56 +01:00
|
|
|
%{run_ldconfig}
|
2007-01-16 00:25:57 +01:00
|
|
|
|
2014-09-18 11:03:03 +02:00
|
|
|
%posttrans
|
|
|
|
%{?regenerate_initrd_posttrans}
|
|
|
|
|
2007-01-16 00:25:57 +01:00
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2017-03-20 13:52:30 +01:00
|
|
|
%doc COPYING README
|
2014-03-17 14:42:12 +01:00
|
|
|
%{_udevrulesdir}/11-dm-mpath.rules
|
2014-04-12 23:32:45 +02:00
|
|
|
%{_udevrulesdir}/56-multipath.rules
|
2010-07-06 16:27:45 +02:00
|
|
|
/%{_lib}/libmultipath.so.0
|
2016-06-07 10:03:45 +02:00
|
|
|
/%{_lib}/libmpathcmd.so.0
|
2012-05-30 17:00:14 +02:00
|
|
|
/%{_lib}/libmpathpersist.so.0
|
2009-08-22 03:49:00 +02:00
|
|
|
/%{_lib}/multipath
|
2017-09-21 14:58:04 +02:00
|
|
|
%exclude /%{_lib}/multipath/libcheckrbd.so
|
2007-01-16 00:25:57 +01:00
|
|
|
/sbin/multipath
|
|
|
|
/sbin/multipathd
|
2012-05-30 17:00:14 +02:00
|
|
|
/sbin/mpathpersist
|
2014-09-18 11:03:03 +02:00
|
|
|
/usr/sbin/rcmultipathd
|
2007-01-16 00:25:57 +01:00
|
|
|
%attr (0700, root, root) /var/cache/multipath
|
2013-02-15 13:31:32 +01:00
|
|
|
%dir /%{_sysdir}/systemd/system
|
|
|
|
/%{_sysdir}/systemd/system/multipathd.service
|
2014-01-29 11:09:28 +01:00
|
|
|
/%{_sysdir}/systemd/system/multipathd.socket
|
2016-09-01 13:57:30 +02:00
|
|
|
%dir /usr/lib/modules-load.d
|
|
|
|
/usr/lib/modules-load.d/multipath.conf
|
2007-01-16 00:25:57 +01:00
|
|
|
%{_mandir}/man8/multipath.8*
|
2007-05-17 11:47:22 +02:00
|
|
|
%{_mandir}/man5/multipath.conf.5*
|
2007-01-16 00:25:57 +01:00
|
|
|
%{_mandir}/man8/multipathd.8*
|
2012-05-30 17:33:50 +02:00
|
|
|
%{_mandir}/man8/mpathpersist.8*
|
2013-02-01 11:10:56 +01:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
2016-06-07 10:03:45 +02:00
|
|
|
/usr/include/mpath_cmd.h
|
2013-02-01 11:10:56 +01:00
|
|
|
/usr/include/mpath_persist.h
|
2012-05-30 17:33:50 +02:00
|
|
|
%{_mandir}/man3/mpath_persistent_*
|
2007-01-16 00:25:57 +01:00
|
|
|
|
2007-05-21 18:10:25 +02:00
|
|
|
%files -n kpartx
|
|
|
|
%defattr(-,root,root)
|
|
|
|
/sbin/kpartx
|
2017-09-03 01:30:12 +02:00
|
|
|
%{_udevrulesdir}/00-dont-del-part-nodes.rules
|
|
|
|
%{_udevrulesdir}/11-dm-parts.rules
|
2014-03-03 10:00:19 +01:00
|
|
|
%{_udevrulesdir}/66-kpartx.rules
|
2017-09-03 01:30:12 +02:00
|
|
|
%{_udevrulesdir}/68-del-part-nodes.rules
|
2013-02-15 13:31:32 +01:00
|
|
|
/%{_sysdir}/udev/kpartx_id
|
2017-09-03 01:30:12 +02:00
|
|
|
/%{_sysdir}/dracut/dracut.conf.d/dm-parts.conf
|
2007-05-21 18:10:25 +02:00
|
|
|
%{_mandir}/man8/kpartx.8*
|
2008-04-30 00:47:42 +02:00
|
|
|
|
2017-09-03 01:30:12 +02:00
|
|
|
%posttrans -n kpartx
|
|
|
|
# The kpartx package contains udev rules that may need to be in initrd.
|
|
|
|
%{?regenerate_initrd_posttrans}
|
|
|
|
|
2017-09-21 14:58:04 +02:00
|
|
|
%if 0%{?with_rados} == 1
|
|
|
|
%files rbd
|
|
|
|
/%{_lib}/multipath/libcheckrbd.so
|
|
|
|
%endif
|
|
|
|
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?with_libdmmp} == 1
|
|
|
|
|
|
|
|
%post -n libdmmp%{libdmmp_version}
|
|
|
|
%{run_ldconfig}
|
|
|
|
|
|
|
|
%postun -n libdmmp%{libdmmp_version}
|
|
|
|
%{run_ldconfig}
|
|
|
|
|
|
|
|
%files -n libdmmp%{libdmmp_version}
|
|
|
|
%defattr(-,root,root)
|
2017-04-28 11:13:05 +02:00
|
|
|
/%{_libdir}/libdmmp.so.%{_libdmmp_version}
|
2017-03-20 13:52:30 +01:00
|
|
|
|
|
|
|
%files -n libdmmp-devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_mandir}/man3/libdmmp.h*
|
|
|
|
%{_mandir}/man3/dmmp_*
|
|
|
|
%{_includedir}/libdmmp
|
2017-04-28 11:13:05 +02:00
|
|
|
%{_libdir}/pkgconfig/libdmmp.pc
|
2017-03-20 13:52:30 +01:00
|
|
|
|
|
|
|
%endif # with_libdmmp
|
|
|
|
|
2007-05-17 11:47:22 +02:00
|
|
|
%changelog
|