mdadm/mdadm.spec
Neil Brown 850cf2857b Accepting request 517978 from home:colyli:branches:Base:System
- SLE15 continues to use mdadm-4.0, synchronize mdadm package from
  SLE12-SP3 to SLE15, re-order all patches.
- Rename the following patches, they are deleted and re-add in next
  part of patches
    0001-Generic-support-for-consistency-policy-and-PPL.patch
    0002-Detail-show-consistency-policy.patch
    0002-The-mdcheck-script-now-adds-messages-to-the-system.patch
    0003-imsm-PPL-support.patch
    0004-super1-PPL-support.patch
    0005-Add-ppl-and-no-ppl-options-for-update.patch
    0006-Grow-support-consistency-policy-change.patch
    0007-udev-md-raid-assembly.rules-Skip-non-ready-devices.patch
    0008-Retry-HOT_REMOVE_DISK-a-few-times.patch
    0009-Introduce-sys_hot_remove_disk.patch
    0010-Add-force-flag-to-hot_remove_disk.patch
    0011-Detail-handle-non-existent-arrays-better.patch
- Synchronize patches from mdadm of SLE12-SP3, the above renamed
  patches are re-add here,
    0001-Makefile-Fix-date-to-be-output-in-ISO-format.patch
    0002-imsm-fix-missing-error-message-during-migration.patch
    0003-Fix-oddity-where-mdadm-did-not-recognise-a-relative-.patch
    0004-mdadm-check-the-nodes-when-operate-clustered-array.patch
    0005-examine-tidy-up-some-code.patch
    0006-mdadm-add-man-page-for-symlinks.patch
    0007-mdadm-add-checking-clustered-bitmap-in-assemble-mode.patch
    0008-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
    0009-mdadm-Specify-enough-length-when-write-to-buffer.patch
    0010-mdadm-it-doesn-t-make-sense-to-set-bitmap-twice.patch
    0011-mdadm-Monitor-Fix-NULL-pointer-dereference-when-stat.patch
    0012-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch

OBS-URL: https://build.opensuse.org/request/show/517978
OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=150
2017-08-22 22:29:34 +00:00

243 lines
8.9 KiB
RPMSpec

#
# spec file for package mdadm
#
# Copyright (c) 2017 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/
#
Name: mdadm
Version: 4.0
Release: 0
BuildRequires: binutils-devel
BuildRequires: groff
BuildRequires: pkgconfig
BuildRequires: sgmltool
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
PreReq: %fillup_prereq /sbin/mkinitrd coreutils
Recommends: cron
Recommends: smtp_daemon
Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/
Summary: Utility for Configuring MD Setup
License: GPL-2.0
Group: System/Base
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz
Source1: Software-RAID.HOWTO.tar.bz2
Source2: sysconfig.mdadm
Source3: cron.d.mdadm
Source7: mdadm.cron
Patch1: 0001-Makefile-Fix-date-to-be-output-in-ISO-format.patch
Patch2: 0002-imsm-fix-missing-error-message-during-migration.patch
Patch3: 0003-Fix-oddity-where-mdadm-did-not-recognise-a-relative-.patch
Patch4: 0004-mdadm-check-the-nodes-when-operate-clustered-array.patch
Patch5: 0005-examine-tidy-up-some-code.patch
Patch6: 0006-mdadm-add-man-page-for-symlinks.patch
Patch7: 0007-mdadm-add-checking-clustered-bitmap-in-assemble-mode.patch
Patch8: 0008-mdadm-Add-Wimplicit-fallthrough-0-in-Makefile.patch
Patch9: 0009-mdadm-Specify-enough-length-when-write-to-buffer.patch
Patch10: 0010-mdadm-it-doesn-t-make-sense-to-set-bitmap-twice.patch
Patch11: 0011-mdadm-Monitor-Fix-NULL-pointer-dereference-when-stat.patch
Patch12: 0012-Replace-snprintf-with-strncpy-at-some-places-to-avoi.patch
Patch13: 0013-mdadm-Forced-type-conversion-to-avoid-truncation.patch
Patch14: 0014-super1-ignore-failfast-flag-for-setting-device-role.patch
Patch15: 0015-mdadm-bitmap-fixed-typos-in-comments-of-bitmap.h.patch
Patch16: 0016-udev-md-raid-assembly.rules-Skip-non-ready-devices.patch
Patch17: 0017-Retry-HOT_REMOVE_DISK-a-few-times.patch
Patch18: 0018-mdadm-Build-check-the-level-parameter-when-build-new.patch
Patch19: 0019-Introduce-sys_hot_remove_disk.patch
Patch20: 0020-Add-force-flag-to-hot_remove_disk.patch
Patch21: 0021-Detail-handle-non-existent-arrays-better.patch
Patch22: 0022-Generic-support-for-consistency-policy-and-PPL.patch
Patch23: 0023-Detail-show-consistency-policy.patch
Patch24: 0024-imsm-PPL-support.patch
Patch25: 0025-super1-PPL-support.patch
Patch26: 0026-Add-ppl-and-no-ppl-options-for-update.patch
Patch27: 0027-Grow-support-consistency-policy-change.patch
Patch28: 0028-mdadm.h-struct-mdinfo-reorganize-ppl-elements-for-be.patch
Patch29: 0029-super1-replace-hard-coded-values-with-bit-definition.patch
Patch30: 0030-mdadm-Clean-up-some-ugly-multiple-actions-on-single-.patch
Patch31: 0031-mdadm-Fixup-a-number-of-whitespace-inconsistency-cas.patch
Patch32: 0032-util-Cosmetic-changes.patch
Patch33: 0033-Grow-Fixup-a-pile-of-cosmetic-issues.patch
Patch34: 0034-Grow-Remove-unnecessary-optimization.patch
Patch35: 0035-Grow-Do-not-shadow-an-existing-variable.patch
Patch36: 0036-imsm-use-rounded-size-for-metadata-initialization.patch
Patch37: 0037-mdadm.c-fix-compile-error-switch-condition-has-boole.patch
Patch38: 0038-Create-Fixup-bad-placement-of-logical-in-multi-line-.patch
Patch39: 0039-Create-Fixup-various-whitespace-issues.patch
Patch40: 0040-mdadm.c-fix-compile-warning-mdfd-is-uninitialized.patch
Patch41: 0041-mdopen-use-parameters-new_array-to-create-arrays-whe.patch
Patch42: 0042-mdadm-manpage-update-manpage-for-readonly-parameter.patch
Patch43: 0043-mdadm-manpage-clustered-arrays-don-t-support-array-s.patch
Patch44: 0044-maps-Terminate-modes-map-correctly.patch
Patch45: 0045-Grow_continue_command-ensure-content-is-properly-ini.patch
Patch46: 0046-systemd-mdadm-last-resort-use-ConditionPathExists-in.patch
Patch47: 0047-Detail-ensure-export-names-are-acceptable-as-shell-v.patch
Patch48: 0048-Grow-set-component-size-prior-to-array-size.patch
Patch49: 0049-Grow-don-t-allow-to-enable-PPL-when-reshape-is-in-pr.patch
Patch50: 0050-Grow-don-t-allow-array-geometry-change-with-ppl-enab.patch
Patch51: 0051-IMSM-Correct-examine-output-for-4k-disks.patch
Patch52: 0052-imsm-allow-drives-in-a-container-regardless-of-secto.patch
Patch53: 0053-imsm-allocate-buffer-to-support-maximum-sector-size.patch
Patch54: 0054-imsm-don-t-allow-disks-with-different-sector-size-in.patch
Patch55: 0055-Allow-more-spare-selection-criteria.patch
Patch56: 0056-Add-sector-size-as-spare-selection-criterion.patch
Patch57: 0057-super1-fix-sb-max_dev-when-adding-a-new-disk-in-line.patch
Patch58: 0058-super1-only-set-clustered-flag-when-bitmap-is-presen.patch
Patch1000: 1000-The-mdcheck-script-now-adds-messages-to-the-system.patch
%define _udevdir %(pkg-config --variable=udevdir udev)
%define _systemdshutdowndir %{_unitdir}/../system-shutdown
%description
Mdadm is a program that can be used to control Linux md devices. It is
intended to provide all the functionality of the mdtools and raidtools
programs but with a very different interface.
%prep
%setup -q -a1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch28 -p1
%patch29 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%patch46 -p1
%patch47 -p1
%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch1000 -p1
%build
make %{?_smp_mflags} CC="%__cc" CXFLAGS="$RPM_OPT_FLAGS -Wno-error" SUSE=yes
cd Software-RAID.HOWTO
sgml2html Software-RAID.HOWTO.sgml
sgml2txt Software-RAID.HOWTO.sgml
%install
make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_unitdir} UDEVDIR=%{_udevdir} SUSE=yes
rm -rf %{buildroot}/lib/udev
install -d %{buildroot}%{_var}/adm/fillup-templates
install -d %{buildroot}/usr/share/mdadm
install -m 755 misc/mdcheck %{buildroot}/usr/share/mdadm/mdcheck
install -d %{buildroot}/etc/cron.daily
install -d %{buildroot}/etc/cron.d
install -m 755 %{S:7} %{buildroot}/etc/cron.daily/mdadm
install -m 644 %{S:3} %{buildroot}/etc/cron.d/mdadm
install -m 644 %{S:2} %{buildroot}%{_var}/adm/fillup-templates/
install -d %{buildroot}%{_systemdshutdowndir}
install -d %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rcmdmonitor
%define services mdmonitor.service
%pre
%service_add_pre %services
%post
%service_add_post %services
%{?regenerate_initrd_post}
%fillup_only
%preun
%service_del_preun %services mdmon@.service mdadm-last-resort@.service mdadm-grow-continue@.service
%postun
%service_del_postun %services
%{?regenerate_initrd_post}
%posttrans
%{?regenerate_initrd_posttrans}
%files
%defattr(-,root,root)
%doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs
%doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html}
%doc %{_mandir}/man?/*
/sbin/*
%{_sbindir}/rcmdmonitor
%dir /usr/share/mdadm
/usr/share/mdadm/*
%{_var}/adm/fillup-templates/sysconfig.mdadm
%{_udevdir}/rules.d/63-md-raid-arrays.rules
%{_udevdir}/rules.d/64-md-raid-assembly.rules
%dir /etc/cron.daily
/etc/cron.daily/mdadm
%dir /etc/cron.d
%config /etc/cron.d/mdadm
# %%{_systemdshutdowndir}/ is not owned by all versions of systemd-mini.
# But we really do not want to pull in a full systemd, so we rather just own
# that directory by ourselves too. After all, this is allowed.
%dir %{_systemdshutdowndir}
%{_systemdshutdowndir}/mdadm.shutdown
%{_unitdir}/mdmon@.service
%{_unitdir}/mdmonitor.service
%{_unitdir}/mdadm-last-resort@.timer
%{_unitdir}/mdadm-last-resort@.service
%{_unitdir}/mdadm-grow-continue@.service
%dir %{_unitdir}/../scripts
%{_unitdir}/../scripts/mdadm_env.sh
%changelog