lvm2/lvm2.spec

337 lines
10 KiB
RPMSpec
Raw Normal View History

#
# spec file for package lvm2
#
2016-05-11 05:42:15 +02:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
2016-05-11 05:42:15 +02:00
### COMMON-DEF-BEGIN ###
%define lvm2_version 2.02.165
Accepting request 426139 from home:scarabeus_iv:branches:Base:System - This is sync commit from Leap/SLE12 only - Add patch pvcreate-enhance-the-error-message.patch bsc#960744 - Modify GPL-2.0 to GPL-2.0+ and LGPL-2.1 to LGPL-2.1+ to avoid license conflict with thin-provisioning-tools which is using GPL-3.0 - Also contains fix for bsc#969310 - Fix clvmd.ocf and cmirrord to remove "-d" option for cmirrod (bsc#971334) - Fix clvmd.ocf to add lvmconf --enable-cluster before start daemon when locking_type is not 3 or use_lvmetad is 1 in setting (bsc#970439) - Modified spec to enable blkid-wiping (fate#319908) - Fix clvmd binary not found in case that users still use RA from ocf:lvm2:clvm (bsc#980200) Add sbindir=$HA_SBIN_DIR for clvmd.ocf and cmirrord.ocf - The bsc#979635 wnd bsc#991181 as fixed in past thanks to proper /usr migration code - Modified raid10_segtype_default from "mirror" to "raid10"(bsc#982329) - Remove lvm2-clvmd/cmirrord.service and related activation services from %service_add _pre/post/preun/postun because we start clvmd /clmirrord and activate via pacemaker and RA. (bsc#980296) - Lvchange improve refresh by trying to deactivate snapshot thinLV in case it's preventing merge process change integrated upstream. (bsc#984321) - Fixed in past bsc#992843 - Fixed by upstream bsc#984321 - Fixed by upstream bsc#970943 - 69-dm-lvm-metad.rules: Do not process rules for multipath devices (bsc#bsc#990538, bsc#986734) Add: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch - Rewrite patches to include patch header: OBS-URL: https://build.opensuse.org/request/show/426139 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=158
2016-09-14 11:43:37 +02:00
%define device_mapper_version 1.02.134
2016-05-11 05:42:15 +02:00
### COMMON-DEF-END ###
%define _udevdir %(pkg-config --variable=udevdir udev)
%define applib liblvm2app2_2
%define cmdlib liblvm2cmd2_02
Name: lvm2
Version: %{lvm2_version}
Release: 0
Summary: Logical Volume Manager Tools
Accepting request 426139 from home:scarabeus_iv:branches:Base:System - This is sync commit from Leap/SLE12 only - Add patch pvcreate-enhance-the-error-message.patch bsc#960744 - Modify GPL-2.0 to GPL-2.0+ and LGPL-2.1 to LGPL-2.1+ to avoid license conflict with thin-provisioning-tools which is using GPL-3.0 - Also contains fix for bsc#969310 - Fix clvmd.ocf and cmirrord to remove "-d" option for cmirrod (bsc#971334) - Fix clvmd.ocf to add lvmconf --enable-cluster before start daemon when locking_type is not 3 or use_lvmetad is 1 in setting (bsc#970439) - Modified spec to enable blkid-wiping (fate#319908) - Fix clvmd binary not found in case that users still use RA from ocf:lvm2:clvm (bsc#980200) Add sbindir=$HA_SBIN_DIR for clvmd.ocf and cmirrord.ocf - The bsc#979635 wnd bsc#991181 as fixed in past thanks to proper /usr migration code - Modified raid10_segtype_default from "mirror" to "raid10"(bsc#982329) - Remove lvm2-clvmd/cmirrord.service and related activation services from %service_add _pre/post/preun/postun because we start clvmd /clmirrord and activate via pacemaker and RA. (bsc#980296) - Lvchange improve refresh by trying to deactivate snapshot thinLV in case it's preventing merge process change integrated upstream. (bsc#984321) - Fixed in past bsc#992843 - Fixed by upstream bsc#984321 - Fixed by upstream bsc#970943 - 69-dm-lvm-metad.rules: Do not process rules for multipath devices (bsc#bsc#990538, bsc#986734) Add: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch - Rewrite patches to include patch header: OBS-URL: https://build.opensuse.org/request/show/426139 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=158
2016-09-14 11:43:37 +02:00
License: GPL-2.0+ and LGPL-2.1+
Group: System/Base
Url: http://www.sourceware.org/lvm2/
2016-05-11 05:42:15 +02:00
Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
Source1: lvm.conf
2016-05-11 05:42:15 +02:00
Source42: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz.asc
### COMMON-PATCH-BEGIN ###
# Upstream patches first
Patch1001: improve_probing.diff
Patch1002: no-inc-audit.diff
Patch1004: sys_mount_instead_linux_fs.diff
#suse
Patch1005: display-dm-name-for-lv-name.diff
Patch1006: device-mapper-type_punning.diff
#fate312248, patch6,7
Patch1007: make-mirror-legs-on-different-tag-pvs.patch
Patch1008: improve-mirror-legs-on-different-tag-pvs.patch
#fate#315092
Patch1009: cmirrord_improvment_performance.patch
#fate#314367, patch10,11
Patch1010: cluster_support_mirrord_log.diff
Patch1011: lvconvert-cluster-mirrored-disk-failed.patch
#forward-port from sle11
Patch1012: suppress_format1_size_warning.diff
Patch1013: pvmove_support_clustered_vg.diff
# Never upstream
Patch1014: cmirrord_remove_date_time_from_compilation.patch
#suse, bnc873538
Patch1015: fix-closedown-before-thread-finish.patch
#suse, bnc#870824
Patch1016: use-mirrortype-asdefault-whenclvmdrunning.patch
2016-05-11 05:42:15 +02:00
Patch1017: version-plugins-in-libdir.patch
Patch1018: dmeventd-fix-dso-name-wrong-compare.patch
2016-05-11 05:42:15 +02:00
Patch1019: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch
#suse, bnc#707253(also merged patch for bnc#479104)
Patch2000: device-mapper-dmsetup-export.patch
Patch2001: device-mapper-gcc-warnings.patch
2016-05-11 05:42:15 +02:00
Patch2002: device-mapper-link.patch
#suse, bnc#78902,bnc#789019,bnc#789020
2016-05-11 05:42:15 +02:00
Patch2003: udev_rules-update.diff
#suse, bnc#875233
2016-05-11 05:42:15 +02:00
Patch2004: udev-Check-for-DM_NR_VALID_PATHS.patch
Patch2005: fsadm-add-support-for-btrfs.patch
Patch2006: Import-ID_FS_XXX-variables-bnc909358.patch
Patch2007: 10-dm.rules-Reset-state-variable-for-spurious-events.patch
Patch2008: libdm-iface-not-output-error-message-inside-retry-loop.patch
Accepting request 426139 from home:scarabeus_iv:branches:Base:System - This is sync commit from Leap/SLE12 only - Add patch pvcreate-enhance-the-error-message.patch bsc#960744 - Modify GPL-2.0 to GPL-2.0+ and LGPL-2.1 to LGPL-2.1+ to avoid license conflict with thin-provisioning-tools which is using GPL-3.0 - Also contains fix for bsc#969310 - Fix clvmd.ocf and cmirrord to remove "-d" option for cmirrod (bsc#971334) - Fix clvmd.ocf to add lvmconf --enable-cluster before start daemon when locking_type is not 3 or use_lvmetad is 1 in setting (bsc#970439) - Modified spec to enable blkid-wiping (fate#319908) - Fix clvmd binary not found in case that users still use RA from ocf:lvm2:clvm (bsc#980200) Add sbindir=$HA_SBIN_DIR for clvmd.ocf and cmirrord.ocf - The bsc#979635 wnd bsc#991181 as fixed in past thanks to proper /usr migration code - Modified raid10_segtype_default from "mirror" to "raid10"(bsc#982329) - Remove lvm2-clvmd/cmirrord.service and related activation services from %service_add _pre/post/preun/postun because we start clvmd /clmirrord and activate via pacemaker and RA. (bsc#980296) - Lvchange improve refresh by trying to deactivate snapshot thinLV in case it's preventing merge process change integrated upstream. (bsc#984321) - Fixed in past bsc#992843 - Fixed by upstream bsc#984321 - Fixed by upstream bsc#970943 - 69-dm-lvm-metad.rules: Do not process rules for multipath devices (bsc#bsc#990538, bsc#986734) Add: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch - Rewrite patches to include patch header: OBS-URL: https://build.opensuse.org/request/show/426139 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=158
2016-09-14 11:43:37 +02:00
# bnc#960744
Patch2009: pvcreate-enhance-the-error-message.patch
# bnc#990538 bnc#986734
Patch2010: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
2016-05-11 05:42:15 +02:00
### COMMON-PATCH-END ###
BuildRequires: gcc-c++
BuildRequires: libaio-devel
BuildRequires: libselinux-devel
2016-05-11 05:42:15 +02:00
BuildRequires: pkgconfig
BuildRequires: readline-devel
2016-05-11 05:42:15 +02:00
BuildRequires: systemd
BuildRequires: thin-provisioning-tools >= 0.5.6
2016-05-11 05:42:15 +02:00
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
2016-05-11 05:42:15 +02:00
Requires: device-mapper >= %{device_mapper_version}
Requires(post): coreutils
Requires(postun): coreutils
2016-05-11 05:42:15 +02:00
Provides: lvm = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%description
Programs and man pages for configuring and using the LVM2 Logical
Volume Manager.
2016-05-11 05:42:15 +02:00
%package -n %{applib}
Summary: LVM2 application api library
Group: System/Libraries
Conflicts: %{name} < %{version}
2016-05-11 05:42:15 +02:00
%description -n %{applib}
LVM library for applications api
%package -n %{cmdlib}
Summary: LVM2 command line library
Group: System/Libraries
Conflicts: %{name} < %{version}
2016-05-11 05:42:15 +02:00
%description -n %{cmdlib}
The lvm2 command line library allows building programs that manage
lvm devices without invoking a separate program.
%package devel
Summary: Development files for LVM2
Group: Development/Libraries/C and C++
Requires: %{applib} = %{version}
Requires: %{cmdlib} = %{version}
Requires: lvm2 = %{version}
Recommends: device-mapper-devel
%description devel
This package provides development files for the LVM2 Logical Volume Manager.
2016-05-11 05:42:15 +02:00
%prep
%setup -q -n LVM2.%{version}
### COMMON-PREP-BEGIN ###
%patch1001 -p1
%patch1002 -p1
%patch1004 -p1
%patch1005 -p1
%patch1006 -p1
%patch1007 -p1
%patch1008 -p1
%patch1009 -p1
%patch1010 -p1
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%patch1014 -p1
%patch1015 -p1
%patch1016 -p1
%patch1017 -p1
%patch1018 -p1
%patch1019 -p1
%patch2000 -p1
%patch2001 -p1
%patch2002 -p1
%patch2003 -p1
%patch2004 -p1
%patch2005 -p1
2016-05-11 05:42:15 +02:00
%patch2006 -p1
%patch2007 -p1
%patch2008 -p1
Accepting request 426139 from home:scarabeus_iv:branches:Base:System - This is sync commit from Leap/SLE12 only - Add patch pvcreate-enhance-the-error-message.patch bsc#960744 - Modify GPL-2.0 to GPL-2.0+ and LGPL-2.1 to LGPL-2.1+ to avoid license conflict with thin-provisioning-tools which is using GPL-3.0 - Also contains fix for bsc#969310 - Fix clvmd.ocf and cmirrord to remove "-d" option for cmirrod (bsc#971334) - Fix clvmd.ocf to add lvmconf --enable-cluster before start daemon when locking_type is not 3 or use_lvmetad is 1 in setting (bsc#970439) - Modified spec to enable blkid-wiping (fate#319908) - Fix clvmd binary not found in case that users still use RA from ocf:lvm2:clvm (bsc#980200) Add sbindir=$HA_SBIN_DIR for clvmd.ocf and cmirrord.ocf - The bsc#979635 wnd bsc#991181 as fixed in past thanks to proper /usr migration code - Modified raid10_segtype_default from "mirror" to "raid10"(bsc#982329) - Remove lvm2-clvmd/cmirrord.service and related activation services from %service_add _pre/post/preun/postun because we start clvmd /clmirrord and activate via pacemaker and RA. (bsc#980296) - Lvchange improve refresh by trying to deactivate snapshot thinLV in case it's preventing merge process change integrated upstream. (bsc#984321) - Fixed in past bsc#992843 - Fixed by upstream bsc#984321 - Fixed by upstream bsc#970943 - 69-dm-lvm-metad.rules: Do not process rules for multipath devices (bsc#bsc#990538, bsc#986734) Add: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch - Rewrite patches to include patch header: OBS-URL: https://build.opensuse.org/request/show/426139 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=158
2016-09-14 11:43:37 +02:00
%patch2009 -p1
%patch2010 -p1
2016-05-11 05:42:15 +02:00
### COMMON-PREP-END ###
%build
2016-05-11 05:42:15 +02:00
extra_opts="
--enable-cmdlib
--enable-applib
--enable-realtime
--enable-lvmetad
--with-default-locking-dir=/run/lock/lvm
--with-default-pid-dir=/run
--with-default-run-dir=/run/lvm
"
### COMMON-CONFIG-BEGIN ###
export PATH=$PATH:/sbin:%{_prefix}/sbin
sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM
%configure \
2016-05-11 05:42:15 +02:00
--enable-dmeventd --enable-cmdlib \
--enable-udev_rules --enable-udev_sync \
--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 ###
make %{?_smp_mflags}
%install
%make_install
2016-05-11 05:42:15 +02:00
make install_system_dirs DESTDIR=%{buildroot}
make install_systemd_units DESTDIR=%{buildroot}
make install_systemd_generators DESTDIR=%{buildroot}
make install_tmpfiles_configuration DESTDIR=%{buildroot}
# Install configuration file
install -m 644 %{SOURCE1} "%{buildroot}/%{_sysconfdir}/lvm/"
pushd "%{buildroot}/%{_libdir}"
ln -sf liblvm2cmd.so.2.02 liblvm2cmd.so
ln -sf liblvm2app.so.2.2 liblvm2app.so
for i in libdevmapper-event-lvm2{mirror,raid,snapshot,thin}; do
2016-05-11 05:42:15 +02:00
ln -sf "device-mapper/$i.so" "$i.so"
ln -sf "device-mapper/$i.so" "$i.so.2.02"
done
popd
2016-05-11 05:42:15 +02:00
#rc compat symlinks
ln -s service %{buildroot}%{_sbindir}/rcblk-availability
ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmetad
ln -s service %{buildroot}%{_sbindir}/rclvm2-monitor
# Remove devicemapper binaries, plain rm so we fail if something change
rm %{buildroot}%{_sbindir}/dmsetup
rm %{buildroot}%{_sbindir}/dmeventd
rm %{buildroot}%{_sbindir}/dmstats
rm %{buildroot}%{_mandir}/man8/dmstats.8
rm %{buildroot}%{_mandir}/man8/dmsetup.8
rm %{buildroot}%{_mandir}/man8/dmeventd.8
rm %{buildroot}%{_udevrulesdir}/10-dm.rules
rm %{buildroot}%{_udevrulesdir}/13-dm-disk.rules
rm %{buildroot}%{_udevrulesdir}/95-dm-notify.rules
rm %{buildroot}%{_unitdir}/dm-event.socket
rm %{buildroot}%{_unitdir}/dm-event.service
rm %{buildroot}%{_libdir}/libdevmapper.so.1.03
rm %{buildroot}%{_libdir}/libdevmapper-event.so.1.03
rm %{buildroot}%{_libdir}/libdevmapper.so
rm %{buildroot}%{_libdir}/libdevmapper-event.so
rm %{buildroot}%{_includedir}/libdevmapper*.h
rm %{buildroot}%{_libdir}/pkgconfig/devmapper*.pc
# compat symlinks in /sbin remove with Leap 43
mkdir -p %{buildroot}/sbin
pushd %{buildroot}/%{_sbindir}
for i in {vg,pv,lv}*; do
ln -s %{_sbindir}/$i %{buildroot}/sbin/$i
done
popd
%pre
2016-05-11 05:42:15 +02:00
%service_add_pre blk-availability.service lvm2-monitor.service lvm2-lvmetad.socket lvm2-lvmetad.service
%post
/sbin/ldconfig
%{?regenerate_initrd_post}
%service_add_post blk-availability.service lvm2-monitor.service lvm2-lvmetad.socket lvm2-lvmetad.service
2016-05-11 05:42:15 +02:00
# Use %%tmpfiles_create when 13.2 is oldest in support scope
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/lvm2.conf || :
%posttrans
%{?regenerate_initrd_posttrans}
%preun
2016-05-11 05:42:15 +02:00
%service_del_preun blk-availability.service lvm2-monitor.service lvm2-lvmetad.service
%postun
/sbin/ldconfig
%{?regenerate_initrd_post}
%service_del_postun blk-availability.service lvm2-monitor.service lvm2-lvmetad.service
2016-05-11 05:42:15 +02:00
%post -n %{applib} -p /sbin/ldconfig
%postun -n %{applib} -p /sbin/ldconfig
%post -n %{cmdlib} -p /sbin/ldconfig
%postun -n %{cmdlib} -p /sbin/ldconfig
%files -n %{applib}
%defattr(-,root,root)
%{_libdir}/liblvm2app.so.*
%files -n %{cmdlib}
%defattr(-,root,root)
%{_libdir}/liblvm2cmd.so.*
%files
%defattr(-,root,root)
%doc README WHATS_NEW doc/*
%dir %{_sysconfdir}/lvm
%dir %{_sysconfdir}/lvm/cache
2016-05-11 05:42:15 +02:00
%dir %{_sysconfdir}/lvm/profile
%ghost %{_sysconfdir}/lvm/cache/.cache
2016-05-11 05:42:15 +02:00
%config %{_sysconfdir}/lvm/profile/*.profile
%config %{_sysconfdir}/lvm/lvmlocal.conf
%{_udevdir}/rules.d/11-dm-lvm.rules
%{_udevdir}/rules.d/69-dm-lvm-metad.rules
%{_unitdir}/blk-availability.service
%{_unitdir}/lvm2-monitor.service
%{_unitdir}/lvm2-lvmetad.socket
%{_unitdir}/lvm2-lvmetad.service
%{_unitdir}/lvm2-pvscan@.service
2016-05-11 05:42:15 +02:00
%{_libexecdir}/systemd/system-generators/lvm2-activation-generator
%{_tmpfilesdir}/lvm2.conf
%config(noreplace) %{_sysconfdir}/lvm/lvm.conf
2016-05-11 05:42:15 +02:00
%{_sbindir}/blkdeactivate
%{_sbindir}/fsadm
%{_sbindir}/lv*
%{_sbindir}/pv*
%{_sbindir}/vg*
/sbin/lv*
/sbin/pv*
/sbin/vg*
2016-05-11 05:42:15 +02:00
%{_sbindir}/rcblk-availability
%{_sbindir}/rclvm2-lvmetad
%{_sbindir}/rclvm2-monitor
%dir %{_libdir}/device-mapper
%{_libdir}/device-mapper/libdevmapper-event-lvm2*.so
%{_libdir}/libdevmapper-event-lvm2*.so
%{_libdir}/libdevmapper-event-lvm2*.so.2.02
%{_libdir}/libdevmapper-event-lvm2.so
%{_mandir}/man5/lvm.conf.5.*
%{_mandir}/man8/blkdeactivate.8.*
%{_mandir}/man8/fsadm.8.gz
%{_mandir}/man8/lv*.8*
%{_mandir}/man8/pv*.8*
%{_mandir}/man8/vg*.8*
%{_mandir}/man7/lvm*.7*
%ghost %dir /run/lock/lvm
%ghost %dir /run/lvm
%files devel
%defattr(-,root,root)
2016-05-11 05:42:15 +02:00
%{_includedir}/lvm2cmd.h
%{_includedir}/lvm2app.h
%{_libdir}/pkgconfig/lvm2app.pc
%{_libdir}/liblvm2app.so
%{_libdir}/liblvm2cmd.so
%changelog