summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/build.inc64
-rw-r--r--spec/lvm2.spec29
-rw-r--r--spec/macros.inc83
-rw-r--r--spec/packages.inc572
-rw-r--r--spec/source.inc199
5 files changed, 947 insertions, 0 deletions
diff --git a/spec/build.inc b/spec/build.inc
new file mode 100644
index 0000000..e5f76db
--- /dev/null
+++ b/spec/build.inc
@@ -0,0 +1,64 @@
+%with default-dm-run-dir %{_default_dm_run_dir}
+%with default-run-dir %{_default_run_dir}
+%with default-pid-dir %{_default_pid_dir}
+%with default-locking-dir %{_default_locking_dir}
+%with usrlibdir %{_libdir}
+%enableif 1 fsadm
+%with user
+%with group
+%with device-uid 0
+%with device-gid 6
+%with device-mode 0660
+%enableif 1 pkgconfig
+%enableif 1 cmdlib
+%enableif 1 dmeventd
+%enableif 1 write_install
+
+%with udevdir %{_udevdir}
+%enableif %{enable_cmirror} cmirrord
+%enableif %{enable_udev} udev_sync
+%enableif %{enable_profiling} profiling
+%global enable_lvmpolld %(if echo %{services} | grep -q lvmpolld; then echo 1; else echo 0; fi)
+%enableif %{enable_lvmpolld} lvmpolld
+%global enable_lvmlockd %(if echo %{services} | grep -q lvmlockd; then echo 1; else echo 0; fi)
+%if %{enable_lvmlockd}
+%enableif %{enable_lvmlockd_dlm} lvmlockd-dlm
+%enableif %{enable_lvmlockd_sanlock} lvmlockd-sanlock
+%endif
+%enableif %{enable_dbusd} dbus-service
+%enableif %{enable_dbusd} notify-dbus
+%enableif %{enable_dmfilemapd} dmfilemapd
+%enableif %{enable_readline} readline
+%enableif %{enable_editline} editline
+
+%build
+
+# FIXME: Remove --enable-dependency-tracking once problem with generated file from tools/ is used in lib/
+%configure %{configure_flags} --enable-dependency-tracking
+
+make %{?_smp_mflags}
+%{?extra_build_commands}
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+make install_system_dirs DESTDIR=$RPM_BUILD_ROOT
+%if %{enable_systemd}
+make install_systemd_units DESTDIR=$RPM_BUILD_ROOT
+make install_systemd_generators DESTDIR=$RPM_BUILD_ROOT
+make install_tmpfiles_configuration DESTDIR=$RPM_BUILD_ROOT
+%else
+make install_initscripts DESTDIR=$RPM_BUILD_ROOT
+%endif
+%if %{enable_testsuite}
+make -C test install DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+# when building an src.rpm from freestanding specfiles
+test -e %{_sourcedir}/source.inc || cp source.inc build.inc packages.inc macros.inc %{_sourcedir}
+
+%check
+%{?check_commands}
+
+%clean
+pwd
+test -n rpm-no-clean || rm -rf $RPM_BUILD_ROOT
diff --git a/spec/lvm2.spec b/spec/lvm2.spec
new file mode 100644
index 0000000..18b1821
--- /dev/null
+++ b/spec/lvm2.spec
@@ -0,0 +1,29 @@
+# Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# NB. This specfile is a work in progress. It is currently used by the
+# continuous integration system driven by nix and hydra to create and test RPMs
+# on Fedora, CentOS and RHEL systems. It is not yet ready for deployment of LVM
+# on those systems.
+
+# A macro to pull in an include file from an appropriate location.
+%global import() %%include %%(test -e %%{S:%%1} && echo %%{S:%%1} || echo %%{_sourcedir}/%%1)
+
+%import source.inc
+
+# PatchN: nnn.patch goes here
+
+%prep
+%setup -q -n LVM2.%{version}
+
+%import build.inc
+%import packages.inc
+
+%changelog
diff --git a/spec/macros.inc b/spec/macros.inc
new file mode 100644
index 0000000..d4e99e6
--- /dev/null
+++ b/spec/macros.inc
@@ -0,0 +1,83 @@
+%global _default_pid_dir /run
+%global _default_dm_run_dir /run
+%global _default_run_dir /run/lvm
+%global _default_locking_dir /run/lock/lvm
+%global _udevbasedir %{_prefix}/lib/udev
+%global _udevdir %{_udevbasedir}/rules.d
+%global _tmpfilesdir %{_prefix}/lib/tmpfiles.d
+
+%if !0%{?fedora}
+%global fedora 0
+%endif
+
+%if !0%{?rhel}
+%global rhel 0
+%endif
+
+%global enableif() \
+%%global configure_flags %%{?configure_flags} --%%(if test %%1 -gt 0; then echo enable-%%2; else echo disable-%%2; fi)
+
+%global with() \
+%%global configure_flags %%(echo -n "%%{?configure_flags} " | sed -e "s,--with-%%1=[^ ]*,,"; test -n "%%{?2}" && echo --with-%%1=%%2) \
+%%global with_flags %%(echo -n "%%{?with_flags} " | sed -e "s,%%1,,"; test -n "%%{?2}" && test "%%{?2}" != none && echo %%1)
+
+%global services monitor
+%global service() \
+%%global services %%(echo -n "%%{?services} " | sed -e s,%%1,,; test "%%2" = 1 && echo %%1)
+
+%global maybe() \
+%%if %%(test -n "%%{?2}" && echo 1 || echo 0) \
+%%* \
+%%endif
+
+%global have_with() %%(if echo %%{with_flags} | grep -q %%1; then echo 1; else echo 0; fi)
+%global have_service() %%(if echo %%{services} | grep -q %%1; then echo 1; else echo 0; fi)
+
+%global daemon_reload \
+%%if %%{enable_systemd} \
+systemctl daemon-reload > /dev/null 2>&1 || : \
+%%endif \
+: \
+%%{nil}
+
+%global enable(s:t:) \
+%%if %%{have_service %%{-s*}} \
+%%if %%{enable_systemd} \
+if [ $1 = 1 ]; then \
+ systemctl preset lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
+fi \
+%%else \
+/sbin/chkconfig --add lvm2-%%{-s*} \
+%%endif \
+%%endif \
+: \
+%%{nil}
+
+%global disable(s:t:) \
+%%if %%{have_service %%{-s*}} \
+%%if %%{enable_systemd} \
+if [ $1 = 0 ]; then \
+ systemctl --no-reload disable lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
+ %%if "%%{-t*}" == "socket" \
+ systemctl --no-reload disable lvm2-%%{-s*}.service > /dev/null 2>&1 || : \
+ %%endif \
+ systemctl stop lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
+ %%if "%%{-t*}" == "socket" \
+ systemctl stop lvm2-%%{-s*}.service > /dev/null 2>&1 || : \
+ %%endif \
+fi \
+%%else \
+/sbin/chkconfig --del lvm2-%%{-s*} \
+%%endif \
+%%endif \
+: \
+%%{nil}
+
+%global try_restart(s:t:) \
+%%if %%{have_service %%{-s*}} && %%{enable_systemd} \
+if [ $1 = 1 ]; then \
+ systemctl try-restart lvm2-%%{-s*}.%%{-t*} > /dev/null 2>&1 || : \
+fi \
+%%endif \
+: \
+%%{nil}
diff --git a/spec/packages.inc b/spec/packages.inc
new file mode 100644
index 0000000..cc1655e
--- /dev/null
+++ b/spec/packages.inc
@@ -0,0 +1,572 @@
+### MAIN PACKAGE (lvm2)
+
+%post
+%daemon_reload
+%enable -s monitor -t service
+%if %{have_service lvmpolld}
+%enable -s lvmpolld -t socket
+%endif
+
+%preun
+%if %{have_service lvmpolld}
+%disable -s lvmpolld -t socket
+%endif
+%disable -s monitor -t service
+
+%postun
+%try_restart -s monitor -t service
+%if %{have_service lvmpolld}
+%try_restart -s lvmpolld -t service
+%endif
+if [ $1 = 0 ]; then
+%daemon_reload
+fi
+
+%triggerun -- %{name} < 2.02.86-2
+%{_bindir}/systemd-sysv-convert --save lvm2-monitor >/dev/null 2>&1 || :
+/bin/systemctl --no-reload enable lvm2-monitor.service > /dev/null 2>&1 || :
+/sbin/chkconfig --del lvm2-monitor > /dev/null 2>&1 || :
+/bin/systemctl try-restart lvm2-monitor.service > /dev/null 2>&1 || :
+# files in the main package
+
+%files
+%defattr(-,root,root,-)
+%doc COPYING COPYING.LIB INSTALL README VERSION WHATS_NEW
+%doc doc/lvm_fault_handling.txt
+%{_sbindir}/fsadm
+%{_libexecdir}/lvresize_fs_helper
+%{_sbindir}/lvchange
+%{_sbindir}/lvconvert
+%{_sbindir}/lvcreate
+%{_sbindir}/lvdisplay
+%{_sbindir}/lvextend
+%{_sbindir}/lvm
+%{_sbindir}/lvmconfig
+%{_sbindir}/lvmdevices
+%{_sbindir}/lvmdiskscan
+%{_sbindir}/lvmdump
+%{_sbindir}/lvmsadc
+%{_sbindir}/lvmsar
+%{_sbindir}/lvreduce
+%{_sbindir}/lvremove
+%{_sbindir}/lvrename
+%{_sbindir}/lvresize
+%{_sbindir}/lvs
+%{_sbindir}/lvscan
+%{_sbindir}/pvchange
+%{_sbindir}/pvck
+%{_sbindir}/pvcreate
+%{_sbindir}/pvdisplay
+%{_sbindir}/pvmove
+%{_sbindir}/pvremove
+%{_sbindir}/pvresize
+%{_sbindir}/pvs
+%{_sbindir}/pvscan
+%if %{have_with vdo}
+%{_sbindir}/lvm_import_vdo
+%endif
+%{_sbindir}/vgcfgbackup
+%{_sbindir}/vgcfgrestore
+%{_sbindir}/vgchange
+%{_sbindir}/vgck
+%{_sbindir}/vgconvert
+%{_sbindir}/vgcreate
+%{_sbindir}/vgdisplay
+%{_sbindir}/vgexport
+%{_sbindir}/vgextend
+%{_sbindir}/vgimport
+%{_sbindir}/vgimportclone
+%{_sbindir}/vgimportdevices
+%{_sbindir}/vgmerge
+%{_sbindir}/vgmknodes
+%{_sbindir}/vgreduce
+%{_sbindir}/vgremove
+%{_sbindir}/vgrename
+%{_sbindir}/vgs
+%{_sbindir}/vgscan
+%{_sbindir}/vgsplit
+%if %{have_service lvmpolld}
+ %{_sbindir}/lvmpolld
+%endif
+%{_mandir}/man5/lvm.conf.5.gz
+%{_mandir}/man7/lvmautoactivation.7.gz
+%{_mandir}/man7/lvmsystemid.7.gz
+%{_mandir}/man7/lvmreport.7.gz
+%{_mandir}/man7/lvmraid.7.gz
+%{_mandir}/man8/fsadm.8.gz
+%{_mandir}/man8/lvchange.8.gz
+%{_mandir}/man8/lvconvert.8.gz
+%{_mandir}/man8/lvcreate.8.gz
+%{_mandir}/man8/lvdisplay.8.gz
+%{_mandir}/man8/lvextend.8.gz
+%{_mandir}/man8/lvm-config.8.gz
+%{_mandir}/man8/lvm-dumpconfig.8.gz
+%{_mandir}/man8/lvm.8.gz
+%{_mandir}/man8/lvmconfig.8.gz
+%{_mandir}/man8/lvmdevices.8.gz
+%{_mandir}/man8/lvmdiskscan.8.gz
+%{_mandir}/man8/lvmdump.8.gz
+%{_mandir}/man8/lvm-fullreport.8.gz
+%{_mandir}/man8/lvmsadc.8.gz
+%{_mandir}/man8/lvmsar.8.gz
+%{_mandir}/man8/lvreduce.8.gz
+%{_mandir}/man8/lvremove.8.gz
+%{_mandir}/man8/lvrename.8.gz
+%{_mandir}/man8/lvresize.8.gz
+%{_mandir}/man8/lvs.8.gz
+%{_mandir}/man8/lvscan.8.gz
+%{_mandir}/man8/pvchange.8.gz
+%{_mandir}/man8/pvck.8.gz
+%{_mandir}/man8/pvcreate.8.gz
+%{_mandir}/man8/pvdisplay.8.gz
+%{_mandir}/man8/pvmove.8.gz
+%{_mandir}/man8/pvremove.8.gz
+%{_mandir}/man8/pvresize.8.gz
+%{_mandir}/man8/pvs.8.gz
+%{_mandir}/man8/pvscan.8.gz
+%if %{have_with vdo}
+%{_mandir}/man8/lvm_import_vdo.8.gz
+%endif
+%{_mandir}/man8/vgcfgbackup.8.gz
+%{_mandir}/man8/vgcfgrestore.8.gz
+%{_mandir}/man8/vgchange.8.gz
+%{_mandir}/man8/vgck.8.gz
+%{_mandir}/man8/vgconvert.8.gz
+%{_mandir}/man8/vgcreate.8.gz
+%{_mandir}/man8/vgdisplay.8.gz
+%{_mandir}/man8/vgexport.8.gz
+%{_mandir}/man8/vgextend.8.gz
+%{_mandir}/man8/vgimport.8.gz
+%{_mandir}/man8/vgimportclone.8.gz
+%{_mandir}/man8/vgimportdevices.8.gz
+%{_mandir}/man8/vgmerge.8.gz
+%{_mandir}/man8/vgmknodes.8.gz
+%{_mandir}/man8/vgreduce.8.gz
+%{_mandir}/man8/vgremove.8.gz
+%{_mandir}/man8/vgrename.8.gz
+%{_mandir}/man8/vgs.8.gz
+%{_mandir}/man8/vgscan.8.gz
+%{_mandir}/man8/vgsplit.8.gz
+%if %{have_with cache}
+ %{_mandir}/man7/lvmcache.7.gz
+%endif
+%if %{have_with thin}
+ %{_mandir}/man7/lvmthin.7.gz
+%endif
+%if %{have_service lvmpolld}
+ %{_mandir}/man8/lvmpolld.8.gz
+ %{_mandir}/man8/lvm-lvpoll.8.gz
+%endif
+%if %{have_with vdo}
+ %{_mandir}/man7/lvmvdo.7.gz
+%endif
+%if %{enable_udev}
+ %{_udevdir}/11-dm-lvm.rules
+ %{_udevdir}/69-dm-lvm.rules
+%endif
+%dir %{_sysconfdir}/lvm
+%ghost %{_sysconfdir}/lvm/cache/.cache
+%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf
+%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvmlocal.conf
+%dir %{_sysconfdir}/lvm/profile
+%{_sysconfdir}/lvm/profile/command_profile_template.profile
+%{_sysconfdir}/lvm/profile/metadata_profile_template.profile
+%{_sysconfdir}/lvm/profile/thin-generic.profile
+%{_sysconfdir}/lvm/profile/thin-performance.profile
+%{_sysconfdir}/lvm/profile/cache-mq.profile
+%{_sysconfdir}/lvm/profile/cache-smq.profile
+%{_sysconfdir}/lvm/profile/lvmdbusd.profile
+%if %{have_with vdo}
+ %{_sysconfdir}/lvm/profile/vdo-small.profile
+%endif
+%dir %{_sysconfdir}/lvm/backup
+%dir %{_sysconfdir}/lvm/cache
+%dir %{_sysconfdir}/lvm/archive
+%dir %{_default_locking_dir}
+%dir %{_default_run_dir}
+%if %{enable_systemd}
+ %{_tmpfilesdir}/%{name}.conf
+ %{_unitdir}/blk-availability.service
+ %{_unitdir}/lvm2-monitor.service
+ %if %{have_service lvmpolld}
+ %{_unitdir}/lvm2-lvmpolld.service
+ %{_unitdir}/lvm2-lvmpolld.socket
+ %endif
+%else
+ %{_sysconfdir}/rc.d/init.d/blk-availability
+ %{_sysconfdir}/rc.d/init.d/lvm2-monitor
+ %if %{have_service lvmpolld}
+ %{_sysconfdir}/rc.d/init.d/lvm2-lvmpolld
+ %endif
+%endif
+
+##############################################################################
+# Library and Development subpackages
+##############################################################################
+%package devel
+Summary: Development libraries and headers
+Group: Development/Libraries
+License: LGPLv2
+Requires: %{name} = %{version}-%{release}
+Requires: device-mapper-devel >= %{device_mapper_version}-%{release}
+Requires: device-mapper-event-devel >= %{device_mapper_version}-%{release}
+Requires: pkgconfig
+
+%description devel
+This package contains files needed to develop applications that use
+the lvm2 libraries.
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/liblvm2cmd.so
+%{_includedir}/lvm2cmd.h
+%{_libdir}/libdevmapper-event-lvm2.so
+
+%package libs
+Summary: Shared libraries for lvm2
+License: LGPLv2
+Group: System Environment/Libraries
+Requires: device-mapper-event >= %{device_mapper_version}-%{release}
+
+%description libs
+This package contains shared lvm2 libraries for applications.
+
+%post libs -p /sbin/ldconfig
+
+%postun libs -p /sbin/ldconfig
+
+%files libs
+%defattr(-,root,root,-)
+%attr(755,root,root) %{_libdir}/liblvm2cmd.so.*
+%attr(755,root,root) %{_libdir}/libdevmapper-event-lvm2.so.*
+%dir %{_libdir}/device-mapper
+%{_libdir}/device-mapper/libdevmapper-event-lvm2mirror.so
+%{_libdir}/device-mapper/libdevmapper-event-lvm2snapshot.so
+%{_libdir}/device-mapper/libdevmapper-event-lvm2raid.so
+%if %{have_with thin}
+%{_libdir}/device-mapper/libdevmapper-event-lvm2thin.so
+%{_libdir}/libdevmapper-event-lvm2thin.so
+%endif
+%{_libdir}/libdevmapper-event-lvm2mirror.so
+%{_libdir}/libdevmapper-event-lvm2snapshot.so
+%{_libdir}/libdevmapper-event-lvm2raid.so
+%if %{have_with vdo}
+%{_libdir}/device-mapper/libdevmapper-event-lvm2vdo.so
+%{_libdir}/libdevmapper-event-lvm2vdo.so
+%endif
+
+
+##############################################################################
+# LVM locking daemon
+##############################################################################
+%if %{have_service lvmlockd}
+%package lockd
+Summary: LVM locking daemon
+Group: System Environment/Base
+Requires: lvm2 = %{version}-%{release}
+%if %{enable_lvmlockd_dlm}
+Requires: dlm-lib >= %{dlm_version}
+%endif
+%if %{enable_lvmlockd_sanlock}
+Requires: sanlock-lib >= %{sanlock_version}
+%endif
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+
+%description lockd
+LVM commands use lvmlockd to coordinate access to shared storage.
+
+%post lockd
+%daemon_reload
+%enable -s lvmlockd -t service
+
+%preun lockd
+%disable -s lvmlockd -t service
+
+%postun lockd
+if [ $1 = 0 ]; then
+%daemon_reload
+fi
+
+%files lockd
+%{_sbindir}/lvmlockd
+%{_sbindir}/lvmlockctl
+%{_mandir}/man8/lvmlockd.8.gz
+%{_mandir}/man8/lvmlockctl.8.gz
+%dir %{_default_locking_dir}
+%{_unitdir}/lvmlockd.service
+%{_unitdir}/lvmlocks.service
+%endif
+
+##############################################################################
+# Cluster mirror subpackage
+##############################################################################
+%if %{enable_cmirror}
+
+%package -n cmirror
+Summary: Daemon for device-mapper-based clustered mirrors
+Group: System Environment/Base
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires: corosync >= %{corosync_version}
+Requires: device-mapper >= %{device_mapper_version}-%{release}
+
+%description -n cmirror
+Daemon providing device-mapper-based mirrors in a shared-storage cluster.
+
+%post -n cmirror
+%daemon_reload
+%enable -s cmirrord -t service
+
+%preun -n cmirror
+%disable -s cmirrord -t service
+
+%postun -n cmirror
+%try_restart -s cmirrord -t service
+if [ $1 = 0 ]; then
+%daemon_reload
+fi
+
+%files -n cmirror
+%defattr(-,root,root,-)
+%attr(755,root,root) /usr/sbin/cmirrord
+%{_mandir}/man8/cmirrord.8.gz
+%if %{enable_systemd}
+ %{_unitdir}/lvm2-cmirrord.service
+%else
+ %{_sysconfdir}/rc.d/init.d/cmirrord
+%endif
+
+%endif
+
+##############################################################################
+# LVM D-Bus daemon
+##############################################################################
+%if %{enable_dbusd}
+%package dbusd
+Summary: LVM2 D-Bus daemon
+License: GPLv2
+Group: System Environment/Base
+Requires: lvm2 >= %{version}-%{release}
+Requires: dbus
+Requires: python3-dbus
+Requires: python3-pyudev
+Requires: python3-gobject-base
+Requires(post): systemd-units >= %{systemd_version}
+Requires(preun): systemd-units >= %{systemd_version}
+Requires(postun): systemd-units >= %{systemd_version}
+
+%description dbusd
+
+Daemon for access to LVM2 functionality through a D-Bus interface.
+
+%post dbusd
+%systemd_post lvm2-lvmdbusd.service
+
+%preun dbusd
+%systemd_preun lvm2-lvmdbusd.service
+
+%postun dbusd
+%systemd_postun lvm2-lvmdbusd.service
+
+%files dbusd
+%defattr(555,root,root,-)
+%{_sbindir}/lvmdbusd
+%defattr(444,root,root,-)
+%{_sysconfdir}/dbus-1/system.d/com.redhat.lvmdbus1.conf
+%{_datadir}/dbus-1/system-services/com.redhat.lvmdbus1.service
+%{_mandir}/man8/lvmdbusd.8.gz
+%{_unitdir}/lvm2-lvmdbusd.service
+%{python3_sitelib}/lvmdbusd/*
+
+%endif
+
+##############################################################################
+# Testsuite subpackage
+##############################################################################
+%if %{enable_testsuite}
+%package testsuite
+Summary: LVM2 Testsuite
+License: LGPLv2
+Group: Development
+
+%description testsuite
+An extensive functional testsuite for LVM2.
+
+%files testsuite
+%defattr(-,root,root,-)
+%{_datadir}/lvm2-testsuite/
+%{_libexecdir}/lvm2-testsuite/
+%{_bindir}/lvm2-testsuite
+%endif
+
+##############################################################################
+# Device-mapper subpackages
+##############################################################################
+%package -n device-mapper
+Summary: Device mapper utility
+Version: %{device_mapper_version}
+Release: %{release}
+License: GPLv2
+Group: System Environment/Base
+URL: http://sources.redhat.com/dm
+Requires: device-mapper-libs = %{device_mapper_version}-%{release}
+Requires: util-linux >= 2.15
+%maybe Requires: %{req_udev}
+%if %{enable_udev}
+# We need dracut to install required udev rules if udev_sync
+# feature is turned on so we don't lose required notifications.
+Conflicts: dracut < 002-18
+%endif
+
+%description -n device-mapper
+This package contains the supporting userspace utility, dmsetup,
+for the kernel device-mapper.
+
+%files -n device-mapper
+%defattr(-,root,root,-)
+%doc COPYING COPYING.LIB WHATS_NEW_DM VERSION_DM README INSTALL
+%{_sbindir}/blkdeactivate
+%attr(755,root,root) %{_sbindir}/dmsetup
+%{_sbindir}/dmstats
+%{_mandir}/man8/blkdeactivate.8.gz
+%{_mandir}/man8/dmsetup.8.gz
+%{_mandir}/man8/dmstats.8.gz
+%if %{enable_dmfilemapd}
+%{_sbindir}/dmfilemapd
+%{_mandir}/man8/dmfilemapd.8.gz
+%endif
+%if %{enable_udev}
+%doc udev/12-dm-permissions.rules
+%dir %{_udevbasedir}
+%dir %{_udevdir}
+%{_udevdir}/10-dm.rules
+%{_udevdir}/13-dm-disk.rules
+%{_udevdir}/95-dm-notify.rules
+%endif
+
+%package -n device-mapper-devel
+Summary: Development libraries and headers for device-mapper
+Version: %{device_mapper_version}
+Release: %{release}
+License: LGPLv2
+Group: Development/Libraries
+Requires: device-mapper = %{device_mapper_version}-%{release}
+Requires: pkgconfig
+
+%description -n device-mapper-devel
+This package contains files needed to develop applications that use
+the device-mapper libraries.
+
+%files -n device-mapper-devel
+%defattr(-,root,root,-)
+%{_libdir}/libdevmapper.so
+%{_includedir}/libdevmapper.h
+%{_libdir}/pkgconfig/devmapper.pc
+
+%package -n device-mapper-libs
+Summary: Device-mapper shared library
+Version: %{device_mapper_version}
+Release: %{release}
+License: LGPLv2
+Group: System Environment/Libraries
+Requires: device-mapper = %{device_mapper_version}-%{release}
+
+%description -n device-mapper-libs
+This package contains the device-mapper shared library, libdevmapper.
+
+%post -n device-mapper-libs -p /sbin/ldconfig
+
+%postun -n device-mapper-libs -p /sbin/ldconfig
+
+%files -n device-mapper-libs
+%attr(755,root,root) %{_libdir}/libdevmapper.so.*
+
+%package -n device-mapper-event
+Summary: Device-mapper event daemon
+Group: System Environment/Base
+Version: %{device_mapper_version}
+Release: %{release}
+Requires: device-mapper = %{device_mapper_version}-%{release}
+Requires: device-mapper-event-libs = %{device_mapper_version}-%{release}
+%if %{enable_systemd}
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+
+%description -n device-mapper-event
+This package contains the dmeventd daemon for monitoring the state
+of device-mapper devices.
+
+%post -n device-mapper-event
+%daemon_reload
+%if %{enable_systemd}
+systemctl preset dm-event.socket > /dev/null 2>&1 || :
+%endif
+
+%preun -n device-mapper-event
+%if %{enable_systemd}
+if [ $1 = 0 ]; then
+ systemctl --no-reload disable dm-event.service dm-event.socket > /dev/null 2>&1 || :
+ systemctl stop dm-event.service dm-event.socket> /dev/null 2>&1 || :
+fi
+%endif
+
+%postun -n device-mapper-event
+if [ $1 = 0 ]; then
+%daemon_reload
+fi
+
+%posttrans -n device-mapper-event
+if [ -e %{_default_pid_dir}/dmeventd.pid ]; then
+ %{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart."
+fi
+
+%files -n device-mapper-event
+%defattr(-,root,root,-)
+%{_sbindir}/dmeventd
+%{_mandir}/man8/dmeventd.8.gz
+%if %{enable_systemd}
+%{_unitdir}/dm-event.socket
+%{_unitdir}/dm-event.service
+%endif
+
+%package -n device-mapper-event-libs
+Summary: Device-mapper event daemon shared library
+Version: %{device_mapper_version}
+Release: %{release}
+License: LGPLv2
+Group: System Environment/Libraries
+
+%description -n device-mapper-event-libs
+This package contains the device-mapper event daemon shared library,
+libdevmapper-event.
+
+%post -n device-mapper-event-libs -p /sbin/ldconfig
+
+%postun -n device-mapper-event-libs -p /sbin/ldconfig
+
+%files -n device-mapper-event-libs
+%attr(755,root,root) %{_libdir}/libdevmapper-event.so.*
+
+%package -n device-mapper-event-devel
+Summary: Development libraries and headers for the device-mapper event daemon
+Version: %{device_mapper_version}
+Release: %{release}
+License: LGPLv2
+Group: Development/Libraries
+Requires: device-mapper-event = %{device_mapper_version}-%{release}
+Requires: pkgconfig
+
+%description -n device-mapper-event-devel
+This package contains files needed to develop applications that use
+the device-mapper event library.
+
+%files -n device-mapper-event-devel
+%defattr(-,root,root,-)
+%{_libdir}/libdevmapper-event.so
+%{_includedir}/libdevmapper-event.h
+%{_libdir}/pkgconfig/devmapper-event.pc
+
diff --git a/spec/source.inc b/spec/source.inc
new file mode 100644
index 0000000..7b44ef1
--- /dev/null
+++ b/spec/source.inc
@@ -0,0 +1,199 @@
+%import macros.inc
+
+##############################################################
+# Defaults (rawhide)...
+
+%global enable_profiling 0
+%global enable_testsuite 1
+%global enable_dbusd 0
+%global enable_udev 1
+%global enable_systemd 1
+%global enable_cmirror 1
+%global enable_lvmlockd 1
+%global enable_lvmpolld 1
+%global enable_dmfilemapd 0
+#%global enable_lvmlockd_dlm 0
+#%global enable_lvmlockd_sanlock 0
+
+%if %{enable_udev}
+%service lvmpolld 1
+%endif
+
+########################################################
+# Normally clustering is maintained via resource agents
+#
+# enable service only if you know what you are doing
+#
+%if %{enable_cmirror}
+#service cmirrord 1
+%endif
+
+%global buildreq_cluster corosync-devel >= 1.99.9-1, dlm-devel >= 3.99.1-1
+%global req_cluster corosync >= 1.99.9-1, dlm >= 3.99.2-1
+
+# TODO %global req_dm_persistent device-mapper-persistent-data >= 0.1.4
+%with cache internal
+%with thin internal
+%with thin_check %{_sbindir}/thin_check
+%with thin_repair %{_sbindir}/thin_repair
+%with thin_dump %{_sbindir}/thin_dump
+# TODO disable vdo and writecache for older releases
+%with vdo internal
+%with vdo-format %{_bindir}/vdoformat
+%with writecache internal
+%with integrity internal
+
+%global buildreq_udev systemd-devel
+%global req_udev udev >= 181-1
+
+
+%if %{fedora} >= 35 || %{rhel} >= 9
+ %global enable_readline 0
+ %global enable_editline 1
+%else
+ %global enable_readline 1
+ %global enable_editline 0
+%endif
+
+%if %{fedora} >= 24 || %{rhel} >= 7
+ %service lvmlockd 1
+ %global sanlock_version 3.3.0-1
+ %global enable_lvmlockd_dlm 1
+ %global enable_lvmlockd_sanlock 1
+ %if %{rhel}
+ %ifarch i686 x86_64 s390x
+ %global buildreq_lvmlockd_dlm dlm-devel >= %{dlm_version}
+ %else
+ %global enable_lvmlockd_dlm 0
+ %endif
+ %ifarch x86_64 ppc64le ppc64 aarch64
+ %global buildreq_lvmlockd_sanlock sanlock-devel >= %{sanlock_version}
+ %else
+ %global enable_lvmlockd_sanlock 0
+ %endif
+ %endif
+%else
+ %if %{fedora} >= 22
+ %service lvmlockd 1
+ %global enable_lvmlockd_dlm 1
+ %endif
+%endif
+
+##############################################################
+
+%if %{rhel} >= 7 || %{fedora} >= 25
+ %global enable_dmfilemapd 1
+%endif
+
+##############################################################
+
+%if %{rhel} >= 8 || %{fedora} >= 23
+ %global enable_dbusd 1
+%endif
+
+%if %{enable_dbusd}
+ %global buildreq_python3_devel python3-devel
+ %global buildreq_python3_setuptools python3-setuptools
+ %global buildreq_python3_dbus python3-dbus
+ %global buildreq_python3_pyudev python3-pyudev
+%endif
+
+##############################################################
+
+%if %{fedora} == 16 || %{rhel} == 6
+%global enable_systemd 0
+
+%global buildreq_udev libudev-devel
+%global buildreq_cluster openaislib-devel >= 1.1.1-1, clusterlib-devel >= 3.0.6-1, corosynclib-devel >= 1.2.0-1
+
+%global req_udev udev >= 158-1
+%global req_cluster openais >= 1.1.1-1, cman >= 3.0.6-1, corosync >= 1.2.0-1
+
+%global _udevbasedir /lib/udev
+%global _udevdir %{_udevbasedir}/rules.d
+%endif
+
+%if %{fedora} == 16
+%with cache none
+%with thin none
+%with thin_check
+%with thin_repair
+%with thin_dump
+%endif
+
+%if %{rhel} >= 9
+%with default-use-devices-file 1
+%endif
+
+##############################################################
+
+%if %{fedora} == 17
+%global buildreq_udev systemd-devel
+%global buildreq_cluster corosync-devel >= 1.99.9-1, dlm-devel >= 3.99.1-1
+
+%global req_udev udev >= 181-1
+%global req_dm_persistent device-mapper-persistent-data >= 0.1.4
+%global req_cluster corosync >= 1.99.9-1, dlm >= 3.99.2-1
+%endif
+
+##############################################################
+# same as FC 16 above, only with older udev
+
+%if %{rhel} == 6
+%global req_udev udev >= 147-2
+%global req_dm_persistent device-mapper-persistent-data >= 0.1.4
+%endif
+
+##############################################################
+
+# Do not reset Release to 1 unless both lvm2 and device-mapper
+# versions are increased together.
+
+%global device_mapper_version 1.02.97
+
+Summary: Userland logical volume management tools
+Name: lvm2
+Version: 2.02.120
+Release: 1%{?dist}
+License: GPLv2
+Group: System Environment/Base
+URL: http://sources.redhat.com/lvm2
+Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
+Source91: source.inc
+Source92: build.inc
+Source93: packages.inc
+Source94: macros.inc
+
+BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
+BuildRequires: ncurses-devel
+%if %{enable_readline}
+BuildRequires: readline-devel
+%endif
+%if %{enable_editline}
+BuildRequires: libedit-devel
+%endif
+BuildRequires: module-init-tools
+BuildRequires: pkgconfig
+
+# Expands to nothing unless at least 2 arguments are given
+%define maybe() \
+%if %(test -n "%{?2}" && echo 1 || echo 0) \
+%* \
+%endif
+%define ifwith() \
+%if %(if echo %{with_flags} | grep -q %1; then echo 1; else echo 0; fi)
+
+%maybe BuildRequires: %{?buildreq_udev}
+%maybe BuildRequires: %{?buildreq_cluster}
+%maybe BuildRequires: %{?buildreq_lvmlockd_dlm}
+%maybe BuildRequires: %{?buildreq_lvmlockd_sanlock}
+%maybe BuildRequires: %{?buildreq_python3_devel}
+%maybe BuildRequires: %{?buildreq_python3_setuptools}
+
+%description
+LVM2 includes all of the support for handling read/write operations on
+physical volumes (hard disks, RAID-Systems, magneto optical, etc.,
+multiple devices (MD), see mdadd(8) or even loop devices, see
+losetup(8)), creating volume groups (kind of virtual disks) from one
+or more physical volumes and creating one or more logical volumes
+(kind of logical partitions) in volume groups.