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