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