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
8 Summary: Userspace support for the device-mapper
9 Summary(pl): Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika
14 Group: Applications/System
15 Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz
16 # Source0-md5: 26f189bfc37c3fa786f36e47fb0a0ba5
17 # http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html
18 Patch0: %{name}-disable_dynamic_link.patch
19 Patch1: %{name}-klibc.patch
20 Patch2: %{name}-getopt.patch
21 Patch3: %{name}-ac.patch
22 Patch4: %{name}-force-local-headers.patch
23 Patch5: %{name}-linking.patch
24 URL: http://sources.redhat.com/dm/
25 BuildRequires: autoconf
26 BuildRequires: automake
27 %{?with_initrd:BuildRequires: klibc-static}
28 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
29 %{?with_initrd:BuildRequires: uClibc-static >= 0.9.26}
30 # /usr/include/klibc/libdevmapper.h is included first before currently built version with klcc
31 BuildConflicts: device-mapper-initrd-devel < 1.02.07
32 %{?with_selinux:Requires: libselinux >= 1.10}
33 Conflicts: dev < 2.9.0-8
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %undefine configure_cache
37 %define _sbindir /sbin
40 The goal of this driver is to support volume management. The driver
41 enables the definition of new block devices composed of ranges of
42 sectors of existing devices. This can be used to define disk
43 partitions - or logical volumes. This light-weight kernel component
44 can support user-space tools for logical volume management.
47 Celem tego sterownika jest obs³uga zarz±dzania wolumenami. Sterownik
48 w³±cza definiowanie nowych urz±dzeñ blokowych z³o¿onych z przedzia³ów
49 sektorów na istniej±cych urz±dzeniach. Mo¿e to byæ wykorzystane do
50 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
51 sk³adnik j±dra mo¿e wspieraæ dzia³aj±ce w przestrzeni u¿ytkownika
52 narzêdzia do zarz±dzania logicznymi wolumenami.
55 Summary: Userspace support for the device-mapper - static dmsetup for initrd
56 Summary(pl): Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczne dmsetup dla initrd
57 Group: Applications/System
58 Requires: %{name} = %{version}-%{release}
61 Userspace support for the device-mapper - static dmsetup binary for
64 %description initrd -l pl
65 Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczna
66 wersja dmsetup dla initrd.
69 Summary: Header files and development documentation for %{name}
70 Summary(pl): Pliki nag³ówkowe i dokumentacja do %{name}
71 Group: Development/Libraries
72 Requires: %{name} = %{version}-%{release}
75 Header files and development documentation for %{name}.
77 %description devel -l pl
78 Pliki nag³ówkowe i dokumentacja do %{name}.
81 Summary: Static devmapper library
82 Summary(pl): Statyczna biblioteka devmapper
83 Group: Development/Libraries
84 Requires: %{name}-devel = %{version}-%{release}
87 Static devmapper library.
89 %description static -l pl
90 Statyczna biblioteka devmapper.
93 Summary: Static devmapper library and header files for initrd applications
94 Summary(pl): Statyczna biblioteka devmapper i jej pliki nag³ówkowe dla aplikacji initrd
95 Group: Development/Libraries
96 Requires: %{name}-devel = %{version}-%{release}
99 %description initrd-devel
100 Static devmapper library and its header files for initrd applications
103 %description initrd-devel -l pl
104 Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki
105 nag³ówkowe dla aplikacji u¿ywanych w initrd.
108 Summary: Additional scripts
109 Summary(pl): Dodatkowe skrypty
110 Group: Applications/System
111 Requires: %{name} = %{version}-%{release}
117 %description scripts -l pl
121 %setup -q -n %{name}.%{version}
130 cp -f /usr/share/automake/config.sub autoconf
138 CLDFLAGS="%{rpmldflags}" \
140 --disable-dynamic_link \
141 --enable-static_link \
142 --with-optimisation="%{rpmcflags}" \
143 --with-user=%(id -u) \
144 --with-group=%(id -g) \
145 --with-interface=ioctl \
147 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
150 cp -a dmsetup/dmsetup.static initrd-dmsetup
151 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a
156 CC="%{_target_cpu}-uclibc-gcc" \
157 CLDFLAGS="%{rpmldflags}" \
159 --disable-dynamic_link \
160 --with-optimisation="-Os" \
161 --with-interface=ioctl \
163 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
166 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-uclibc.a
171 CLDFLAGS="%{rpmldflags}" \
172 --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \
173 --with-optimisation="%{rpmcflags}" \
174 --with-user=%(id -u) \
175 --with-group=%(id -g) \
176 --with-interface=ioctl \
182 rm -rf $RPM_BUILD_ROOT
183 install -d $RPM_BUILD_ROOT/{%{_lib},%{_libdir}/%{name}}
186 DESTDIR=$RPM_BUILD_ROOT
188 SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper.so.*.*)
189 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
190 SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper-event.so.*.*)
191 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so
192 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
193 install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
195 install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
196 install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir}
199 install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}}
200 install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}
201 install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a
202 install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
203 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc
204 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include
208 rm -rf $RPM_BUILD_ROOT
210 %post -p /sbin/ldconfig
211 %postun -p /sbin/ldconfig
214 %defattr(644,root,root,755)
215 %doc INTRO INSTALL README scripts/*
216 %attr(755,root,root) %{_sbindir}/dmsetup
217 %attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
218 %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
222 %defattr(644,root,root,755)
223 %attr(755,root,root) %{_libdir}/libdevmapper.so
224 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
225 %{_includedir}/libdevmapper*.h
228 %defattr(644,root,root,755)
229 %{_libdir}/libdevmapper.a
230 %{_libdir}/libdevmapper-event.a
233 %defattr(644,root,root,755)
234 %dir %{_libdir}/%{name}
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_sbindir}/initrd-dmsetup
243 %defattr(644,root,root,755)
244 %{_prefix}/%{_lib}/klibc/libdevmapper.a
245 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
246 %{_includedir}/klibc/libdevmapper.h
247 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h