]>
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 |
94 | ||
95 | %description initrd | |
3f52d642 | 96 | Statically linked version of dmraid utility. |
d8d39b7c | 97 | |
c95e574d JR |
98 | %description initrd -l pl.UTF-8 |
99 | Statycznie skonsolidowana wersja programu narzędziowego dmraid. | |
d8d39b7c | 100 | |
24071a5d JR |
101 | %package initramfs |
102 | Summary: Device-mapper RAID tool - support scripts for initramfs-tools | |
103 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper - skrypty dla initramfs-tools | |
104 | Group: Base | |
105 | Requires: %{name} = %{version}-%{release} | |
106 | Requires: initramfs-tools | |
107 | ||
108 | %description initramfs | |
109 | Device-mapper RAID tool - support scripts for initramfs-tools. | |
110 | ||
111 | %description initramfs -l pl.UTF-8 | |
112 | Narzędzie do RAID-u opartego o device-mapper - skrypty dla initramfs-tools. | |
113 | ||
23d76f1c | 114 | %prep |
115 | %setup -q -n %{name} | |
116 | mv */* ./ | |
b5cee4d5 | 117 | %{?with_selinux:%patch0 -p2} |
56b461b5 JB |
118 | %patch1 -p1 |
119 | %patch2 -p1 | |
3c62db72 | 120 | %patch3 -p1 |
68c065cd | 121 | %patch4 -p1 |
eec64f5f | 122 | %patch5 -p1 |
23d76f1c | 123 | |
124 | %build | |
ee76a598 | 125 | cp -f /usr/share/automake/config.sub autoconf |
23d76f1c | 126 | %{__aclocal} |
127 | %{__autoconf} | |
128 | ||
3f52d642 JB |
129 | %if %{with initrd} |
130 | %configure \ | |
eec64f5f JR |
131 | %if %{with dietlibc} |
132 | CC="diet %{__cc} -Os %{rpmldflags} -static" \ | |
68c065cd JR |
133 | --disable-libselinux \ |
134 | --disable-libsepol \ | |
eec64f5f JR |
135 | %else |
136 | %if %{with selinux} | |
137 | --enable-libselinux \ | |
138 | --enable-libsepol \ | |
139 | %endif | |
68c065cd | 140 | %endif |
3f52d642 | 141 | --enable-static_link |
68c065cd | 142 | |
4623ff68 | 143 | %{__make} -j1 |
3f52d642 | 144 | cp -f tools/dmraid{,-initrd} |
d8d39b7c | 145 | %{__make} clean |
3f52d642 JB |
146 | %endif |
147 | ||
56b461b5 JB |
148 | %configure \ |
149 | --enable-shared_lib | |
4623ff68 | 150 | %{__make} -j1 |
23d76f1c | 151 | |
152 | %install | |
153 | rm -rf $RPM_BUILD_ROOT | |
6f013d0d | 154 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_datadir}/initramfs-tools/{hooks,scripts/local-top}} |
23d76f1c | 155 | |
56b461b5 JB |
156 | %{__make} install \ |
157 | includedir=$RPM_BUILD_ROOT%{_includedir} \ | |
158 | libdir=$RPM_BUILD_ROOT%{_libdir} \ | |
159 | mandir=$RPM_BUILD_ROOT%{_mandir} \ | |
160 | sbindir=$RPM_BUILD_ROOT%{_sbindir} | |
23d76f1c | 161 | |
6f013d0d JR |
162 | mv $RPM_BUILD_ROOT%{_libdir}/libdmraid.so.* $RPM_BUILD_ROOT/%{_lib} |
163 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libdmraid.so.*.*.*) \ | |
164 | $RPM_BUILD_ROOT%{_libdir}/libdmraid.so | |
165 | ||
56b461b5 JB |
166 | %if %{with initrd} |
167 | install -D tools/dmraid-initrd $RPM_BUILD_ROOT/sbin/dmraid-initrd | |
168 | %endif | |
36674070 | 169 | |
24071a5d JR |
170 | install %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/hooks/dmraid |
171 | install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/initramfs-tools/scripts/local-top/dmraid | |
172 | ||
23d76f1c | 173 | %clean |
174 | rm -rf $RPM_BUILD_ROOT | |
175 | ||
56b461b5 JB |
176 | %post -p /sbin/ldconfig |
177 | %postun -p /sbin/ldconfig | |
178 | ||
23d76f1c | 179 | %files |
180 | %defattr(644,root,root,755) | |
181 | %doc README TODO doc/dmraid_design.txt | |
56b461b5 | 182 | %attr(755,root,root) %{_sbindir}/dmraid |
6f013d0d | 183 | %attr(755,root,root) /%{_lib}/libdmraid.so.*.*.* |
ebec4317 | 184 | %{_mandir}/man8/* |
d8d39b7c | 185 | |
36674070 ER |
186 | %files devel |
187 | %defattr(644,root,root,755) | |
56b461b5 | 188 | %attr(755,root,root) %{_libdir}/libdmraid.so |
36674070 ER |
189 | %{_includedir}/dmraid |
190 | ||
191 | %files static | |
192 | %defattr(644,root,root,755) | |
193 | %{_libdir}/libdmraid.a | |
194 | ||
3f52d642 | 195 | %if %{with initrd} |
d8d39b7c | 196 | %files initrd |
197 | %defattr(644,root,root,755) | |
56b461b5 | 198 | %attr(755,root,root) /sbin/dmraid-initrd |
3f52d642 | 199 | %endif |
24071a5d JR |
200 | |
201 | %files initramfs | |
202 | %defattr(644,root,root,755) | |
203 | %attr(755,root,root) %{_datadir}/initramfs-tools/hooks/dmraid | |
204 | %attr(755,root,root) %{_datadir}/initramfs-tools/scripts/local-top/dmraid |