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