]> TLD Linux GIT Repositories - packages/mdadm.git/blob - mdadm.spec
- updated to 4.3
[packages/mdadm.git] / mdadm.spec
1 #
2 # Conditional build:
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"
6
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
9 Name:           mdadm
10 Version:        4.2
11 Release:        1
12 License:        GPL v2+
13 Group:          Base
14 Source0:        https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.xz
15 # Source0-md5:  a304eb0a978ca81045620d06547050a6
16 Source1:        %{name}.init
17 Source2:        %{name}.sysconfig
18 Source3:        %{name}.cron
19 Source4:        %{name}-checkarray
20 Patch0:         %{name}-udev-rules-paths.patch
21 URL:            https://www.kernel.org/pub/linux/utils/raid/mdadm/
22 BuildRequires:  dlm-devel
23 BuildRequires:  groff
24 BuildRequires:  rpmbuild(macros) >= 1.671
25 BuildRequires:  tar >= 1:1.22
26 BuildRequires:  xz
27 %if %{with initrd}
28         %if %{with dietlibc}
29 BuildRequires:  dietlibc-static
30         %else
31 BuildRequires:  glibc-static
32         %endif
33 %endif
34 Requires(post,preun):   /sbin/chkconfig
35 Requires:       /sbin/chkconfig
36 Requires:       rc-scripts >= 0.4.2.4-2
37 Suggests:       cronjobs
38 %{!?with_initrd:Obsoletes:      mdadm-initrd < %{version}-%{release}}
39 Obsoletes:      mdctl
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %define         _sbindir                /sbin
43
44 %description
45 This package includes tool you need to set up and maintain a software
46 RAID device under Linux. It's thought as an alternative to raidtools
47 package.
48
49 %description -l pl.UTF-8
50 Pakiet ten zawiera narzędzie potrzebne do tworzenia i obsługi
51 programowych macierzy RAID. Program ten jest pomyślany jako
52 alternatywa dla pakietu raidtools.
53
54 %package initrd
55 Summary:        Tool for maintaining software RAID devices - initrd version
56 Summary(pl.UTF-8):      Narzędzie do obsługi programowych macierzy RAID, wersja dla initrd
57 Group:          Base
58 Conflicts:      geninitrd < 10000.10
59
60 %description initrd
61 Tool for maintaining software RAID devices - statically linked for
62 initrd.
63
64 %description initrd -l pl.UTF-8
65 Narzędzie do zarządzania programowymi macierzami RAID - statycznie
66 skonsolidowane na potrzeby initrd.
67
68 %prep
69 %setup -q
70 %patch0 -p1
71
72 %build
73 %if %{with initrd}
74 %if %{with dietlibc}
75 %{__make} mdadm \
76         CC="diet %{__cc} %{rpmcflags} %{rpmcppflags} %{rpmldflags} -Os -static" \
77         CWFLAGS="-Wall"
78 %{__mv} mdadm initrd-mdadm
79 %else
80 %{__make} mdadm.static \
81         CC="%{__cc}" \
82         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
83         LDFLAGS="%{rpmldflags}"
84 %{__mv} mdadm.static initrd-mdadm
85 %endif
86 %{__make} clean
87 %endif
88
89 %{__make} all mdadm mdadm.8 \
90         CC="%{__cc}" \
91         CFLAGS="%{rpmcflags} %{rpmcppflags}" \
92         LDFLAGS="%{rpmldflags}" \
93         SYSCONFDIR="%{_sysconfdir}"
94
95 %{?with_tests:%{__make} test}
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8}} \
100         $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,cron.d}
101
102 %{__make} install install-udev \
103         DESTDIR=$RPM_BUILD_ROOT
104
105 %if %{with initrd}
106 install -d $RPM_BUILD_ROOT%{_libdir}/initrd
107 install -p initrd-mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdadm
108 ln -s mdadm $RPM_BUILD_ROOT%{_libdir}/initrd/mdctl
109 %endif
110
111 cp -p mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf
112
113 ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl
114
115 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
116 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
117
118 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.d/mdadm-checkarray
119 install -p %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/mdadm-checkarray
120
121 %clean
122 rm -rf $RPM_BUILD_ROOT
123
124 %post
125 /sbin/chkconfig --add %{name}
126 %service mdadm restart "RAID monitoring"
127
128 %preun
129 if [ "$1" = "0" ]; then
130         %service mdadm stop
131         /sbin/chkconfig --del mdadm
132 fi
133
134 %postun
135 /sbin/ldconfig
136
137 %files
138 %defattr(644,root,root,755)
139 %doc ANNOUNCE* ChangeLog TODO
140 %attr(755,root,root) %{_sbindir}/mdadm
141 %attr(755,root,root) %{_sbindir}/mdadm-checkarray
142 %attr(755,root,root) %{_sbindir}/mdctl
143 %attr(755,root,root) %{_sbindir}/mdmon
144 /lib/udev/rules.d/01-md-raid-creating.rules
145 /lib/udev/rules.d/63-md-raid-arrays.rules
146 /lib/udev/rules.d/64-md-raid-assembly.rules
147 /lib/udev/rules.d/69-md-clustered-confirm-device.rules
148 %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 mtime size) %{_sysconfdir}/mdadm.conf
149 %{_mandir}/man4/md.4*
150 %{_mandir}/man5/mdadm.conf.5*
151 %{_mandir}/man8/mdadm.8*
152 %{_mandir}/man8/mdmon.8*
153 %attr(754,root,root) /etc/rc.d/init.d/%{name}
154 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
155 %config(noreplace) %attr(640,root,root) /etc/cron.d/mdadm-checkarray
156
157 %if %{with initrd}
158 %files initrd
159 %defattr(644,root,root,755)
160 %attr(755,root,root) %{_libdir}/initrd/mdadm
161 %attr(755,root,root) %{_libdir}/initrd/mdctl
162 %endif