3 %bcond_without selinux # build without SELinux support
4 %bcond_without initrd # don't build initrd version
7 %ifarch sparc sparcv9 sparc64
11 Summary: Userspace support for the device-mapper
12 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
16 License: LGPL v2.1 (library), GPL v2 (executables)
17 Group: Applications/System
18 Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
19 # Source0-md5: d2d5d8b5383d80652d4066092d6f85e8
20 # http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html
21 Patch0: %{name}-disable_dynamic_link.patch
22 Patch1: %{name}-klibc.patch
23 Patch2: %{name}-getopt.patch
24 Patch3: %{name}-ac.patch
25 Patch4: %{name}-force-local-headers.patch
26 Patch5: %{name}-linking.patch
27 Patch6: %{name}-dmsetup-export.patch
28 URL: http://sources.redhat.com/dm/
29 BuildRequires: autoconf
30 BuildRequires: automake
31 %{?with_initrd:BuildRequires: klibc-static >= 1.5-2}
32 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
33 %if %{with initrd} && %{with uclibc}
34 BuildRequires: uClibc-static >= 2:0.9.26
36 %{?with_selinux:Requires: libselinux >= 1.10}
37 Conflicts: dev < 2.9.0-8
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 %undefine configure_cache
41 %define _sbindir /sbin
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.
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.
59 Summary: Userspace support for the device-mapper - static dmsetup for initrd
60 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczne dmsetup dla initrd
62 Group: Applications/System
63 Requires: %{name} = %{version}-%{release}
66 Userspace support for the device-mapper - static dmsetup binary for
69 %description initrd -l pl.UTF-8
70 Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczna
71 wersja dmsetup dla initrd.
74 Summary: Header files and development documentation for %{name}
75 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
77 Group: Development/Libraries
78 Requires: %{name} = %{version}-%{release}
81 Header files and development documentation for %{name}.
83 %description devel -l pl.UTF-8
84 Pliki nagłówkowe i dokumentacja do %{name}.
87 Summary: Static devmapper library
88 Summary(pl.UTF-8): Statyczna biblioteka devmapper
90 Group: Development/Libraries
91 Requires: %{name}-devel = %{version}-%{release}
94 Static devmapper library.
96 %description static -l pl.UTF-8
97 Statyczna biblioteka devmapper.
100 Summary: Static devmapper library and header files for initrd applications
101 Summary(pl.UTF-8): Statyczna biblioteka devmapper i jej pliki nagłówkowe dla aplikacji initrd
103 Group: Development/Libraries
104 Requires: %{name}-devel = %{version}-%{release}
107 %description initrd-devel
108 Static devmapper library and its header files for initrd applications
111 %description initrd-devel -l pl.UTF-8
112 Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki
113 nagłówkowe dla aplikacji używanych w initrd.
116 Summary: Additional scripts
117 Summary(pl.UTF-8): Dodatkowe skrypty
119 Group: Applications/System
120 Requires: %{name} = %{version}-%{release}
126 %description scripts -l pl.UTF-8
130 %setup -q -n %{name}.%{version}
140 cp -f /usr/share/automake/config.sub autoconf
148 CLDFLAGS="%{rpmldflags}" \
150 --disable-dynamic_link \
151 --enable-static_link \
152 --with-optimisation="%{rpmcflags}" \
153 --with-user=%(id -u) \
154 --with-group=%(id -g) \
155 --with-interface=ioctl \
157 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
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
164 cp -a dmsetup/dmsetup.static initrd-dmsetup
165 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a
171 CC="%{_target_cpu}-uclibc-gcc" \
172 CLDFLAGS="%{rpmldflags}" \
174 --disable-dynamic_link \
175 --with-optimisation="-Os" \
176 --with-interface=ioctl \
178 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
181 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-uclibc.a
187 CLDFLAGS="%{rpmldflags}" \
188 --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \
189 --with-optimisation="%{rpmcflags}" \
190 --with-user=%(id -u) \
191 --with-group=%(id -g) \
192 --with-interface=ioctl \
199 rm -rf $RPM_BUILD_ROOT
200 install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
203 usrlibdir="$RPM_BUILD_ROOT%{_libdir}" \
204 DESTDIR=$RPM_BUILD_ROOT
206 SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so.*.*)
207 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
208 SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so.*.*)
209 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so
210 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
211 install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
213 install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
214 install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir}
217 install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}}
218 install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}
219 install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a
220 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc
222 install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
223 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include
228 rm -rf $RPM_BUILD_ROOT
230 %post -p /sbin/ldconfig
231 %postun -p /sbin/ldconfig
234 %defattr(644,root,root,755)
235 %doc INTRO INSTALL README
236 %attr(755,root,root) %{_sbindir}/dmeventd
237 %attr(755,root,root) %{_sbindir}/dmsetup
238 %attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
239 %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
240 %{_mandir}/man8/dmsetup.8*
243 %defattr(644,root,root,755)
244 %attr(755,root,root) %{_libdir}/libdevmapper.so
245 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
246 %{_includedir}/libdevmapper*.h
247 %{_pkgconfigdir}/devmapper.pc
248 %{_pkgconfigdir}/devmapper-event.pc
251 %defattr(644,root,root,755)
252 %{_libdir}/libdevmapper.a
253 %{_libdir}/libdevmapper-event.a
256 %defattr(644,root,root,755)
257 %dir %{_libdir}/%{name}
262 %defattr(644,root,root,755)
263 %attr(755,root,root) %{_sbindir}/initrd-dmsetup
266 %defattr(644,root,root,755)
267 %{_prefix}/%{_lib}/klibc/libdevmapper.a
268 %{_includedir}/klibc/libdevmapper.h
270 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
271 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h