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