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