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