From 477a705255f3f2502c3c7d458c980df5e55840ba Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 24 Dec 2020 21:36:58 +0100 Subject: [PATCH] Spec file cleanup and simplification --- lvm2.spec | 129 ++++++++++++++++++++---------------------------------- 1 file changed, 48 insertions(+), 81 deletions(-) diff --git a/lvm2.spec b/lvm2.spec index 8af0ce9..4b58aa5 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -39,15 +39,6 @@ %endif %endif -%if %{enable_cluster} - %global configure_cluster --with-cluster=internal - %if %{enable_cmirror} - %global configure_cmirror --enable-cmirrord - %endif -%else - %global configure_cluster --with-cluster=internal -%endif - # Do not reset Release to 1 unless both lvm2 and device-mapper # versions are increased together. @@ -59,8 +50,8 @@ Epoch: %{rhel} Version: 2.03.10 Release: 1%{?dist} License: GPLv2 -URL: http://sourceware.org/lvm2 -Source0: ftp://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz +URL: https://sourceware.org/lvm2/ +Source0: https://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz Patch0: lvm2-set-default-preferred_names.patch BuildRequires: gcc @@ -127,49 +118,45 @@ or more physical volumes and creating one or more logical volumes %global _udevdir %{_prefix}/lib/udev/rules.d -%global configure_udev --with-udevdir=%{_udevdir} --enable-udev_sync - -%if %{enable_cache} -%global configure_cache --with-cache=internal -%endif - -%if %{enable_thin} -%global configure_thin --with-thin=internal -%endif - -%if %{enable_lockd_dlm} -%global configure_lockd_dlm --enable-lvmlockd-dlm --enable-lvmlockd-dlmcontrol -%endif -%if %{enable_lockd_sanlock} -%global configure_lockd_sanlock --enable-lvmlockd-sanlock -%endif - -%if %{enable_lvmpolld} -%global configure_lvmpolld --enable-lvmpolld -%endif - -%if %{enable_lvmdbusd} -%global configure_lvmdbusd --enable-dbus-service --enable-notify-dbus -%endif - -%if %{enable_dmfilemapd} -%global configure_dmfilemapd --enable-dmfilemapd -%endif - -%if %{enable_vdo} -%global configure_vdo --with-vdo=internal --with-vdo-format=%{_bindir}/vdoformat -%endif - -%if %{enable_writecache} -%global configure_writecache --with-writecache=internal -%endif - # NOTE: Using CFLAGS and LDFLAGS would override the fedora default flags, thus # using paths here... export CPATH="%{_includedir}/readline5" export LIBRARY_PATH="%{_libdir}/readline5" -%configure --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} --enable-fsadm --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_lvmdbusd} %{?configure_dmfilemapd} %{?configure_writecache} %{?configure_vdo} --disable-silent-rules +%configure \ + --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} \ + --enable-fsadm \ + --enable-write_install \ + --with-user= \ + --with-group= \ + --with-device-uid=0 \ + --with-device-gid=6 \ + --with-device-mode=0660 \ + --enable-pkgconfig \ + --enable-cmdlib \ + --enable-dmeventd \ + --enable-blkid_wiping \ +%if %{enable_cluster} + --with-cluster=internal \ + %{?enable_cmirror:--enable-cmirrord} \ +%else + --with-cluster=internal \ +%endif + --with-udevdir=%{_udevdir} --enable-udev_sync \ + %{?enable_thin:--with-thin=internal} \ + %{?enable_cache:--with-cache=internal} \ + %{?enable_lvmpolld:--enable-lvmpolld} \ + %{?enable_lockd_dlm:--enable-lvmlockd-dlm --enable-lvmlockd-dlmcontrol} \ + %{?enable_lockd_sanlock:--enable-lvmlockd-sanlock} \ + %{?enable_lvmdbusd:--enable-dbus-service --enable-notify-dbus} \ + %{?enable_dmfilemapd:--enable-dmfilemapd} \ + %{?enable_writecache:--with-writecache=internal} \ + %{?enable_vdo:--with-vdo=internal --with-vdo-format=%{_bindir}/vdoformat} \ + --disable-silent-rules %make_build @@ -222,13 +209,11 @@ systemctl start lvm2-lvmpolld.socket >/dev/null 2>&1 || : /bin/systemctl try-restart lvm2-monitor.service > /dev/null 2>&1 || : %files -%{!?_licensedir:%global license %%doc} %license COPYING COPYING.LIB %doc README VERSION WHATS_NEW %doc doc/lvm_fault_handling.txt # Main binaries -%defattr(555,root,root,-) %{_sbindir}/fsadm %{_sbindir}/lvm %{_sbindir}/lvmconfig @@ -238,7 +223,6 @@ systemctl start lvm2-lvmpolld.socket >/dev/null 2>&1 || : %endif # Other files -%defattr(444,root,root,-) %{_sbindir}/lvchange %{_sbindir}/lvconvert %{_sbindir}/lvcreate @@ -346,8 +330,8 @@ systemctl start lvm2-lvmpolld.socket >/dev/null 2>&1 || : %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 +%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf +%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 @@ -368,7 +352,7 @@ systemctl start lvm2-lvmpolld.socket >/dev/null 2>&1 || : %{_unitdir}/blk-availability.service %{_unitdir}/lvm2-monitor.service %{_unitdir}/lvm2-pvscan@.service -%attr(555, -, -) %{_prefix}/lib/systemd/system-generators/lvm2-activation-generator +%{_prefix}/lib/systemd/system-generators/lvm2-activation-generator %if %{enable_lvmpolld} %{_unitdir}/lvm2-lvmpolld.socket %{_unitdir}/lvm2-lvmpolld.service @@ -390,7 +374,6 @@ This package contains files needed to develop applications that use the lvm2 libraries. %files devel -%defattr(444,root,root,-) %{_libdir}/liblvm2cmd.so %{_libdir}/libdevmapper-event-lvm2.so %{_includedir}/lvm2cmd.h @@ -406,9 +389,7 @@ This package contains shared lvm2 libraries for applications. %ldconfig_scriptlets libs %files libs -%{!?_licensedir:%global license %%doc} %license COPYING.LIB -%defattr(555,root,root,-) %{_libdir}/liblvm2cmd.so.* %{_libdir}/libdevmapper-event-lvm2.so.* %dir %{_libdir}/device-mapper @@ -458,9 +439,8 @@ LVM commands use lvmlockd to coordinate access to shared storage. %systemd_postun lvmlockd.service lvmlocks.service %files lockd -%defattr(444,root,root,-) -%%attr(555, -, -) %{_sbindir}/lvmlockd -%%attr(555, -, -) %{_sbindir}/lvmlockctl +%{_sbindir}/lvmlockd +%{_sbindir}/lvmlockctl %{_mandir}/man8/lvmlockd.8.gz %{_mandir}/man8/lvmlockctl.8.gz %{_unitdir}/lvmlockd.service @@ -485,9 +465,8 @@ Requires: resource-agents >= %{resource_agents_version} Daemon providing device-mapper-based mirrors in a shared-storage cluster. %files -n cmirror -%defattr(555,root,root,-) %{_sbindir}/cmirrord -%attr(444, -, -) %{_mandir}/man8/cmirrord.8.gz +%{_mandir}/man8/cmirrord.8.gz ############################################################################## # Cmirror-standalone subpackage @@ -513,7 +492,6 @@ involvement (e.g. pacemaker). %systemd_postun lvm2-cmirrord.service %files -n cmirror-standalone -%defattr(444,root,root,-) %{_unitdir}/lvm2-cmirrord.service %endif @@ -551,9 +529,7 @@ Daemon for access to LVM2 functionality through a D-Bus interface. %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 @@ -569,7 +545,7 @@ Daemon for access to LVM2 functionality through a D-Bus interface. Summary: Device mapper utility Version: %{device_mapper_version} License: GPLv2 -URL: http://sources.redhat.com/dm +URL: https://www.sourceware.org/dm/ Requires: device-mapper-libs = %{?epoch}:%{device_mapper_version}-%{release} Requires: util-linux >= %{util_linux_version} Requires: systemd >= %{systemd_version} @@ -582,19 +558,17 @@ This package contains the supporting userspace utility, dmsetup, for the kernel device-mapper. %files -n device-mapper -%{!?_licensedir:%global license %%doc} %license COPYING COPYING.LIB %doc WHATS_NEW_DM VERSION_DM README %doc udev/12-dm-permissions.rules -%defattr(444,root,root,-) -%attr(555, -, -) %{_sbindir}/dmsetup -%attr(555, -, -) %{_sbindir}/blkdeactivate -%attr(555, -, -) %{_sbindir}/dmstats +%{_sbindir}/dmsetup +%{_sbindir}/blkdeactivate +%{_sbindir}/dmstats %{_mandir}/man8/dmsetup.8.gz %{_mandir}/man8/dmstats.8.gz %{_mandir}/man8/blkdeactivate.8.gz %if %{enable_dmfilemapd} -%attr(555, -, -) %{_sbindir}/dmfilemapd +%{_sbindir}/dmfilemapd %{_mandir}/man8/dmfilemapd.8.gz %endif %{_udevdir}/10-dm.rules @@ -613,7 +587,6 @@ This package contains files needed to develop applications that use the device-mapper libraries. %files -n device-mapper-devel -%defattr(444,root,root,-) %{_libdir}/libdevmapper.so %{_includedir}/libdevmapper.h %{_libdir}/pkgconfig/devmapper.pc @@ -630,9 +603,7 @@ This package contains the device-mapper shared library, libdevmapper. %ldconfig_scriptlets -n device-mapper-libs %files -n device-mapper-libs -%{!?_licensedir:%global license %%doc} %license COPYING COPYING.LIB -%defattr(555,root,root,-) %{_libdir}/libdevmapper.so.* %package -n device-mapper-event @@ -663,8 +634,7 @@ fi %systemd_preun dm-event.service dm-event.socket %files -n device-mapper-event -%defattr(444,root,root,-) -%attr(555, -, -) %{_sbindir}/dmeventd +%{_sbindir}/dmeventd %{_mandir}/man8/dmeventd.8.gz %{_unitdir}/dm-event.socket %{_unitdir}/dm-event.service @@ -681,9 +651,7 @@ libdevmapper-event. %ldconfig_scriptlets -n device-mapper-event-libs %files -n device-mapper-event-libs -%{!?_licensedir:%global license %%doc} %license COPYING.LIB -%defattr(555,root,root,-) %{_libdir}/libdevmapper-event.so.* %package -n device-mapper-event-devel @@ -698,7 +666,6 @@ This package contains files needed to develop applications that use the device-mapper event library. %files -n device-mapper-event-devel -%defattr(444,root,root,-) %{_libdir}/libdevmapper-event.so %{_includedir}/libdevmapper-event.h %{_libdir}/pkgconfig/devmapper-event.pc