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