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