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