3 %bcond_with initrd # don't build initrd version
4 %bcond_with dietlibc # link initrd version with static glibc instead of dietlibc
5 %bcond_without tests # don't perform "make test"
7 Summary: Tool for creating and maintaining software RAID devices
8 Summary(pl.UTF-8): Narzędzie do tworzenia i obsługi programowych macierzy RAID
14 Source0: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz
15 # Source0-md5: a42def84e31734a529111394f2289e0e
17 Source2: %{name}.sysconfig
19 Source4: %{name}-checkarray
20 Patch0: %{name}-udev-rules-paths.patch
21 URL: https://www.kernel.org/pub/linux/utils/raid/mdadm/
22 BuildRequires: corosync-devel
23 BuildRequires: dlm-devel
25 BuildRequires: rpmbuild(macros) >= 1.671
26 BuildRequires: tar >= 1:1.22
30 BuildRequires: dietlibc-static
32 BuildRequires: glibc-static
35 Requires(post,preun): /sbin/chkconfig
36 Requires: /sbin/chkconfig
37 Requires: rc-scripts >= 0.4.2.4-2
39 %{!?with_initrd:Obsoletes: mdadm-initrd < %{version}-%{release}}
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %define _sbindir /sbin
46 This package includes tool you need to set up and maintain a software
47 RAID device under Linux. It's thought as an alternative to raidtools
50 %description -l pl.UTF-8
51 Pakiet ten zawiera narzędzie potrzebne do tworzenia i obsługi
52 programowych macierzy RAID. Program ten jest pomyślany jako
53 alternatywa dla pakietu raidtools.
56 Summary: Tool for maintaining software RAID devices - initrd version
57 Summary(pl.UTF-8): Narzędzie do obsługi programowych macierzy RAID, wersja dla initrd
59 Conflicts: geninitrd < 10000.10
62 Tool for maintaining software RAID devices - statically linked for
65 %description initrd -l pl.UTF-8
66 Narzędzie do zarządzania programowymi macierzami RAID - statycznie
67 skonsolidowane na potrzeby initrd.
77 CC="diet %{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags} -Os -static" \
79 %{__mv} mdadm initrd-mdadm
81 %{__make} mdadm.static \
83 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
84 LDFLAGS="%{rpmldflags}"
85 %{__mv} mdadm.static initrd-mdadm
90 %{__make} all mdadm mdadm.8 \
92 CFLAGS="%{rpmcflags} %{rpmcppflags}" \
93 LDFLAGS="%{rpmldflags}" \
94 SYSCONFDIR="%{_sysconfdir}"
96 %{?with_tests:%{__make} test}
99 rm -rf $RPM_BUILD_ROOT
100 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8}} \
101 $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.d}
103 %{__make} install install-udev \
104 DESTDIR=$RPM_BUILD_ROOT
107 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
108 install -p initrd-mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdadm
109 ln -s mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdctl
112 cp -p mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf
114 ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl
116 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
117 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
119 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/mdadm-checkarray
120 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mdadm-checkarray
123 rm -rf $RPM_BUILD_ROOT
126 /sbin/chkconfig --add %{name}
127 %service mdadm restart "RAID monitoring"
130 if [ "$1" = "0" ]; then
132 /sbin/chkconfig --del mdadm
139 %defattr(644,root,root,755)
140 %doc ANNOUNCE* ChangeLog TODO
141 %attr(755,root,root) %{_sbindir}/mdadm
142 %attr(755,root,root) %{_sbindir}/mdadm-checkarray
143 %attr(755,root,root) %{_sbindir}/mdctl
144 %attr(755,root,root) %{_sbindir}/mdmon
145 /lib/udev/rules.d/01-md-raid-creating.rules
146 /lib/udev/rules.d/63-md-raid-arrays.rules
147 /lib/udev/rules.d/64-md-raid-assembly.rules
148 /lib/udev/rules.d/69-md-clustered-confirm-device.rules
149 %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mdadm.conf
150 %{_mandir}/man4/md.4*
151 %{_mandir}/man5/mdadm.conf.5*
152 %{_mandir}/man8/mdadm.8*
153 %{_mandir}/man8/mdmon.8*
154 %attr(754,root,root) /etc/rc.d/init.d/%{name}
155 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
156 %config(noreplace) %attr(640,root,root) /etc/cron.d/mdadm-checkarray
160 %defattr(644,root,root,755)
161 %attr(755,root,root) %{_libdir}/initrd/mdadm
162 %attr(755,root,root) %{_libdir}/initrd/mdctl