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