2 # - add fix to drop BuildConflicts: device-mapper-initrd-devel
5 %bcond_without selinux # build without SELinux support
6 %bcond_without initrd # don't build initrd version
9 %ifarch sparc sparcv9 sparc64
13 Summary: Userspace support for the device-mapper
14 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika
18 License: LGPL v2.1 (library), GPL v2 (executables)
19 Group: Applications/System
20 Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
21 # Source0-md5: 6b94db57cdc9022af1583b3f2acb91cd
22 # http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html
23 Patch0: %{name}-disable_dynamic_link.patch
24 Patch1: %{name}-klibc.patch
25 Patch2: %{name}-getopt.patch
26 Patch3: %{name}-ac.patch
27 Patch4: %{name}-force-local-headers.patch
28 Patch5: %{name}-linking.patch
29 URL: http://sources.redhat.com/dm/
30 BuildRequires: autoconf
31 BuildRequires: automake
32 %{?with_initrd:BuildRequires: klibc-static}
33 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
34 %if %{with initrd} && %{with uclibc}
35 BuildRequires: uClibc-static >= 0.9.26
37 # /usr/include/klibc/libdevmapper.h is included first before currently built version with klcc
38 BuildConflicts: device-mapper-initrd-devel < 1.02.17
39 %{?with_selinux:Requires: libselinux >= 1.10}
40 Conflicts: dev < 2.9.0-8
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 %undefine configure_cache
44 %define _sbindir /sbin
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.
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.
62 Summary: Userspace support for the device-mapper - static dmsetup for initrd
63 Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczne dmsetup dla initrd
65 Group: Applications/System
66 Requires: %{name} = %{version}-%{release}
69 Userspace support for the device-mapper - static dmsetup binary for
72 %description initrd -l pl.UTF-8
73 Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczna
74 wersja dmsetup dla initrd.
77 Summary: Header files and development documentation for %{name}
78 Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name}
80 Group: Development/Libraries
81 Requires: %{name} = %{version}-%{release}
84 Header files and development documentation for %{name}.
86 %description devel -l pl.UTF-8
87 Pliki nagłówkowe i dokumentacja do %{name}.
90 Summary: Static devmapper library
91 Summary(pl.UTF-8): Statyczna biblioteka devmapper
93 Group: Development/Libraries
94 Requires: %{name}-devel = %{version}-%{release}
97 Static devmapper library.
99 %description static -l pl.UTF-8
100 Statyczna biblioteka devmapper.
102 %package initrd-devel
103 Summary: Static devmapper library and header files for initrd applications
104 Summary(pl.UTF-8): Statyczna biblioteka devmapper i jej pliki nagłówkowe dla aplikacji initrd
106 Group: Development/Libraries
107 Requires: %{name}-devel = %{version}-%{release}
110 %description initrd-devel
111 Static devmapper library and its header files for initrd applications
114 %description initrd-devel -l pl.UTF-8
115 Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki
116 nagłówkowe dla aplikacji używanych w initrd.
119 Summary: Additional scripts
120 Summary(pl.UTF-8): Dodatkowe skrypty
122 Group: Applications/System
123 Requires: %{name} = %{version}-%{release}
129 %description scripts -l pl.UTF-8
133 %setup -q -n %{name}.%{version}
142 cp -f /usr/share/automake/config.sub autoconf
150 CLDFLAGS="%{rpmldflags}" \
152 --disable-dynamic_link \
153 --enable-static_link \
154 --with-optimisation="%{rpmcflags}" \
155 --with-user=%(id -u) \
156 --with-group=%(id -g) \
157 --with-interface=ioctl \
159 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
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
166 cp -a dmsetup/dmsetup.static initrd-dmsetup
167 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a
173 CC="%{_target_cpu}-uclibc-gcc" \
174 CLDFLAGS="%{rpmldflags}" \
176 --disable-dynamic_link \
177 --with-optimisation="-Os" \
178 --with-interface=ioctl \
180 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
183 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-uclibc.a
189 CLDFLAGS="%{rpmldflags}" \
190 --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \
191 --with-optimisation="%{rpmcflags}" \
192 --with-user=%(id -u) \
193 --with-group=%(id -g) \
194 --with-interface=ioctl \
201 rm -rf $RPM_BUILD_ROOT
202 install -d $RPM_BUILD_ROOT{/%{_lib},%{_libdir}/%{name}}
205 usrlibdir="$RPM_BUILD_ROOT%{_libdir}" \
206 DESTDIR=$RPM_BUILD_ROOT
208 SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so.*.*)
209 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
210 SONAME=$(basename $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so.*.*)
211 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so
212 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
213 install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
215 install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
216 install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir}
219 install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}}
220 install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}
221 install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a
222 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc
224 install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
225 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include
230 rm -rf $RPM_BUILD_ROOT
232 %post -p /sbin/ldconfig
233 %postun -p /sbin/ldconfig
236 %defattr(644,root,root,755)
237 %doc INTRO INSTALL README
238 %attr(755,root,root) %{_sbindir}/dmeventd
239 %attr(755,root,root) %{_sbindir}/dmsetup
240 %attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
241 %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
242 %{_mandir}/man8/dmsetup.8*
245 %defattr(644,root,root,755)
246 %attr(755,root,root) %{_libdir}/libdevmapper.so
247 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
248 %{_includedir}/libdevmapper*.h
249 %{_pkgconfigdir}/devmapper.pc
250 %{_pkgconfigdir}/devmapper-event.pc
253 %defattr(644,root,root,755)
254 %{_libdir}/libdevmapper.a
255 %{_libdir}/libdevmapper-event.a
258 %defattr(644,root,root,755)
259 %dir %{_libdir}/%{name}
264 %defattr(644,root,root,755)
265 %attr(755,root,root) %{_sbindir}/initrd-dmsetup
268 %defattr(644,root,root,755)
269 %{_prefix}/%{_lib}/klibc/libdevmapper.a
270 %{_includedir}/klibc/libdevmapper.h
272 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
273 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h