From 582b049f7ffcba9ed22e9437378c0fef52664868 Mon Sep 17 00:00:00 2001 From: OBS User jankara Date: Fri, 31 May 2019 12:03:49 +0000 Subject: [PATCH] - Package e2scrub unit files and separate scrubbing bits into a separate subpackage e2fsprogs-scrub Rev filesystems/112 Md5 749ce58032412ca6b2e59728979ae814 2019-05-31 12:03:49 jankara 706656 --- e2fsprogs.changes | 6 ++++ e2fsprogs.spec | 89 ++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 90 insertions(+), 5 deletions(-) diff --git a/e2fsprogs.changes b/e2fsprogs.changes index bf8eadd..0eee308 100644 --- a/e2fsprogs.changes +++ b/e2fsprogs.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri May 31 10:42:41 UTC 2019 - Jan Kara + +- Package e2scrub unit files and separate scrubbing bits into a separate + subpackage e2fsprogs-scrub + ------------------------------------------------------------------- Fri May 31 03:50:23 UTC 2019 - seanlew@opensuse.org diff --git a/e2fsprogs.spec b/e2fsprogs.spec index 0dd565d..aa07f12 100644 --- a/e2fsprogs.spec +++ b/e2fsprogs.spec @@ -23,6 +23,11 @@ Name: e2fsprogs # Hint for ZYPP Supplements: filesystem(ext2) filesystem(ext3) filesystem(ext4) %endif +%if 0%{?suse_version} >= 1210 +%bcond_without systemd +%else +%bcond_with systemd +%endif BuildRequires: autoconf BuildRequires: automake BuildRequires: libblkid-devel @@ -71,6 +76,7 @@ Url: http://e2fsprogs.sourceforge.net Requires(post): coreutils Requires: libcom_err2 >= %{version} Requires: libext2fs2 >= %{version} +Suggests: e2fsprogs-scrub Source: http://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v%{version}/e2fsprogs-%{version}.tar.xz Source2: README.SUSE Source3: baselibs.conf @@ -105,6 +111,27 @@ Requires: libuuid-devel %description devel Dummy development package for backwards compatibility. +%if %{build_mini} +%package -n e2fsprogs-scrub-mini +%else +%package -n e2fsprogs-scrub +%endif +Summary: Ext2fs scrubbing scripts and service files +License: GPL-2.0-only +Group: System/Filesystems +%if %{with systemd} +BuildRequires: systemd-rpm-macros +%{?systemd_requires} +%endif +Requires: e2fsprogs +Requires: lvm2 +Requires: postfix +Requires: util-linux + +%description -n e2fsprogs-scrub +Scripts and systemd service files for background scrubbing of LVM volumes +with ext2, ext3, and ext4 filesystems. + %if %{build_mini} %package -n libext2fs2-mini %else @@ -228,15 +255,14 @@ cp %{SOURCE2} . %build autoreconf --force --install %configure \ - --disable-evms \ --with-root-prefix='' \ --enable-elf-shlibs \ --disable-libblkid \ --disable-libuuid \ --disable-uuidd \ --disable-fsck \ - --enable-static \ --without-crond-dir \ + --with-systemd-unit-dir=%{?_unitdir} \ CFLAGS="$RPM_OPT_FLAGS" %if %{build_mini} rm -rf doc @@ -280,6 +306,16 @@ for libName in $LIBNAMES; do ln -s %{_libdir}/$libName %{buildroot}/%{_lib}; done #EndUsrMerge + +%if %{with systemd} +%if %{build_mini} +%pre -n e2fsprogs-scrub-mini +%else +%pre -n e2fsprogs-scrub +%endif +%service_add_pre e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service +%endif + %post /sbin/ldconfig %if ! %{build_mini} @@ -287,6 +323,24 @@ done %{?regenerate_initrd_post} %endif +%if %{with systemd} +%if %{build_mini} +%post -n e2fsprogs-scrub-mini +%else +%post -n e2fsprogs-scrub +%endif +%service_add_post e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service +%endif + +%if %{with systemd} +%if %{build_mini} +%preun -n e2fsprogs-scrub-mini +%else +%preun -n e2fsprogs-scrub +%endif +%service_del_preun e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service +%endif + %postun /sbin/ldconfig %if ! %{build_mini} @@ -294,6 +348,15 @@ done %{?regenerate_initrd_post} %endif +%if %{with systemd} +%if %{build_mini} +%postun -n e2fsprogs-scrub-mini +%else +%postun -n e2fsprogs-scrub +%endif +%service_del_postun e2scrub@.service e2scrub_all.service e2scrub_all.timer e2scrub_fail@.service e2scrub_reap.service +%endif + %if ! %{build_mini} %posttrans %{?regenerate_initrd_posttrans} @@ -330,7 +393,6 @@ done %license NOTICE %endif %config /etc/mke2fs.conf -%config /etc/e2scrub.conf #UsrMerge /sbin/badblocks /sbin/debugfs @@ -376,8 +438,6 @@ done %{_sbindir}/e2freefrag %{_sbindir}/e4defrag %{_sbindir}/e4crypt -%{_sbindir}/e2scrub -%{_sbindir}/e2scrub_all %if ! %{build_mini} %{_infodir}/libext2fs.info.gz %endif @@ -392,6 +452,25 @@ done %defattr(-,root,root) %doc README.SUSE +%if %{build_mini} +%files -n e2fsprogs-scrub-mini +%else +%files -n e2fsprogs-scrub +%endif +%defattr(-,root,root) +%config /etc/e2scrub.conf +%{_sbindir}/e2scrub +%{_sbindir}/e2scrub_all +%if %{with systemd} +%{_libdir}/e2fsprogs/ +%{_libdir}/e2fsprogs/e2scrub_fail +%{_unitdir}/e2scrub@.service +%{_unitdir}/e2scrub_all.service +%{_unitdir}/e2scrub_all.timer +%{_unitdir}/e2scrub_fail@.service +%{_unitdir}/e2scrub_reap.service +%endif + %if %{build_mini} %files -n libext2fs2-mini %else