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
|
|
|
#
|
2018-01-19 19:21:03 +01:00
|
|
|
# Copyright (c) 2018 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.
|
|
|
|
|
2018-10-03 15:02:51 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:25:57 +01:00
|
|
|
#
|
|
|
|
|
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 libdmmp
|
2017-11-03 12:46:13 +01:00
|
|
|
# Default YES on openSUSE factory, SLE15, and leap
|
2017-03-20 13:52:30 +01:00
|
|
|
# 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
|
2018-07-02 10:57:41 +02:00
|
|
|
%define _libdmmp_version 0.2.0
|
2017-03-20 13:52:30 +01:00
|
|
|
%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/
|
2019-01-09 15:59:42 +01:00
|
|
|
Version: 0.7.9+111+suse.b4232b7
|
2017-03-24 16:23:05 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Tools to Manage Multipathed Devices with the device-mapper
|
2018-04-10 23:55:43 +02:00
|
|
|
License: GPL-2.0-only AND LGPL-2.0-or-later
|
2017-03-24 16:23:05 +01:00
|
|
|
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-11-06 16:16:39 +01:00
|
|
|
Source4: libmpathpersist-example.c
|
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_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)
|
2019-01-11 21:46:11 +01:00
|
|
|
# For regenerate_initrd_posttrans macro
|
|
|
|
BuildRequires: suse-module-tools
|
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
|
2018-07-17 11:32:40 +02:00
|
|
|
Obsoletes: 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
|
2018-04-10 10:32:36 +02:00
|
|
|
License: GPL-2.0-only
|
2007-05-21 18:10:25 +02:00
|
|
|
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
|
2018-04-10 23:55:43 +02:00
|
|
|
License: GPL-2.0-only AND LGPL-2.0-or-later
|
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
|
2018-04-10 23:55:43 +02:00
|
|
|
Requires: multipath-tools = %{version}
|
2013-02-01 11:10:56 +01:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains the development libraries for multipath-tools
|
|
|
|
and libmpath_persist.
|
|
|
|
|
2017-03-20 13:52:30 +01:00
|
|
|
%if 0%{?with_libdmmp} == 1
|
|
|
|
%package -n libdmmp%{libdmmp_version}
|
|
|
|
Summary: C API for multipath-tools
|
2018-04-05 12:06:45 +02:00
|
|
|
License: GPL-3.0-or-later
|
2017-03-20 13:52:30 +01:00
|
|
|
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
|
2018-04-05 12:06:45 +02:00
|
|
|
License: GPL-3.0-or-later
|
2017-03-24 16:23:05 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2018-04-10 23:55:43 +02:00
|
|
|
Requires: libdmmp%{libdmmp_version} = %{version}
|
2017-03-20 13:52:30 +01:00
|
|
|
|
|
|
|
%description -n libdmmp-devel
|
|
|
|
This package provides development files and documentation for libdmmp.
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2018-07-02 10:57:41 +02:00
|
|
|
%define makeflags %{!?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}
|
2017-11-06 16:16:39 +01:00
|
|
|
cp %{SOURCE4} .
|
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/
|
2018-04-10 23:55:43 +02:00
|
|
|
mkdir -p %{buildroot}%{_defaultlicensedir}
|
2017-03-24 16:23:05 +01:00
|
|
|
mkdir -p %{buildroot}/usr/sbin
|
2018-04-10 23:55:43 +02:00
|
|
|
mkdir -p %{buildroot}/usr/%{_lib}
|
|
|
|
for x in multipath mpathpersist mpathcmd; do
|
|
|
|
rm -f %{buildroot}/%{_lib}/lib$x.so
|
|
|
|
ln -sf /%{_lib}/lib$x.so.0 %{buildroot}/usr/%{_lib}/lib$x.so
|
|
|
|
done
|
2017-03-24 16:23:05 +01:00
|
|
|
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)
|
2018-04-10 10:32:36 +02:00
|
|
|
%doc README
|
2018-04-10 23:55:43 +02:00
|
|
|
%dir %{_defaultlicensedir}
|
2018-04-10 10:32:36 +02:00
|
|
|
%license LICENSES/LGPL-2.0
|
|
|
|
%license LICENSES/LGPL-2.1
|
|
|
|
%license LICENSES/GPL-2.0
|
|
|
|
%license README.licenses
|
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
|
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
|
2018-12-12 14:23:16 +01:00
|
|
|
%dir /usr/lib/dracut
|
|
|
|
%dir /usr/lib/dracut/dracut.conf.d
|
|
|
|
|
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)
|
2018-04-10 23:55:43 +02:00
|
|
|
/usr/%{_lib}/libmultipath.so
|
|
|
|
/usr/%{_lib}/libmpathcmd.so
|
|
|
|
/usr/%{_lib}/libmpathpersist.so
|
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_*
|
2017-11-06 16:16:39 +01:00
|
|
|
%doc libmpathpersist-example.c
|
2007-01-16 00:25:57 +01:00
|
|
|
|
2007-05-21 18:10:25 +02:00
|
|
|
%files -n kpartx
|
|
|
|
%defattr(-,root,root)
|
2018-04-10 10:32:36 +02:00
|
|
|
%license LICENSES/GPL-2.0
|
2007-05-21 18:10:25 +02:00
|
|
|
/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-11-03 12:46:13 +01:00
|
|
|
# SLE12-SP1 and earlier: dracut does not own /usr/lib/dracut/dracut.conf.d
|
|
|
|
%if 0%{?sle_version}
|
|
|
|
%if 0%{?sle_version} <= 120100
|
|
|
|
%dir /%{_sysdir}/dracut/dracut.conf.d
|
|
|
|
%endif # 0%{?sle_version} <= 120100
|
|
|
|
%endif # 0%{?sle_version}
|
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-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)
|
2018-04-10 10:32:36 +02:00
|
|
|
%license LICENSES/GPL-3.0
|
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)
|
2017-11-03 12:46:13 +01:00
|
|
|
/%{_libdir}/libdmmp.so
|
2017-03-20 13:52:30 +01:00
|
|
|
%{_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
|