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