]>
Commit | Line | Data |
---|---|---|
3f52d642 JB |
1 | # |
2 | # Conditional build: | |
68c065cd JR |
3 | %bcond_without initrd # without initrd version |
4 | %bcond_without dietlibc # build initrd version with static glibc instead of dietlibc | |
5 | %bcond_without selinux # build without SELinux support (needs selinux-disabled device-mapper) | |
3f52d642 | 6 | # |
ebec4317 | 7 | Summary: Device-mapper RAID tool |
121078cd | 8 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper |
23d76f1c | 9 | Name: dmraid |
10 | Version: 1.0.0 | |
add5855c | 11 | %define _rc rc15 |
68c065cd | 12 | Release: 0.%{_rc}.4 |
23d76f1c | 13 | License: GPL |
14 | Group: Base | |
bce578ac | 15 | Source0: http://people.redhat.com/~heinzm/sw/dmraid/src/%{name}-%{version}.%{_rc}.tar.bz2 |
add5855c | 16 | # Source0-md5: 2602887205a35f89b59eeba3a868150f |
5f1d2088 JR |
17 | Source1: %{name}-initramfs-hook |
18 | Source2: %{name}-initramfs-local-top | |
4d0aa4a9 | 19 | Patch0: %{name}-selinux-static.patch |
56b461b5 JB |
20 | Patch1: %{name}-fix.patch |
21 | Patch2: %{name}-optflags.patch | |
3c62db72 | 22 | Patch3: %{name}-as-needed.patch |
68c065cd | 23 | Patch4: %{name}-unsigned.patch |
eec64f5f | 24 | Patch5: %{name}-diet.patch |
23d76f1c | 25 | URL: http://people.redhat.com/~heinzm/sw/dmraid/ |
26 | BuildRequires: autoconf | |
ebec4317 | 27 | BuildRequires: automake |
add5855c | 28 | BuildRequires: device-mapper-devel >= 1.02.02 |
1a668278 | 29 | BuildRequires: zlib-devel |
b5cee4d5 | 30 | %if %{with initrd} |
68c065cd JR |
31 | %if %{with dietlibc} |
32 | BuildRequires: device-mapper-dietlibc | |
33 | BuildRequires: dietlibc-static >= 2:0.31-5 | |
34 | %else | |
b5cee4d5 | 35 | BuildRequires: device-mapper-static >= 1.02.05-0.4 |
36 | BuildRequires: glibc-static | |
68c065cd JR |
37 | %if %{with selinux} |
38 | BuildRequires: libselinux-static | |
39 | BuildRequires: libsepol-static | |
40 | %endif | |
41 | %endif | |
42 | %endif | |
43 | %if %{with selinux} | |
44 | BuildRequires: libselinux-devel | |
45 | BuildRequires: libsepol-devel | |
b5cee4d5 | 46 | %endif |
23d76f1c | 47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
48 | ||
6f013d0d JR |
49 | %define _sbindir /sbin |
50 | ||
23d76f1c | 51 | %description |
52 | DMRAID supports device discovery, set activation and display of | |
53 | properties for ATARAID on Linux >= 2.4 using device-mapper. | |
54 | ||
c95e574d JR |
55 | %description -l pl.UTF-8 |
56 | DMRAID obsługuje wykrywanie urządzeń, ustawianie aktywacji i | |
57 | wyświetlanie właściwości ATARAID-u na Linuksie >= 2.4 przy użyciu | |
ebec4317 JB |
58 | device-mappera. |
59 | ||
36674070 | 60 | %package devel |
ebaa32bf | 61 | Summary: Header files for dmraid library |
121078cd | 62 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki dmraid |
36674070 | 63 | Group: Development/Libraries |
07712890 | 64 | Requires: %{name} = %{version}-%{release} |
36674070 ER |
65 | |
66 | %description devel | |
67 | dmraid-devel provides a library interface for RAID device discovery, | |
68 | RAID set activation and display of properties for ATARAID volumes. | |
69 | ||
c95e574d JR |
70 | %description devel -l pl.UTF-8 |
71 | Ten pakiet udostępnia interfejs biblioteczny do wykrywania urządzeń | |
72 | RAID, włączania zestawu RAID i wyświetlania właściwości wolumenów | |
ebaa32bf JB |
73 | ATARAID. |
74 | ||
36674070 | 75 | %package static |
ebaa32bf | 76 | Summary: Static library for dmraid |
121078cd | 77 | Summary(pl.UTF-8): Statyczna biblioteka dmraid |
36674070 ER |
78 | Group: Development/Libraries |
79 | Requires: %{name}-devel = %{version}-%{release} | |
80 | ||
81 | %description static | |
82 | dmraid-static provides a library interface for RAID device discovery, | |
83 | RAID set activation and display of properties for ATARAID volumes. | |
84 | ||
c95e574d JR |
85 | %description static -l pl.UTF-8 |
86 | Ten pakiet udostępnia statyczną bibliotekę do wykrywania urządzeń | |
87 | RAID, włączania zestawu RAID i wyświetlania właściwości wolumenów | |
ebaa32bf JB |
88 | ATARAID. |
89 | ||
d8d39b7c | 90 | %package initrd |
91 | Summary: Device-mapper RAID tool - statically linked version | |
121078cd | 92 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper - wersja statyczna |
d8d39b7c | 93 | Group: Base |
722de73a | 94 | Conflicts: geninitrd <= 10000.3 |
d8d39b7c | 95 | |
96 | %description initrd | |
3f52d642 | 97 | Statically linked version of dmraid utility. |
d8d39b7c | 98 | |
c95e574d JR |
99 | %description initrd -l pl.UTF-8 |
100 | Statycznie skonsolidowana wersja programu narzędziowego dmraid. | |
d8d39b7c | 101 | |
24071a5d JR |
102 | %package initramfs |
103 | Summary: Device-mapper RAID tool - support scripts for initramfs-tools | |
104 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper - skrypty dla initramfs-tools | |
105 | Group: Base | |
106 | Requires: %{name} = %{version}-%{release} | |
107 | Requires: initramfs-tools | |
108 | ||
109 | %description initramfs | |
110 | Device-mapper RAID tool - support scripts for initramfs-tools. | |
111 | ||
112 | %description initramfs -l pl.UTF-8 | |
113 | Narzędzie do RAID-u opartego o device-mapper - skrypty dla initramfs-tools. | |
114 | ||
23d76f1c | 115 | %prep |
116 | %setup -q -n %{name} | |
117 | mv */* ./ | |
b5cee4d5 | 118 | %{?with_selinux:%patch0 -p2} |
56b461b5 JB |
119 | %patch1 -p1 |
120 | %patch2 -p1 | |
3c62db72 | 121 | %patch3 -p1 |
68c065cd | 122 | %patch4 -p1 |
eec64f5f | 123 | %patch5 -p1 |
23d76f1c | 124 | |
125 | %build | |
ee76a598 | 126 | cp -f /usr/share/automake/config.sub autoconf |
23d76f1c | 127 | %{__aclocal} |
128 | %{__autoconf} | |
129 | ||
3f52d642 JB |
130 | %if %{with initrd} |
131 | %configure \ | |
eec64f5f | 132 | %if %{with dietlibc} |
fcfd5328 | 133 | CC="diet %{__cc} %{rpmcflags} %{rpmldflags} -Os -static" \ |
68c065cd JR |
134 | --disable-libselinux \ |
135 | --disable-libsepol \ | |
eec64f5f JR |
136 | %else |
137 | %if %{with selinux} | |
138 | --enable-libselinux \ | |
139 | --enable-libsepol \ | |
140 | %endif | |
68c065cd | 141 | %endif |
3f52d642 | 142 | --enable-static_link |
68c065cd | 143 | |
4623ff68 | 144 | %{__make} -j1 |
152b8c5d | 145 | mv -f tools/dmraid dmraid-initrd |
d8d39b7c | 146 | %{__make} clean |
3f52d642 JB |
147 | %endif |
148 | ||
56b461b5 JB |
149 | %configure \ |
150 | --enable-shared_lib | |
4623ff68 | 151 | %{__make} -j1 |
23d76f1c | 152 | |
153 | %install | |
154 | rm -rf $RPM_BUILD_ROOT | |
6f013d0d | 155 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_datadir}/initramfs-tools/{hooks,scripts/local-top}} |
23d76f1c | 156 | |
56b461b5 JB |
157 | %{__make} install \ |
158 | includedir=$RPM_BUILD_ROOT%{_includedir} \ | |
159 | libdir=$RPM_BUILD_ROOT%{_libdir} \ | |
160 | mandir=$RPM_BUILD_ROOT%{_mandir} \ | |
161 | sbindir=$RPM_BUILD_ROOT%{_sbindir} | |
23d76f1c | 162 | |
6f013d0d JR |
163 | mv $RPM_BUILD_ROOT%{_libdir}/libdmraid.so.* $RPM_BUILD_ROOT/%{_lib} |
164 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libdmraid.so.*.*.*) \ | |
165 | $RPM_BUILD_ROOT%{_libdir}/libdmraid.so | |
166 | ||
56b461b5 | 167 | %if %{with initrd} |
152b8c5d JR |
168 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd |
169 | install dmraid-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/dmraid | |
56b461b5 | 170 | %endif |
36674070 | 171 | |
24071a5d JR |
172 | install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/dmraid |
173 | install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/dmraid | |
174 | ||
23d76f1c | 175 | %clean |
176 | rm -rf $RPM_BUILD_ROOT | |
177 | ||
56b461b5 JB |
178 | %post -p /sbin/ldconfig |
179 | %postun -p /sbin/ldconfig | |
180 | ||
23d76f1c | 181 | %files |
182 | %defattr(644,root,root,755) | |
183 | %doc README TODO doc/dmraid_design.txt | |
56b461b5 | 184 | %attr(755,root,root) %{_sbindir}/dmraid |
6f013d0d | 185 | %attr(755,root,root) /%{_lib}/libdmraid.so.*.*.* |
ebec4317 | 186 | %{_mandir}/man8/* |
d8d39b7c | 187 | |
36674070 ER |
188 | %files devel |
189 | %defattr(644,root,root,755) | |
56b461b5 | 190 | %attr(755,root,root) %{_libdir}/libdmraid.so |
36674070 ER |
191 | %{_includedir}/dmraid |
192 | ||
193 | %files static | |
194 | %defattr(644,root,root,755) | |
195 | %{_libdir}/libdmraid.a | |
196 | ||
3f52d642 | 197 | %if %{with initrd} |
d8d39b7c | 198 | %files initrd |
199 | %defattr(644,root,root,755) | |
152b8c5d | 200 | %attr(755,root,root) %{_libdir}/initrd/dmraid |
3f52d642 | 201 | %endif |
24071a5d JR |
202 | |
203 | %files initramfs | |
204 | %defattr(644,root,root,755) | |
205 | %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/dmraid | |
206 | %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/dmraid |