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