]> git.pld-linux.org Git - packages/device-mapper.git/blob - device-mapper.spec
833bf8d606f324fd073cdc63adb40ce812ece8e4
[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.10
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:  26f189bfc37c3fa786f36e47fb0a0ba5
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.07
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
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):    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
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):    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
78 Pliki nag³ówkowe i dokumentacja do %{name}.
79
80 %package static
81 Summary:        Static devmapper library
82 Summary(pl):    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
90 Statyczna biblioteka devmapper.
91
92 %package initrd-devel
93 Summary:        Static devmapper library and header files for initrd applications
94 Summary(pl):    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
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):    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
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}/dmsetup
217 %attr(755,root,root) /%{_lib}/libdevmapper.so.*.*
218 %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.*
219 %{_mandir}/man8/*
220
221 %files devel
222 %defattr(644,root,root,755)
223 %attr(755,root,root) %{_libdir}/libdevmapper.so
224 %attr(755,root,root) %{_libdir}/libdevmapper-event.so
225 %{_includedir}/libdevmapper*.h
226
227 %files static
228 %defattr(644,root,root,755)
229 %{_libdir}/libdevmapper.a
230 %{_libdir}/libdevmapper-event.a
231
232 %files scripts
233 %defattr(644,root,root,755)
234 %dir %{_libdir}/%{name}
235 %{_libdir}/%{name}/*
236
237 %if %{with initrd}
238 %files initrd
239 %defattr(644,root,root,755)
240 %attr(755,root,root) %{_sbindir}/initrd-dmsetup
241
242 %files initrd-devel
243 %defattr(644,root,root,755)
244 %{_prefix}/%{_lib}/klibc/libdevmapper.a
245 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a
246 %{_includedir}/klibc/libdevmapper.h
247 %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h
248 %endif
This page took 0.033495 seconds and 2 git commands to generate.