2016-05-11 05:42:15 +02:00
|
|
|
#
|
|
|
|
# spec file for package device-mapper
|
|
|
|
#
|
2018-01-11 03:12:30 +01:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2016-05-11 05:42:15 +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.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2017-04-10 12:40:22 +02:00
|
|
|
%define libname libdevmapper1_03
|
|
|
|
%define libname_event libdevmapper-event1_03
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-DEF-BEGIN ###
|
2017-12-19 11:40:00 +01:00
|
|
|
%define lvm2_version 2.02.177
|
|
|
|
%define device_mapper_version 1.02.146
|
2017-07-04 14:31:34 +02:00
|
|
|
%define thin_provisioning_version 0.7.0
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-DEF-END ###
|
|
|
|
Name: device-mapper
|
|
|
|
Version: %{device_mapper_version}
|
|
|
|
Release: 0
|
|
|
|
Summary: Device Mapper Tools
|
2016-09-14 11:43:37 +02:00
|
|
|
License: GPL-2.0+ and LGPL-2.1+
|
2016-05-11 05:42:15 +02:00
|
|
|
Group: System/Base
|
|
|
|
Url: http://www.sourceware.org/lvm2/
|
|
|
|
Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz
|
|
|
|
Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc
|
|
|
|
Source99: baselibs.conf
|
2017-04-10 12:40:22 +02:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: suse-module-tools
|
|
|
|
BuildRequires: thin-provisioning-tools >= %{thin_provisioning_version}
|
|
|
|
BuildRequires: pkgconfig(libselinux)
|
|
|
|
BuildRequires: pkgconfig(libsepol)
|
|
|
|
BuildRequires: pkgconfig(libudev)
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
Requires: thin-provisioning-tools >= %{thin_provisioning_version}
|
|
|
|
Requires(post): coreutils
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%{?systemd_requires}
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-PATCH-BEGIN ###
|
2017-03-01 03:49:19 +01:00
|
|
|
# Upstream patches
|
2018-01-11 03:12:30 +01:00
|
|
|
Patch0001: fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
|
2017-06-17 17:47:00 +02:00
|
|
|
|
|
|
|
# SUSE patches: 1000+ for LVM
|
2016-05-11 05:42:15 +02:00
|
|
|
# Never upstream
|
2017-05-04 04:45:40 +02:00
|
|
|
Patch1001: cmirrord_remove_date_time_from_compilation.patch
|
2017-10-23 13:56:11 +02:00
|
|
|
Patch1002: fate-309425_display-dm-name-for-lv-name.patch
|
|
|
|
Patch1003: fate-31841_fsadm-add-support-for-btrfs.patch
|
|
|
|
Patch1004: bug-935623_dmeventd-fix-dso-name-wrong-compare.patch
|
2018-02-12 11:13:53 +01:00
|
|
|
Patch1005: bsc1080299-detect-clvm-properly.patch
|
2017-06-17 17:47:00 +02:00
|
|
|
|
|
|
|
#SUSE patches 2000+ for device mapper, udev rules
|
2017-11-24 12:13:44 +01:00
|
|
|
Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-PATCH-END ###
|
2017-03-01 03:49:19 +01:00
|
|
|
|
2016-05-11 05:42:15 +02:00
|
|
|
%description
|
|
|
|
Programs and man pages for configuring and using the device mapper.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n LVM2.%{lvm2_version}
|
|
|
|
### COMMON-PREP-BEGIN ###
|
|
|
|
%patch1001 -p1
|
2018-01-11 03:12:30 +01:00
|
|
|
%patch0001 -p1
|
2016-05-11 05:42:15 +02:00
|
|
|
%patch1002 -p1
|
2017-05-04 04:45:40 +02:00
|
|
|
%patch1003 -p1
|
2016-05-11 05:42:15 +02:00
|
|
|
%patch1004 -p1
|
2018-02-12 11:13:53 +01:00
|
|
|
%patch1005 -p1
|
2017-11-24 12:13:44 +01:00
|
|
|
%patch2001 -p1
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-PREP-END ###
|
|
|
|
|
|
|
|
%build
|
|
|
|
extra_opts=""
|
2017-03-01 03:49:19 +01:00
|
|
|
|
2016-05-11 05:42:15 +02:00
|
|
|
### COMMON-CONFIG-BEGIN ###
|
|
|
|
export PATH=$PATH:/sbin:%{_prefix}/sbin
|
2017-10-23 13:56:11 +02:00
|
|
|
# Why this messy fix here? someone released a wrong version...
|
2017-12-19 11:40:00 +01:00
|
|
|
sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM
|
2016-05-11 05:42:15 +02:00
|
|
|
%configure \
|
2017-04-10 12:41:54 +02:00
|
|
|
--enable-dmeventd \
|
|
|
|
--enable-cmdlib \
|
|
|
|
--enable-udev_rules \
|
|
|
|
--enable-udev_sync \
|
2016-05-11 05:42:15 +02:00
|
|
|
--with-udev-prefix="%{_prefix}/" \
|
|
|
|
--enable-selinux \
|
|
|
|
--enable-pkgconfig \
|
|
|
|
--with-usrlibdir=%{_libdir} \
|
|
|
|
--with-usrsbindir=%{_sbindir} \
|
|
|
|
--with-default-dm-run-dir=/run \
|
|
|
|
--with-tmpfilesdir=%{_tmpfilesdir} \
|
|
|
|
--with-thin=internal \
|
|
|
|
--with-device-gid=6 \
|
|
|
|
--with-device-mode=0640 \
|
|
|
|
--with-device-uid=0 \
|
|
|
|
--with-dmeventd-path=%{_sbindir}/dmeventd \
|
|
|
|
--with-thin-check=%{_sbindir}/thin_check \
|
|
|
|
--with-thin-dump=%{_sbindir}/thin_dump \
|
|
|
|
--with-thin-repair=%{_sbindir}/thin_repair \
|
|
|
|
$extra_opts
|
|
|
|
### COMMON-CONFIG-END ###
|
2017-03-01 03:49:19 +01:00
|
|
|
|
2016-05-11 05:42:15 +02:00
|
|
|
make %{?_smp_mflags} device-mapper
|
|
|
|
|
|
|
|
%install
|
|
|
|
make DESTDIR=%{buildroot} \
|
|
|
|
install_device-mapper \
|
|
|
|
install_systemd_units install_systemd_generators
|
|
|
|
|
|
|
|
ln -s service %{buildroot}/%{_sbindir}/rcdm-event
|
|
|
|
|
|
|
|
# provide 1.02 compat links for the shared libraries
|
|
|
|
# this is needed for various binary packages
|
|
|
|
ln -s libdevmapper.so.1.03 %{buildroot}/%{_libdir}/libdevmapper.so.1.02
|
|
|
|
ln -s libdevmapper-event.so.1.03 %{buildroot}/%{_libdir}/libdevmapper-event.so.1.02
|
|
|
|
|
|
|
|
# remove blkd, will be in lvm2 proper
|
|
|
|
# without force on purpose to detect changes and fail if it happens
|
|
|
|
rm %{buildroot}%{_sbindir}/blkdeactivate
|
|
|
|
rm %{buildroot}%{_unitdir}/blk-availability.service
|
|
|
|
rm %{buildroot}%{_unitdir}/lvm2-monitor.service
|
|
|
|
rm %{buildroot}%{_mandir}/man8/blkdeactivate.8
|
|
|
|
rm %{buildroot}%{_mandir}/man8/lvm2-activation-generator.8
|
|
|
|
|
2016-05-30 14:16:29 +02:00
|
|
|
# compat symlinks in /sbin remove with Leap 43
|
|
|
|
mkdir -p %{buildroot}/sbin
|
|
|
|
ln -s %{_sbindir}/dmsetup %{buildroot}/sbin/dmsetup
|
|
|
|
|
2017-03-01 03:49:19 +01:00
|
|
|
%pre
|
|
|
|
%service_add_pre dm-event.service dm-event.socket
|
|
|
|
|
2016-05-11 05:42:15 +02:00
|
|
|
%post
|
|
|
|
%service_add_post dm-event.service dm-event.socket
|
|
|
|
%{?regenerate_initrd_post}
|
|
|
|
|
|
|
|
%posttrans
|
|
|
|
%{?regenerate_initrd_posttrans}
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun dm-event.service dm-event.socket
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun dm-event.service dm-event.socket
|
|
|
|
%{?regenerate_initrd_post}
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc COPYING COPYING.LIB README
|
|
|
|
%doc udev/12-dm-permissions.rules
|
2016-05-30 14:16:29 +02:00
|
|
|
/sbin/dmsetup
|
2016-05-11 05:42:15 +02:00
|
|
|
%{_sbindir}/dmsetup
|
|
|
|
%{_sbindir}/dmeventd
|
|
|
|
%{_sbindir}/dmstats
|
2017-04-10 12:40:22 +02:00
|
|
|
%{_mandir}/man8/dmstats.8%{ext_man}
|
|
|
|
%{_mandir}/man8/dmsetup.8%{ext_man}
|
|
|
|
%{_mandir}/man8/dmeventd.8%{ext_man}
|
2016-05-11 05:42:15 +02:00
|
|
|
%{_udevrulesdir}/10-dm.rules
|
|
|
|
%{_udevrulesdir}/13-dm-disk.rules
|
|
|
|
%{_udevrulesdir}/95-dm-notify.rules
|
|
|
|
%{_unitdir}/dm-event.socket
|
|
|
|
%{_sbindir}/rcdm-event
|
|
|
|
%{_unitdir}/dm-event.service
|
|
|
|
|
2017-03-01 03:49:19 +01:00
|
|
|
%package -n %{libname}
|
|
|
|
Summary: Library for device-mapper
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: %{name} < %{version}
|
|
|
|
|
|
|
|
%description -n %{libname}
|
|
|
|
Device mapper main shared library
|
|
|
|
|
|
|
|
%files -n %{libname}
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libdevmapper.so.1.03
|
|
|
|
%{_libdir}/libdevmapper.so.1.02
|
|
|
|
|
Accepting request 507153 from home:dimstar:branches:Base:System
- Add Special migration for libdevmapper's move from /lib to
/usr/lib and from device-mapper.rpm to libdevmapper.rpm: the
library is now in %{_libdir}, but up to the point where zypp
removes the 'old' device-mapper package, the old library 'wins'
the ldloader race resulting in binaries asking for the newer
version still getting the old one (boo#1045396).
A typical update issue seen is, zypp updating packages in this
order:
- libdevmapper1_03 (new package)
- libcryptsetup4 (links libdevmapper-1.03, rpm dep satisfied)
- systemd (linking libcryptsetup.so.4, rpm dep satisfied
At this point, anything calling systemdctl gets libdevmapper
from the old device-mapper package into the memory, which in
turn is version 1.02 and does not provide all the needed
symbols
- device-mapper (which removes /lib/libdevmapper.so.1.02, but is
now too late, as various post scripts already failed on running
systemctl)
This has been tested in a VM upgrade, similar to the situation reported in bugzilla - the results was a fully operational system
OBS-URL: https://build.opensuse.org/request/show/507153
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=192
2017-07-01 15:52:52 +02:00
|
|
|
%post -n %{libname}
|
|
|
|
if [ -f /%{_lib}/libdevmapper.so.1.03 ]; then
|
|
|
|
# Special migration - the library is now in %{_libdir}, but up to the point where
|
|
|
|
# zypp removes the 'old' device-mapper package, the old library 'wins' the ldloader race
|
|
|
|
# resulting in binaries asking for the newer version still getting the old one.
|
|
|
|
# This in turn results in funny bugs like boo#1045396
|
|
|
|
# Remove /%{_lib}/libdevmapper.so.1.02 - and the run ldconfig
|
|
|
|
rm /%{_lib}/libdevmapper.so.1.03
|
|
|
|
fi
|
|
|
|
/sbin/ldconfig
|
2017-07-04 14:31:34 +02:00
|
|
|
|
2017-03-01 03:49:19 +01:00
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%package -n %{libname_event}
|
|
|
|
Summary: Event library for device-mapper
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: %{name} < %{version}
|
|
|
|
|
|
|
|
%description -n %{libname_event}
|
|
|
|
Device mapper event daemon shared library
|
|
|
|
|
|
|
|
%files -n %{libname_event}
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libdevmapper-event.so.1.03
|
|
|
|
%{_libdir}/libdevmapper-event.so.1.02
|
|
|
|
|
|
|
|
%post -n %{libname_event} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libname_event} -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development package for the device mapper
|
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{libname_event} = %{device_mapper_version}
|
|
|
|
Requires: %{libname} = %{device_mapper_version}
|
|
|
|
Requires: device-mapper = %{device_mapper_version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Files needed for software development using the device mapper
|
|
|
|
|
2016-05-11 05:42:15 +02:00
|
|
|
%files devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_libdir}/libdevmapper.so
|
|
|
|
%{_libdir}/libdevmapper-event.so
|
2017-03-01 03:49:19 +01:00
|
|
|
%{_includedir}/libdevmapper.h
|
|
|
|
%{_includedir}/libdevmapper-event.h
|
|
|
|
%{_libdir}/pkgconfig/devmapper.pc
|
|
|
|
%{_libdir}/pkgconfig/devmapper-event.pc
|
2016-05-11 05:42:15 +02:00
|
|
|
|
|
|
|
%changelog
|