mdadm/mdadm.spec
Stephan Kulow 009029502f - mdmon-takeover.fix
find-free-devnum.fix
  mapfile-rebuild.fix
  udev-offroot
   Fix various issues will installation on IMSM
  RAID arrays, booting from those arrays, and
  clean shutdown when such an array is used for '/'.
  (bnc#752107 bnc#732294 bnc#770351)

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=73
2012-09-24 05:24:58 +00:00

143 lines
4.5 KiB
RPMSpec

#
# spec file for package mdadm
#
# Copyright (c) 2012 SUSE LINUX Products 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: 3.2.5
Release: 0
BuildRequires: binutils-devel
BuildRequires: sgmltool
PreReq: %fillup_prereq %insserv_prereq /sbin/mkinitrd
Recommends: cron
Recommends: smtp_daemon
Obsoletes: raidtools
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: %{name}-%{version}.tar.bz2
Source1: Software-RAID.HOWTO.tar.bz2
Source2: sysconfig.mdadm
Source3: mdadmd
Source4: boot.md
Source5: mkinitrd-setup.sh
Source6: mkinitrd-boot.sh
Source7: mdadm.cron
Source8: mdadm.shutdown
Patch1: udev-rules.fix
Patch2: mdmon-arg.fix
Patch3: blkid-builtin.patch
Patch4: mdmon-takeover.fix
Patch5: find-free-devnum.fix
Patch6: mapfile-rebuild.fix
Patch7: udev-offroot
%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
%build
make %{?_smp_mflags} CC="%__cc" CXFLAGS="$RPM_OPT_FLAGS -Wno-error"
cd Software-RAID.HOWTO
sgml2html Software-RAID.HOWTO.sgml
sgml2txt Software-RAID.HOWTO.sgml
%install
make install DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_var}/adm/fillup-templates
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/init.d}
install -d $RPM_BUILD_ROOT/lib/udev/devices
install -m 755 %{S:4} %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/
install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh
install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh
install -d $RPM_BUILD_ROOT/etc/cron.daily
install -m 755 %{S:7} $RPM_BUILD_ROOT/etc/cron.daily/mdadm
install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/
ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd
install -d $RPM_BUILD_ROOT/lib/udev/rules.d
install -m 644 udev-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules
install -d $RPM_BUILD_ROOT/lib/systemd/system-shutdown
install -m 755 %{S:8} $RPM_BUILD_ROOT/lib/systemd/system-shutdown/mdadm.shutdown
%post
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%{fillup_and_insserv -y boot.md}
%postun
%restart_on_update mdadmd
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
echo "Skipping recreation of existing initial ramdisks, due"
echo "to presence of /var/lib/no_initrd_recreation_by_suspend"
elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%{insserv_cleanup}
%preun
%stop_on_removal mdadmd
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%attr(0755,root,root) %config %{_sysconfdir}/init.d/*
%doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs
%doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html}
%doc %{_mandir}/man?/*
/sbin/*
%dir /lib/udev
%dir /lib/udev/devices
%{_sbindir}/*
%{_var}/adm/fillup-templates/sysconfig.mdadm
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/setup-md.sh
/lib/mkinitrd/scripts/boot-md.sh
%dir /lib/udev/rules.d
/lib/udev/rules.d/64-md-raid.rules
%dir /etc
%dir /etc/cron.daily
/etc/cron.daily/mdadm
%dir /lib/systemd
%dir /lib/systemd/system-shutdown
/lib/systemd/system-shutdown/mdadm.shutdown
%changelog