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: 0127820a542f08a61d34739cd6c81fbc
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 URL: http://sources.redhat.com/dm/
24 BuildRequires: autoconf
25 BuildRequires: automake
26 %{?with_initrd:BuildRequires: klibc-static}
27 %{?with_selinux:BuildRequires: libselinux-devel >= 1.10}
28 %{?with_initrd:BuildRequires: uClibc-static >= 0.9.26}
29 # /usr/include/klibc/libdevmapper.h is included first before currently built version with klcc
30 BuildConflicts: device-mapper-initrd-devel < 1.02.07
31 %{?with_selinux:Requires: libselinux >= 1.10}
32 Conflicts: dev < 2.9.0-8
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %undefine configure_cache
36 %define _sbindir /sbin
39 The goal of this driver is to support volume management. The driver
40 enables the definition of new block devices composed of ranges of
41 sectors of existing devices. This can be used to define disk
42 partitions - or logical volumes. This light-weight kernel component
43 can support user-space tools for logical volume management.
46 Celem tego sterownika jest obs³uga zarz±dzania wolumenami. Sterownik
47 w³±cza definiowanie nowych urz±dzeñ blokowych z³o¿onych z przedzia³ów
48 sektorów na istniej±cych urz±dzeniach. Mo¿e to byæ wykorzystane do
49 definiowania partycji na dysku lub logicznych wolumenów. Ten lekki
50 sk³adnik j±dra mo¿e wspieraæ dzia³aj±ce w przestrzeni u¿ytkownika
51 narzêdzia do zarz±dzania logicznymi wolumenami.
54 Summary: Userspace support for the device-mapper - static dmsetup for initrd
55 Summary(pl): Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczne dmsetup dla initrd
56 Group: Applications/System
57 Requires: %{name} = %{version}-%{release}
60 Userspace support for the device-mapper - static dmsetup binary for
63 %description initrd -l pl
64 Wsparcie dla mapowania urz±dzeñ w przestrzeni u¿ytkownika - statyczna
65 wersja dmsetup dla initrd.
68 Summary: Header files and development documentation for %{name}
69 Summary(pl): Pliki nag³ówkowe i dokumentacja do %{name}
70 Group: Development/Libraries
71 Requires: %{name} = %{version}-%{release}
74 Header files and development documentation for %{name}.
76 %description devel -l pl
77 Pliki nag³ówkowe i dokumentacja do %{name}.
80 Summary: Static devmapper library
81 Summary(pl): Statyczna biblioteka devmapper
82 Group: Development/Libraries
83 Requires: %{name}-devel = %{version}-%{release}
86 Static devmapper library.
88 %description static -l pl
89 Statyczna biblioteka devmapper.
92 Summary: Static devmapper library and header files for initrd applications
93 Summary(pl): Statyczna biblioteka devmapper i jej pliki nag³ówkowe dla aplikacji initrd
94 Group: Development/Libraries
95 Requires: %{name}-devel = %{version}-%{release}
98 %description initrd-devel
99 Static devmapper library and its header files for initrd applications
102 %description initrd-devel -l pl
103 Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki
104 nag³ówkowe dla aplikacji u¿ywanych w initrd.
107 Summary: Additional scripts
108 Summary(pl): Dodatkowe skrypty
109 Group: Applications/System
110 Requires: %{name} = %{version}-%{release}
116 %description scripts -l pl
120 %setup -q -n %{name}.%{version}
128 cp -f /usr/share/automake/config.sub autoconf
136 CLDFLAGS="%{rpmldflags}" \
138 --disable-dynamic_link \
139 --enable-static_link \
140 --with-optimisation="%{rpmcflags}" \
141 --with-user=%(id -u) \
142 --with-group=%(id -g) \
143 --with-interface=ioctl \
145 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
148 cp -a dmsetup/dmsetup.static initrd-dmsetup
149 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a
154 CC="%{_target_cpu}-uclibc-gcc" \
155 CLDFLAGS="%{rpmldflags}" \
157 --disable-dynamic_link \
158 --with-optimisation="-Os" \
159 --with-interface=ioctl \
161 sed -i -e 's#rpl_malloc#malloc#g' include/configure.h
164 cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-uclibc.a
169 CLDFLAGS="%{rpmldflags}" \
170 --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \
171 --with-optimisation="%{rpmcflags}" \
172 --with-user=%(id -u) \
173 --with-group=%(id -g) \
174 --with-interface=ioctl \
180 rm -rf $RPM_BUILD_ROOT
181 install -d $RPM_BUILD_ROOT/{%{_lib},%{_libdir}/%{name}}
184 DESTDIR=$RPM_BUILD_ROOT
186 SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper.so.*.*)
187 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so
188 SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper-event.so.*.*)
189 ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so
190 mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib}
191 install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name}
193 install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir}
194 install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir}
197 install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}}
198 install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir}
199 install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a
200 install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
201 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc
202 install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include
206 rm -rf $RPM_BUILD_ROOT
208 %post -p /sbin/ldconfig
209 %postun -p /sbin/ldconfig
212 %defattr(644,root,root,755)
213 %doc INTRO INSTALL README scripts/*
214 %attr(755,root,root) %{_sbindir}/dmsetup
215 %attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
216 %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
220 %defattr(644,root,root,755)
221 %attr(755,root,root) %{_libdir}/libdevmapper.so
222 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
223 %{_includedir}/libdevmapper*.h
226 %defattr(644,root,root,755)
227 %{_libdir}/libdevmapper.a
228 %{_libdir}/libdevmapper-event.a
231 %defattr(644,root,root,755)
232 %dir %{_libdir}/%{name}
237 %defattr(644,root,root,755)
238 %attr(755,root,root) %{_sbindir}/initrd-dmsetup
241 %defattr(644,root,root,755)
242 %{_prefix}/%{_lib}/klibc/libdevmapper.a
243 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
244 %{_includedir}/klibc/libdevmapper.h
245 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h