]>
Commit | Line | Data |
---|---|---|
a5d8d7ae JB |
1 | # |
2 | # Conditional build: | |
2bcf3f9f | 3 | %bcond_without 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" | |
ffa7a82c | 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 |
f06941a1 | 10 | Version: 3.2.6 |
92d79374 | 11 | Release: 1 |
cf3ee1c1 | 12 | License: GPL v2+ |
222c6368 | 13 | Group: Base |
ec2b098f | 14 | Source0: http://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.bz2 |
f06941a1 | 15 | # Source0-md5: 3e255dc71e5144bbcb872788ca647267 |
731c35dc AM |
16 | Source1: %{name}.init |
17 | Source2: %{name}.sysconfig | |
ac4c4225 AM |
18 | Source3: %{name}.cron |
19 | Source4: %{name}-checkarray | |
c8e04d8f | 20 | URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/ |
199e46f6 JB |
21 | BuildRequires: groff |
22 | BuildRequires: rpmbuild(macros) >= 1.213 | |
831f01d8 | 23 | %if %{with initrd} |
569c9a5b | 24 | %if %{with dietlibc} |
cbea7db6 | 25 | BuildRequires: dietlibc-static |
569c9a5b JR |
26 | %else |
27 | BuildRequires: glibc-static | |
28 | %endif | |
831f01d8 | 29 | %endif |
cf52b7c1 | 30 | BuildRequires: rpmbuild(macros) >= 1.268 |
35235564 | 31 | Requires(post,preun): /sbin/chkconfig |
9a1649e6 | 32 | Requires: /sbin/chkconfig |
34f0cb50 | 33 | Requires: rc-scripts >= 0.4.2.4-2 |
222c6368 AM |
34 | Obsoletes: mdctl |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %define _sbindir /sbin | |
38 | ||
39 | %description | |
40 | This package includes tool you need to set up and maintain a software | |
41 | RAID device under Linux. It's thought as an alternative to raidtools | |
42 | package. | |
43 | ||
3bc8fb0b JR |
44 | %description -l pl.UTF-8 |
45 | Pakiet ten zawiera narzędzie potrzebne do tworzenia i obsługi | |
46 | programowych macierzy RAID. Program ten jest pomyślany jako | |
222c6368 AM |
47 | alternatywa dla pakietu raidtools. |
48 | ||
49 | %package initrd | |
50 | Summary: Tool for maintaining software RAID devices - initrd version | |
3cdd0a55 | 51 | Summary(pl.UTF-8): Narzędzie do obsługi programowych macierzy RAID, wersja dla initrd |
222c6368 | 52 | Group: Base |
40ad195a | 53 | Conflicts: geninitrd < 10000.10 |
222c6368 AM |
54 | |
55 | %description initrd | |
a5d8d7ae | 56 | Tool for maintaining software RAID devices - statically linked for |
222c6368 AM |
57 | initrd. |
58 | ||
3bc8fb0b JR |
59 | %description initrd -l pl.UTF-8 |
60 | Narzędzie do zarządzania programowymi macierzami RAID - statycznie | |
71e62fb5 | 61 | skonsolidowane na potrzeby initrd. |
222c6368 AM |
62 | |
63 | %prep | |
64 | %setup -q | |
222c6368 AM |
65 | |
66 | %build | |
1895fb02 | 67 | %if %{with initrd} |
5898e590 | 68 | %if %{with dietlibc} |
cbea7db6 | 69 | %{__make} mdadm \ |
ad809de3 | 70 | CC="diet %{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags} -Os -static" \ |
cbea7db6 AM |
71 | CWFLAGS="-Wall" |
72 | mv -f mdadm initrd-mdadm | |
1895fb02 | 73 | %{__make} clean |
ad809de3 | 74 | diet %{__cc} -DUCLIBC -DMDASSEMBLE_AUTO -DMDASSEMBLE %{rpmcflags} %{rpmcppflags} %{rpmldflags} -Os -static \ |
0deb9eb9 | 75 | -o initrd-mdassemble \ |
cea19ddc | 76 | mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c lib.c \ |
0deb9eb9 | 77 | super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \ |
cea19ddc | 78 | platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mdopen.c maps.c |
831f01d8 JB |
79 | %else |
80 | %{__make} mdadm.static \ | |
81 | CC="%{__cc}" \ | |
ad809de3 | 82 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
831f01d8 JB |
83 | LDFLAGS="%{rpmldflags}" |
84 | mv -f mdadm.static initrd-mdadm | |
85 | %{__make} clean | |
ad809de3 | 86 | %{__cc} -DMDASSEMBLE_AUTO -DMDASSEMBLE %{rpmcflags} %{rpmcppflags} %{rpmldflags} -DHAVE_STDINT_H -static \ |
0deb9eb9 | 87 | -o initrd-mdassemble \ |
cea19ddc | 88 | mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c lib.c \ |
0deb9eb9 | 89 | super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \ |
cea19ddc | 90 | platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c mdopen.c maps.c |
831f01d8 | 91 | %endif |
1895fb02 AM |
92 | %{__make} clean |
93 | %endif | |
222c6368 | 94 | |
6c350987 | 95 | %{__make} all mdadm.8 \ |
222c6368 | 96 | CC="%{__cc}" \ |
ad809de3 | 97 | CFLAGS="%{rpmcflags} %{rpmcppflags}" \ |
222c6368 AM |
98 | LDFLAGS="%{rpmldflags}" \ |
99 | SYSCONFDIR="%{_sysconfdir}" | |
100 | ||
f240d179 AM |
101 | %{?with_tests:%{__make} test} |
102 | ||
222c6368 AM |
103 | %install |
104 | rm -rf $RPM_BUILD_ROOT | |
d70df710 | 105 | install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},/etc/{rc.d/init.d,sysconfig,cron.d}} |
222c6368 | 106 | |
1895fb02 | 107 | %if %{with initrd} |
569c9a5b JR |
108 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd |
109 | install initrd-mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdadm | |
110 | install initrd-mdassemble $RPM_BUILD_ROOT%{_libdir}/initrd/mdassemble | |
111 | ln -s mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdctl | |
1895fb02 AM |
112 | %endif |
113 | ||
222c6368 AM |
114 | install mdadm $RPM_BUILD_ROOT%{_sbindir} |
115 | ||
7245a17e JB |
116 | install md*.5 $RPM_BUILD_ROOT%{_mandir}/man5 |
117 | install md*.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
222c6368 AM |
118 | |
119 | install mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf | |
120 | ||
121 | ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl | |
222c6368 | 122 | |
e10218c4 | 123 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
124 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
a5d8d7ae | 125 | |
ac4c4225 AM |
126 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/mdadm-checkarray |
127 | install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mdadm-checkarray | |
128 | ||
222c6368 AM |
129 | %clean |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
731c35dc AM |
132 | %post |
133 | /sbin/chkconfig --add %{name} | |
cf52b7c1 | 134 | %service mdadm restart "RAID monitoring" |
731c35dc AM |
135 | |
136 | %preun | |
137 | if [ "$1" = "0" ]; then | |
cf52b7c1 | 138 | %service mdadm stop |
5408d455 | 139 | /sbin/chkconfig --del mdadm |
731c35dc AM |
140 | fi |
141 | ||
222c6368 AM |
142 | %files |
143 | %defattr(644,root,root,755) | |
02cbc2b1 | 144 | %doc ANNOUNCE* ChangeLog TODO |
dbd234d8 JB |
145 | %attr(755,root,root) %{_sbindir}/mdadm |
146 | %attr(755,root,root) %{_sbindir}/mdadm-checkarray | |
147 | %attr(755,root,root) %{_sbindir}/mdctl | |
02cbc2b1 | 148 | %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mdadm.conf |
dbd234d8 | 149 | %{_mandir}/man5/mdadm.conf.5* |
6c350987 | 150 | %{_mandir}/man8/mdadm.8* |
dbd234d8 JB |
151 | %{_mandir}/man8/mdassemble.8* |
152 | %{_mandir}/man8/mdmon.8* | |
731c35dc | 153 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
02cbc2b1 | 154 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
ac4c4225 AM |
155 | %config(noreplace) %attr(640,root,root) /etc/cron.d/mdadm-checkarray |
156 | ||
1895fb02 | 157 | %if %{with initrd} |
222c6368 AM |
158 | %files initrd |
159 | %defattr(644,root,root,755) | |
569c9a5b JR |
160 | %attr(755,root,root) %{_libdir}/initrd/mdadm |
161 | %attr(755,root,root) %{_libdir}/initrd/mdassemble | |
162 | %attr(755,root,root) %{_libdir}/initrd/mdctl | |
222c6368 | 163 | %endif |