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