]>
Commit | Line | Data |
---|---|---|
a5d8d7ae JB |
1 | # |
2 | # Conditional build: | |
26a8f59c | 3 | %bcond_with initrd # don't build initrd version |
dbd234d8 JB |
4 | %bcond_with dietlibc # link initrd version with static glibc instead of dietlibc |
5 | %bcond_without tests # don't perform "make test" | |
ec5e5238 | 6 | |
222c6368 | 7 | Summary: Tool for creating and maintaining software RAID devices |
3cdd0a55 | 8 | Summary(pl.UTF-8): Narzędzie do tworzenia i obsługi programowych macierzy RAID |
222c6368 | 9 | Name: mdadm |
5b3e3ab1 AG |
10 | Version: 4.2 |
11 | Release: 0.1 | |
cf3ee1c1 | 12 | License: GPL v2+ |
222c6368 | 13 | Group: Base |
063f2ee4 | 14 | Source0: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz |
5b3e3ab1 | 15 | # Source0-md5: a304eb0a978ca81045620d06547050a6 |
731c35dc AM |
16 | Source1: %{name}.init |
17 | Source2: %{name}.sysconfig | |
ac4c4225 AM |
18 | Source3: %{name}.cron |
19 | Source4: %{name}-checkarray | |
aa02881c AM |
20 | Source5: cronjob-%{name}.timer |
21 | Source6: cronjob-%{name}.service | |
063f2ee4 | 22 | URL: https://www.kernel.org/pub/linux/utils/raid/mdadm/ |
5b3e3ab1 | 23 | BuildRequires: corosync-devel |
7a204919 | 24 | BuildRequires: dlm-devel |
199e46f6 | 25 | BuildRequires: groff |
cb64f53e JB |
26 | BuildRequires: rpmbuild(macros) >= 1.671 |
27 | BuildRequires: tar >= 1:1.22 | |
28 | BuildRequires: xz | |
831f01d8 | 29 | %if %{with initrd} |
569c9a5b | 30 | %if %{with dietlibc} |
cbea7db6 | 31 | BuildRequires: dietlibc-static |
569c9a5b JR |
32 | %else |
33 | BuildRequires: glibc-static | |
34 | %endif | |
831f01d8 | 35 | %endif |
35235564 | 36 | Requires(post,preun): /sbin/chkconfig |
9a1649e6 | 37 | Requires: /sbin/chkconfig |
34f0cb50 | 38 | Requires: rc-scripts >= 0.4.2.4-2 |
79d5f6a2 | 39 | Requires: systemd-units >= 38 |
668ee27c | 40 | Suggests: cronjobs |
26a8f59c | 41 | %{!?with_initrd:Obsoletes: mdadm-initrd < %{version}-%{release}} |
ec5e5238 | 42 | Obsoletes: mdctl |
222c6368 AM |
43 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
44 | ||
45 | %define _sbindir /sbin | |
46 | ||
47 | %description | |
48 | This package includes tool you need to set up and maintain a software | |
49 | RAID device under Linux. It's thought as an alternative to raidtools | |
50 | package. | |
51 | ||
3bc8fb0b JR |
52 | %description -l pl.UTF-8 |
53 | Pakiet ten zawiera narzędzie potrzebne do tworzenia i obsługi | |
54 | programowych macierzy RAID. Program ten jest pomyślany jako | |
222c6368 AM |
55 | alternatywa dla pakietu raidtools. |
56 | ||
57 | %package initrd | |
58 | Summary: Tool for maintaining software RAID devices - initrd version | |
3cdd0a55 | 59 | Summary(pl.UTF-8): Narzędzie do obsługi programowych macierzy RAID, wersja dla initrd |
222c6368 | 60 | Group: Base |
6248b885 | 61 | Conflicts: geninitrd < 12787 |
222c6368 AM |
62 | |
63 | %description initrd | |
a5d8d7ae | 64 | Tool for maintaining software RAID devices - statically linked for |
222c6368 AM |
65 | initrd. |
66 | ||
3bc8fb0b JR |
67 | %description initrd -l pl.UTF-8 |
68 | Narzędzie do zarządzania programowymi macierzami RAID - statycznie | |
71e62fb5 | 69 | skonsolidowane na potrzeby initrd. |
222c6368 AM |
70 | |
71 | %prep | |
72 | %setup -q | |
222c6368 AM |
73 | |
74 | %build | |
1895fb02 | 75 | %if %{with initrd} |
5898e590 | 76 | %if %{with dietlibc} |
cbea7db6 | 77 | %{__make} mdadm \ |
ad809de3 | 78 | CC="diet %{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags} -Os -static" \ |
cbea7db6 | 79 | CWFLAGS="-Wall" |
915e9155 | 80 | %{__mv} mdadm initrd-mdadm |
831f01d8 JB |
81 | %else |
82 | %{__make} mdadm.static \ | |
83 | CC="%{__cc}" \ | |
ad809de3 | 84 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
831f01d8 | 85 | LDFLAGS="%{rpmldflags}" |
915e9155 | 86 | %{__mv} mdadm.static initrd-mdadm |
831f01d8 | 87 | %endif |
1895fb02 AM |
88 | %{__make} clean |
89 | %endif | |
222c6368 | 90 | |
d8df6751 | 91 | %{__make} all mdadm mdadm.8 \ |
222c6368 | 92 | CC="%{__cc}" \ |
ad809de3 | 93 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
222c6368 AM |
94 | LDFLAGS="%{rpmldflags}" \ |
95 | SYSCONFDIR="%{_sysconfdir}" | |
96 | ||
f240d179 AM |
97 | %{?with_tests:%{__make} test} |
98 | ||
222c6368 AM |
99 | %install |
100 | rm -rf $RPM_BUILD_ROOT | |
79d5f6a2 JR |
101 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8}} \ |
102 | $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,cron.d},%{systemdunitdir}} | |
222c6368 | 103 | |
aa02881c AM |
104 | %{__make} install install-udev install-systemd \ |
105 | DESTDIR=$RPM_BUILD_ROOT | |
106 | ||
1895fb02 | 107 | %if %{with initrd} |
569c9a5b | 108 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd |
ec5e5238 | 109 | install -p initrd-mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdadm |
569c9a5b | 110 | ln -s mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdctl |
1895fb02 AM |
111 | %endif |
112 | ||
ec5e5238 | 113 | cp -p mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf |
222c6368 AM |
114 | |
115 | ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl | |
222c6368 | 116 | |
ec5e5238 ER |
117 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
118 | cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
a5d8d7ae | 119 | |
ec5e5238 ER |
120 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/mdadm-checkarray |
121 | install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mdadm-checkarray | |
aa02881c AM |
122 | install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-mdadm.timer |
123 | install -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/cronjob-mdadm.service | |
79d5f6a2 | 124 | |
555514b3 JK |
125 | ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/mdadm.service |
126 | ||
222c6368 AM |
127 | %clean |
128 | rm -rf $RPM_BUILD_ROOT | |
129 | ||
731c35dc AM |
130 | %post |
131 | /sbin/chkconfig --add %{name} | |
cf52b7c1 | 132 | %service mdadm restart "RAID monitoring" |
555514b3 | 133 | %systemd_post mdmonitor.service cronjob-mdadm.timer |
731c35dc AM |
134 | |
135 | %preun | |
136 | if [ "$1" = "0" ]; then | |
cf52b7c1 | 137 | %service mdadm stop |
5408d455 | 138 | /sbin/chkconfig --del mdadm |
731c35dc | 139 | fi |
555514b3 | 140 | %systemd_preun mdmonitor.service cronjob-mdadm.timer |
79d5f6a2 JR |
141 | |
142 | %postun | |
143 | /sbin/ldconfig | |
144 | %systemd_reload | |
145 | ||
668ee27c JK |
146 | %triggerpostun -- %{name} < 4.0-3 |
147 | %systemd_service_enable cronjob-mdadm.timer | |
148 | ||
222c6368 AM |
149 | %files |
150 | %defattr(644,root,root,755) | |
02cbc2b1 | 151 | %doc ANNOUNCE* ChangeLog TODO |
dbd234d8 JB |
152 | %attr(755,root,root) %{_sbindir}/mdadm |
153 | %attr(755,root,root) %{_sbindir}/mdadm-checkarray | |
154 | %attr(755,root,root) %{_sbindir}/mdctl | |
aa02881c AM |
155 | %attr(755,root,root) %{_sbindir}/mdmon |
156 | %{systemdunitdir}-shutdown/mdadm.shutdown | |
157 | %{systemdunitdir}/mdadm-grow-continue@.service | |
158 | %{systemdunitdir}/mdadm-last-resort@.service | |
159 | %{systemdunitdir}/mdadm-last-resort@.timer | |
555514b3 | 160 | %{systemdunitdir}/mdadm.service |
aa02881c AM |
161 | %{systemdunitdir}/mdmon@.service |
162 | %{systemdunitdir}/mdmonitor.service | |
668ee27c JK |
163 | %{systemdunitdir}/cronjob-mdadm.service |
164 | %{systemdunitdir}/cronjob-mdadm.timer | |
5b3e3ab1 AG |
165 | %{systemdunitdir}/mdcheck_continue.service |
166 | %{systemdunitdir}/mdcheck_continue.timer | |
167 | %{systemdunitdir}/mdcheck_start.service | |
168 | %{systemdunitdir}/mdcheck_start.timer | |
169 | %{systemdunitdir}/mdmonitor-oneshot.service | |
170 | %{systemdunitdir}/mdmonitor-oneshot.timer | |
b0b728ab | 171 | /lib/udev/rules.d/01-md-raid-creating.rules |
aa02881c AM |
172 | /lib/udev/rules.d/63-md-raid-arrays.rules |
173 | /lib/udev/rules.d/64-md-raid-assembly.rules | |
b0b728ab | 174 | /lib/udev/rules.d/69-md-clustered-confirm-device.rules |
02cbc2b1 | 175 | %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mdadm.conf |
aa02881c | 176 | %{_mandir}/man4/md.4* |
dbd234d8 | 177 | %{_mandir}/man5/mdadm.conf.5* |
6c350987 | 178 | %{_mandir}/man8/mdadm.8* |
dbd234d8 | 179 | %{_mandir}/man8/mdmon.8* |
731c35dc | 180 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
02cbc2b1 | 181 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
ac4c4225 AM |
182 | %config(noreplace) %attr(640,root,root) /etc/cron.d/mdadm-checkarray |
183 | ||
1895fb02 | 184 | %if %{with initrd} |
222c6368 AM |
185 | %files initrd |
186 | %defattr(644,root,root,755) | |
569c9a5b | 187 | %attr(755,root,root) %{_libdir}/initrd/mdadm |
569c9a5b | 188 | %attr(755,root,root) %{_libdir}/initrd/mdctl |
222c6368 | 189 | %endif |