]> git.pld-linux.org Git - packages/mdadm.git/blob - mdadm.spec
- detect 0 devices, too
[packages/mdadm.git] / mdadm.spec
1 #
2 # Conditional build:
3 #  --with initrd -- build initrd version
4 Summary:        Tool for creating and maintaining software RAID devices
5 Summary(pl):    Narzêdzie do tworzenia i obs³ugi programowych macierzy RAID
6 Name:           mdadm
7 Version:        1.0.1
8 Release:        2
9 License:        GPL
10 Group:          Base
11 Source0:        http://www.cse.unsw.edu.au/~neilb/source/mdadm/%{name}-%{version}.tgz
12 Source1:        %{name}.init
13 Source2:        %{name}.sysconfig
14 Patch0:         %{name}-BOOT.patch
15 Patch1:         %{name}-dev0.patch
16 %{?_with_initrd:BuildRequires:  dietlibc-static}
17 BuildRequires:  groff
18 Obsoletes:      mdctl
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20 Requires(post): /sbin/chkconfig
21
22 %define         _sbindir                /sbin
23
24 %description
25 This package includes tool you need to set up and maintain a software
26 RAID device under Linux. It's thought as an alternative to raidtools
27 package.
28
29 %description -l pl
30 Pakiet ten zawiera narzêdzie potrzebne do tworzenia i obs³ugi
31 programowych macierzy RAID. Program ten jest pomy¶lany jako
32 alternatywa dla pakietu raidtools.
33
34 %package initrd
35 Summary:        Tool for maintaining software RAID devices - initrd version
36 Summary(pl):    Narzêdzie do obs³ugi programowych macierzy RAID, wersja dla initrd
37 Group:          Base
38
39 %description initrd
40 Tool for maintaining software RAID devices - statically linked for
41 initrd.
42
43 %description initrd -l pl
44 Narzêdzie do zarz±dzania programowymi macierzami RAID - statycznie
45 zlinkowane na potrzeby initrd.
46
47 %prep
48 %setup -q
49 %patch0 -p1
50 %patch1 -p1
51
52 %build
53 %{?_with_initrd:%{__make} CC="%{_arch}-dietlibc-gcc" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" static}
54 %{?_with_initrd:mv mdadm initrd-mdadm}
55 %{?_with_initrd:%{__make} clean}
56
57 %{__make} \
58         CC="%{__cc}" \
59         CFLAGS="%{rpmcflags} -D_GNU_SOURCE" \
60         LDFLAGS="%{rpmldflags}" \
61         SYSCONFDIR="%{_sysconfdir}"
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
66
67 %{?_with_initrd:install initrd-mdadm $RPM_BUILD_ROOT%{_sbindir}}
68 install mdadm $RPM_BUILD_ROOT%{_sbindir}
69
70 install *.5 $RPM_BUILD_ROOT%{_mandir}/man5
71 install *.8 $RPM_BUILD_ROOT%{_mandir}/man8
72
73 install mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf
74
75 ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl
76 %{?_with_initrd:ln -s initrd-mdadm $RPM_BUILD_ROOT%{_sbindir}/initrd-mdctl}
77
78 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name}
79 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
80
81 %clean
82 rm -rf $RPM_BUILD_ROOT
83
84 %post
85 /sbin/chkconfig --add %{name}
86 if [ -f /var/lock/subsys/mdadm ]; then
87         /etc/rc.d/init.d/mdadm restart 1>&2
88 else
89         echo "Run \"/etc/rc.d/init.d/mdadm start\" to start RAID monitoring."
90 fi
91
92 %preun
93 if [ "$1" = "0" ]; then
94         if [ -f /var/lock/subsys/mdadm ]; then
95                 /etc/rc.d/init.d/mdadm stop 1>&2
96         fi
97         /sbin/chkconfig --del mdadm
98 fi
99
100 %files
101 %defattr(644,root,root,755)
102 %doc ANNOUNCE TODO
103 %attr(755,root,root) %{_sbindir}/*
104 %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 size mtime) %{_sysconfdir}/mdadm.conf
105 %{_mandir}/man?/*
106 %attr(754,root,root) /etc/rc.d/init.d/%{name}
107 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/%{name}
108
109 %if %{?_with_initrd:1}%{!?_with_initrd:0}
110 %files initrd
111 %defattr(644,root,root,755)
112 %attr(755,root,root) %{_sbindir}/initrd-mdadm
113 %endif
This page took 0.089542 seconds and 3 git commands to generate.