]> git.pld-linux.org Git - packages/mdadm.git/blob - mdadm.spec
- update to 1.3.0 and enable initrd version by default
[packages/mdadm.git] / mdadm.spec
1 #
2 # Conditional build:
3 #  --without initrd -- build without 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.3.0
8 Release:        1
9 License:        GPL
10 Group:          Base
11 Source0:        http://www.cse.unsw.edu.au/~neilb/source/mdadm/%{name}-%{version}.tgz
12 # Source0-md5:  61186df5073fae32569bd4bb12f9da36
13 Source1:        %{name}.init
14 Source2:        %{name}.sysconfig
15 Patch0:         %{name}-BOOT.patch
16 %{!?_without_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
51 %build
52 %{!?_without_initrd:%{__make} CC="%{_target_cpu}-dietlibc-gcc" CFLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags} -static"}
53 %{!?_without_initrd:mv mdadm initrd-mdadm}
54 %{!?_without_initrd:%{__make} clean}
55
56 %{__make} \
57         CC="%{__cc}" \
58         CFLAGS="%{rpmcflags} -D_GNU_SOURCE" \
59         LDFLAGS="%{rpmldflags}" \
60         SYSCONFDIR="%{_sysconfdir}"
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},%{_sysconfdir}/{rc.d/init.d,sysconfig}}
65
66 %{!?_without_initrd:install initrd-mdadm $RPM_BUILD_ROOT%{_sbindir}}
67 install mdadm $RPM_BUILD_ROOT%{_sbindir}
68
69 install *.5 $RPM_BUILD_ROOT%{_mandir}/man5
70 install *.8 $RPM_BUILD_ROOT%{_mandir}/man8
71
72 install mdadm.conf-example $RPM_BUILD_ROOT%{_sysconfdir}/mdadm.conf
73
74 ln -s mdadm $RPM_BUILD_ROOT%{_sbindir}/mdctl
75 %{!?_without_initrd:ln -s initrd-mdadm $RPM_BUILD_ROOT%{_sbindir}/initrd-mdctl}
76
77 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
78 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %post
84 /sbin/chkconfig --add %{name}
85 if [ -f /var/lock/subsys/mdadm ]; then
86         /etc/rc.d/init.d/mdadm restart 1>&2
87 else
88         echo "Run \"/etc/rc.d/init.d/mdadm start\" to start RAID monitoring."
89 fi
90
91 %preun
92 if [ "$1" = "0" ]; then
93         if [ -f /var/lock/subsys/mdadm ]; then
94                 /etc/rc.d/init.d/mdadm stop 1>&2
95         fi
96         /sbin/chkconfig --del mdadm
97 fi
98
99 %files
100 %defattr(644,root,root,755)
101 %doc ANNOUNCE* TODO
102 %attr(755,root,root) %{_sbindir}/*
103 %attr(640,root,root) %config(noreplace,missingok) %verify(not md5 size mtime) %{_sysconfdir}/mdadm.conf
104 %{_mandir}/man?/*
105 %attr(754,root,root) /etc/rc.d/init.d/%{name}
106 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/%{name}
107
108 %if %{?_without_initrd:0}%{!?_without_initrd:1}
109 %files initrd
110 %defattr(644,root,root,755)
111 %attr(755,root,root) %{_sbindir}/initrd-mdadm
112 %endif
This page took 0.031193 seconds and 3 git commands to generate.