]>
Commit | Line | Data |
---|---|---|
e2b16e78 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without selinux # build without SELinux support | |
64485ac5 | 4 | %bcond_without initrd # don't build initrd version |
6f95ba99 | 5 | %bcond_without uclibc |
e2b16e78 | 6 | # |
5b31c0e8 | 7 | %ifarch sparc sparcv9 sparc64 |
8 | %undefine with_uclibc | |
9 | %endif | |
10 | ||
24effc5a | 11 | Summary: Userspace support for the device-mapper |
a2ba3b1a | 12 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika |
24effc5a | 13 | Name: device-mapper |
2b0d105b | 14 | Version: 1.02.23 |
2f3c2e45 | 15 | Release: 3 |
183f112a | 16 | License: LGPL v2.1 (library), GPL v2 (executables) |
24effc5a | 17 | Group: Applications/System |
e8083e24 | 18 | Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz |
2b0d105b | 19 | # Source0-md5: d2d5d8b5383d80652d4066092d6f85e8 |
af449e2d | 20 | # http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html |
7db152f4 AM |
21 | Patch0: %{name}-disable_dynamic_link.patch |
22 | Patch1: %{name}-klibc.patch | |
23 | Patch2: %{name}-getopt.patch | |
23814d9f | 24 | Patch3: %{name}-ac.patch |
b0069eb2 | 25 | Patch4: %{name}-force-local-headers.patch |
bc05beb9 | 26 | Patch5: %{name}-linking.patch |
c65a4357 | 27 | Patch6: %{name}-dmsetup-export.patch |
0f6d8388 | 28 | URL: http://sources.redhat.com/dm/ |
82ab75b9 JB |
29 | BuildRequires: autoconf |
30 | BuildRequires: automake | |
2b0d105b | 31 | %{?with_initrd:BuildRequires: klibc-static >= 1.5-2} |
e2b16e78 | 32 | %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} |
28737e6a | 33 | %if %{with initrd} && %{with uclibc} |
ad240f63 | 34 | BuildRequires: uClibc-static >= 2:0.9.26 |
28737e6a | 35 | %endif |
e2b16e78 | 36 | %{?with_selinux:Requires: libselinux >= 1.10} |
bd7310b0 | 37 | Conflicts: dev < 2.9.0-8 |
24effc5a JR |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
39 | ||
8ae4c2e7 | 40 | %undefine configure_cache |
3f80d918 | 41 | %define _sbindir /sbin |
24effc5a JR |
42 | |
43 | %description | |
8ae4c2e7 ER |
44 | The goal of this driver is to support volume management. The driver |
45 | enables the definition of new block devices composed of ranges of | |
46 | sectors of existing devices. This can be used to define disk | |
47 | partitions - or logical volumes. This light-weight kernel component | |
48 | can support user-space tools for logical volume management. | |
24effc5a | 49 | |
249e98b8 JR |
50 | %description -l pl.UTF-8 |
51 | Celem tego sterownika jest obsługa zarządzania wolumenami. Sterownik | |
52 | włącza definiowanie nowych urządzeń blokowych złożonych z przedziałów | |
53 | sektorów na istniejących urządzeniach. Może to być wykorzystane do | |
54 | definiowania partycji na dysku lub logicznych wolumenów. Ten lekki | |
55 | składnik jądra może wspierać działające w przestrzeni użytkownika | |
56 | narzędzia do zarządzania logicznymi wolumenami. | |
82ab75b9 | 57 | |
64485ac5 JK |
58 | %package initrd |
59 | Summary: Userspace support for the device-mapper - static dmsetup for initrd | |
a2ba3b1a | 60 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczne dmsetup dla initrd |
183f112a | 61 | License: GPL v2 |
64485ac5 JK |
62 | Group: Applications/System |
63 | Requires: %{name} = %{version}-%{release} | |
64 | ||
65 | %description initrd | |
1a143708 JB |
66 | Userspace support for the device-mapper - static dmsetup binary for |
67 | initrd. | |
64485ac5 | 68 | |
249e98b8 JR |
69 | %description initrd -l pl.UTF-8 |
70 | Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczna | |
1a143708 | 71 | wersja dmsetup dla initrd. |
64485ac5 | 72 | |
3f80d918 JR |
73 | %package devel |
74 | Summary: Header files and development documentation for %{name} | |
a2ba3b1a | 75 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name} |
183f112a | 76 | License: LGPL v2.1 |
3f80d918 | 77 | Group: Development/Libraries |
2560a7ef | 78 | Requires: %{name} = %{version}-%{release} |
3f80d918 JR |
79 | |
80 | %description devel | |
81 | Header files and development documentation for %{name}. | |
82 | ||
249e98b8 JR |
83 | %description devel -l pl.UTF-8 |
84 | Pliki nagłówkowe i dokumentacja do %{name}. | |
3f80d918 | 85 | |
7858f662 | 86 | %package static |
5a698747 | 87 | Summary: Static devmapper library |
a2ba3b1a | 88 | Summary(pl.UTF-8): Statyczna biblioteka devmapper |
183f112a | 89 | License: LGPL v2.1 |
7858f662 | 90 | Group: Development/Libraries |
2560a7ef | 91 | Requires: %{name}-devel = %{version}-%{release} |
7858f662 AF |
92 | |
93 | %description static | |
5a698747 JB |
94 | Static devmapper library. |
95 | ||
249e98b8 | 96 | %description static -l pl.UTF-8 |
5a698747 | 97 | Statyczna biblioteka devmapper. |
7858f662 | 98 | |
af449e2d JK |
99 | %package initrd-devel |
100 | Summary: Static devmapper library and header files for initrd applications | |
a2ba3b1a | 101 | Summary(pl.UTF-8): Statyczna biblioteka devmapper i jej pliki nagłówkowe dla aplikacji initrd |
183f112a | 102 | License: LGPL v2.1 |
af449e2d JK |
103 | Group: Development/Libraries |
104 | Requires: %{name}-devel = %{version}-%{release} | |
105 | Requires: klibc | |
106 | ||
107 | %description initrd-devel | |
1a143708 JB |
108 | Static devmapper library and its header files for initrd applications |
109 | linked with klibc. | |
af449e2d | 110 | |
249e98b8 | 111 | %description initrd-devel -l pl.UTF-8 |
1a143708 | 112 | Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki |
249e98b8 | 113 | nagłówkowe dla aplikacji używanych w initrd. |
af449e2d | 114 | |
e4b9886f | 115 | %package scripts |
116 | Summary: Additional scripts | |
a2ba3b1a | 117 | Summary(pl.UTF-8): Dodatkowe skrypty |
183f112a | 118 | License: GPL v2 |
e4b9886f | 119 | Group: Applications/System |
e4b9886f | 120 | Requires: %{name} = %{version}-%{release} |
5de8a2b5 | 121 | Requires: util-linux |
e4b9886f | 122 | |
123 | %description scripts | |
124 | Additional scripts. | |
125 | ||
249e98b8 | 126 | %description scripts -l pl.UTF-8 |
5de8a2b5 | 127 | Dodatkowe skrypty. |
e4b9886f | 128 | |
24effc5a JR |
129 | %prep |
130 | %setup -q -n %{name}.%{version} | |
5108239d | 131 | %patch0 -p1 |
af449e2d JK |
132 | %patch1 -p1 |
133 | %patch2 -p1 | |
23814d9f | 134 | %patch3 -p1 |
b0069eb2 | 135 | %patch4 -p1 |
bc05beb9 | 136 | %patch5 -p1 |
c65a4357 | 137 | %patch6 -p1 |
0281e413 | 138 | |
24effc5a | 139 | %build |
7c94dbf3 | 140 | cp -f /usr/share/automake/config.sub autoconf |
ac7f2b07 TP |
141 | %{__aclocal} |
142 | %{__autoconf} | |
64485ac5 JK |
143 | |
144 | %if %{with initrd} | |
2b0d105b | 145 | # klibc |
d536b3d1 | 146 | %configure \ |
c4009345 | 147 | CC="klcc -static" \ |
0f8f5516 | 148 | CLDFLAGS="%{rpmldflags}" \ |
64485ac5 | 149 | --disable-selinux \ |
c4009345 JB |
150 | --disable-dynamic_link \ |
151 | --enable-static_link \ | |
64485ac5 JK |
152 | --with-optimisation="%{rpmcflags}" \ |
153 | --with-user=%(id -u) \ | |
154 | --with-group=%(id -g) \ | |
d831393d ER |
155 | --with-interface=ioctl \ |
156 | --disable-nls | |
c4009345 | 157 | sed -i -e 's#rpl_malloc#malloc#g' include/configure.h |
61f5a4c9 ER |
158 | # On AC it successfully finds canonicalize_file_name() from glibc's libc.a |
159 | # On TH it it fails to do anything with libc.a due link errors (undefined reference to `_Unwind_Resume', undefined reference to `__gcc_personality_v0', ...) | |
160 | # really it should check func from klibc libc.a | |
161 | sed -i -e 's,#define HAVE_CANONICALIZE_FILE_NAME 1,#undef HAVE_CANONICALIZE_FILE_NAME,' include/configure.h | |
64485ac5 JK |
162 | %{__make} |
163 | ||
164 | cp -a dmsetup/dmsetup.static initrd-dmsetup | |
44d58241 ER |
165 | cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a |
166 | %{__make} clean | |
167 | ||
28737e6a | 168 | %if %{with uclibc} |
44d58241 ER |
169 | # uclibc (for lvm2) |
170 | %configure \ | |
bd502012 | 171 | CC="%{_target_cpu}-uclibc-gcc" \ |
0f8f5516 | 172 | CLDFLAGS="%{rpmldflags}" \ |
44d58241 | 173 | --disable-selinux \ |
bd502012 ER |
174 | --disable-dynamic_link \ |
175 | --with-optimisation="-Os" \ | |
176 | --with-interface=ioctl \ | |
44d58241 ER |
177 | --disable-nls |
178 | sed -i -e 's#rpl_malloc#malloc#g' include/configure.h | |
179 | %{__make} | |
180 | ||
181 | cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-uclibc.a | |
64485ac5 JK |
182 | %{__make} clean |
183 | %endif | |
28737e6a | 184 | %endif |
64485ac5 JK |
185 | |
186 | %configure \ | |
0f8f5516 | 187 | CLDFLAGS="%{rpmldflags}" \ |
64485ac5 | 188 | --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \ |
c4009345 | 189 | --with-optimisation="%{rpmcflags}" \ |
9dfe67ca PS |
190 | --with-user=%(id -u) \ |
191 | --with-group=%(id -g) \ | |
af449e2d | 192 | --with-interface=ioctl \ |
20f45f1d | 193 | --enable-dmeventd \ |
75d74553 | 194 | --enable-pkgconfig \ |
af449e2d | 195 | --disable-klibc |
24effc5a JR |
196 | %{__make} |
197 | ||
198 | %install | |
199 | rm -rf $RPM_BUILD_ROOT | |
183f112a | 200 | install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}} |
24effc5a | 201 | |
2b3200b7 | 202 | %{__make} install \ |
75d74553 | 203 | usrlibdir="$RPM_BUILD_ROOT%{_libdir}" \ |
2b3200b7 | 204 | DESTDIR=$RPM_BUILD_ROOT |
24effc5a | 205 | |
183f112a | 206 | SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so.*.*) |
a4826f8d | 207 | ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so |
183f112a | 208 | SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so.*.*) |
c4009345 | 209 | ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so |
9b4e9149 | 210 | mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib} |
c4009345 | 211 | install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name} |
3f80d918 | 212 | |
bc9650f9 | 213 | install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir} |
c4009345 JB |
214 | install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir} |
215 | ||
216 | %if %{with initrd} | |
7f0aa7db | 217 | install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}} |
c4009345 | 218 | install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir} |
44d58241 | 219 | install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a |
c4009345 | 220 | install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc |
28737e6a AM |
221 | %if %{with uclibc} |
222 | install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a | |
44d58241 | 223 | install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include |
c4009345 | 224 | %endif |
28737e6a | 225 | %endif |
7858f662 | 226 | |
24effc5a JR |
227 | %clean |
228 | rm -rf $RPM_BUILD_ROOT | |
229 | ||
82ab75b9 | 230 | %post -p /sbin/ldconfig |
3f80d918 JR |
231 | %postun -p /sbin/ldconfig |
232 | ||
24effc5a JR |
233 | %files |
234 | %defattr(644,root,root,755) | |
183f112a | 235 | %doc INTRO INSTALL README |
47656ea8 | 236 | %attr(755,root,root) %{_sbindir}/dmeventd |
64485ac5 | 237 | %attr(755,root,root) %{_sbindir}/dmsetup |
c4009345 JB |
238 | %attr(755,root,root) /%{_lib}/libdevmapper.so.*.* |
239 | %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.* | |
183f112a | 240 | %{_mandir}/man8/dmsetup.8* |
3f80d918 JR |
241 | |
242 | %files devel | |
243 | %defattr(644,root,root,755) | |
9dfe67ca | 244 | %attr(755,root,root) %{_libdir}/libdevmapper.so |
c4009345 JB |
245 | %attr(755,root,root) %{_libdir}/libdevmapper-event.so |
246 | %{_includedir}/libdevmapper*.h | |
183f112a JB |
247 | %{_pkgconfigdir}/devmapper.pc |
248 | %{_pkgconfigdir}/devmapper-event.pc | |
7858f662 AF |
249 | |
250 | %files static | |
251 | %defattr(644,root,root,755) | |
c4009345 JB |
252 | %{_libdir}/libdevmapper.a |
253 | %{_libdir}/libdevmapper-event.a | |
e4b9886f | 254 | |
255 | %files scripts | |
256 | %defattr(644,root,root,755) | |
257 | %dir %{_libdir}/%{name} | |
258 | %{_libdir}/%{name}/* | |
64485ac5 | 259 | |
79c38c76 | 260 | %if %{with initrd} |
64485ac5 JK |
261 | %files initrd |
262 | %defattr(644,root,root,755) | |
263 | %attr(755,root,root) %{_sbindir}/initrd-dmsetup | |
af449e2d JK |
264 | |
265 | %files initrd-devel | |
266 | %defattr(644,root,root,755) | |
8ae4c2e7 ER |
267 | %{_prefix}/%{_lib}/klibc/libdevmapper.a |
268 | %{_includedir}/klibc/libdevmapper.h | |
28737e6a AM |
269 | %if %{with uclibc} |
270 | %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a | |
44d58241 | 271 | %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h |
79c38c76 | 272 | %endif |
28737e6a | 273 | %endif |