]>
Commit | Line | Data |
---|---|---|
f104c9f0 ER |
1 | # TODO |
2 | # - add fix to drop BuildConflicts: device-mapper-initrd-devel | |
e2b16e78 ER |
3 | # |
4 | # Conditional build: | |
5 | %bcond_without selinux # build without SELinux support | |
64485ac5 | 6 | %bcond_without initrd # don't build initrd version |
e2b16e78 | 7 | # |
24effc5a | 8 | Summary: Userspace support for the device-mapper |
a2ba3b1a | 9 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika |
24effc5a | 10 | Name: device-mapper |
f4b41109 | 11 | Version: 1.02.18 |
dbc72a35 | 12 | Release: 1 |
2d831627 | 13 | License: GPL v2 |
24effc5a | 14 | Group: Applications/System |
e8083e24 | 15 | Source0: ftp://sources.redhat.com/pub/dm/%{name}.%{version}.tgz |
f4b41109 | 16 | # Source0-md5: 8ccb87923a9f33580205e5a9b39c8d58 |
af449e2d | 17 | # http://www.redhat.com/archives/dm-devel/2005-March/msg00022.html |
7db152f4 AM |
18 | Patch0: %{name}-disable_dynamic_link.patch |
19 | Patch1: %{name}-klibc.patch | |
20 | Patch2: %{name}-getopt.patch | |
23814d9f | 21 | Patch3: %{name}-ac.patch |
b0069eb2 | 22 | Patch4: %{name}-force-local-headers.patch |
bc05beb9 | 23 | Patch5: %{name}-linking.patch |
0f6d8388 | 24 | URL: http://sources.redhat.com/dm/ |
82ab75b9 JB |
25 | BuildRequires: autoconf |
26 | BuildRequires: automake | |
8ae4c2e7 | 27 | %{?with_initrd:BuildRequires: klibc-static} |
e2b16e78 | 28 | %{?with_selinux:BuildRequires: libselinux-devel >= 1.10} |
44d58241 | 29 | %{?with_initrd:BuildRequires: uClibc-static >= 0.9.26} |
f104c9f0 | 30 | # /usr/include/klibc/libdevmapper.h is included first before currently built version with klcc |
47656ea8 | 31 | BuildConflicts: device-mapper-initrd-devel < 1.02.17 |
e2b16e78 | 32 | %{?with_selinux:Requires: libselinux >= 1.10} |
bd7310b0 | 33 | Conflicts: dev < 2.9.0-8 |
24effc5a JR |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
35 | ||
8ae4c2e7 | 36 | %undefine configure_cache |
3f80d918 | 37 | %define _sbindir /sbin |
24effc5a JR |
38 | |
39 | %description | |
8ae4c2e7 ER |
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. | |
24effc5a | 45 | |
249e98b8 JR |
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. | |
82ab75b9 | 53 | |
64485ac5 JK |
54 | %package initrd |
55 | Summary: Userspace support for the device-mapper - static dmsetup for initrd | |
a2ba3b1a | 56 | Summary(pl.UTF-8): Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczne dmsetup dla initrd |
64485ac5 JK |
57 | Group: Applications/System |
58 | Requires: %{name} = %{version}-%{release} | |
59 | ||
60 | %description initrd | |
1a143708 JB |
61 | Userspace support for the device-mapper - static dmsetup binary for |
62 | initrd. | |
64485ac5 | 63 | |
249e98b8 JR |
64 | %description initrd -l pl.UTF-8 |
65 | Wsparcie dla mapowania urządzeń w przestrzeni użytkownika - statyczna | |
1a143708 | 66 | wersja dmsetup dla initrd. |
64485ac5 | 67 | |
3f80d918 JR |
68 | %package devel |
69 | Summary: Header files and development documentation for %{name} | |
a2ba3b1a | 70 | Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do %{name} |
3f80d918 | 71 | Group: Development/Libraries |
2560a7ef | 72 | Requires: %{name} = %{version}-%{release} |
3f80d918 JR |
73 | |
74 | %description devel | |
75 | Header files and development documentation for %{name}. | |
76 | ||
249e98b8 JR |
77 | %description devel -l pl.UTF-8 |
78 | Pliki nagłówkowe i dokumentacja do %{name}. | |
3f80d918 | 79 | |
7858f662 | 80 | %package static |
5a698747 | 81 | Summary: Static devmapper library |
a2ba3b1a | 82 | Summary(pl.UTF-8): Statyczna biblioteka devmapper |
7858f662 | 83 | Group: Development/Libraries |
2560a7ef | 84 | Requires: %{name}-devel = %{version}-%{release} |
7858f662 AF |
85 | |
86 | %description static | |
5a698747 JB |
87 | Static devmapper library. |
88 | ||
249e98b8 | 89 | %description static -l pl.UTF-8 |
5a698747 | 90 | Statyczna biblioteka devmapper. |
7858f662 | 91 | |
af449e2d JK |
92 | %package initrd-devel |
93 | Summary: Static devmapper library and header files for initrd applications | |
a2ba3b1a | 94 | Summary(pl.UTF-8): Statyczna biblioteka devmapper i jej pliki nagłówkowe dla aplikacji initrd |
af449e2d JK |
95 | Group: Development/Libraries |
96 | Requires: %{name}-devel = %{version}-%{release} | |
97 | Requires: klibc | |
98 | ||
99 | %description initrd-devel | |
1a143708 JB |
100 | Static devmapper library and its header files for initrd applications |
101 | linked with klibc. | |
af449e2d | 102 | |
249e98b8 | 103 | %description initrd-devel -l pl.UTF-8 |
1a143708 | 104 | Statyczna, zlinkowana z klibc biblioteka devmapper oraz jej pliki |
249e98b8 | 105 | nagłówkowe dla aplikacji używanych w initrd. |
af449e2d | 106 | |
e4b9886f | 107 | %package scripts |
108 | Summary: Additional scripts | |
a2ba3b1a | 109 | Summary(pl.UTF-8): Dodatkowe skrypty |
e4b9886f | 110 | Group: Applications/System |
e4b9886f | 111 | Requires: %{name} = %{version}-%{release} |
5de8a2b5 | 112 | Requires: util-linux |
e4b9886f | 113 | |
114 | %description scripts | |
115 | Additional scripts. | |
116 | ||
249e98b8 | 117 | %description scripts -l pl.UTF-8 |
5de8a2b5 | 118 | Dodatkowe skrypty. |
e4b9886f | 119 | |
24effc5a JR |
120 | %prep |
121 | %setup -q -n %{name}.%{version} | |
5108239d | 122 | %patch0 -p1 |
af449e2d JK |
123 | %patch1 -p1 |
124 | %patch2 -p1 | |
23814d9f | 125 | %patch3 -p1 |
b0069eb2 | 126 | %patch4 -p1 |
bc05beb9 | 127 | %patch5 -p1 |
0281e413 | 128 | |
24effc5a | 129 | %build |
7c94dbf3 | 130 | cp -f /usr/share/automake/config.sub autoconf |
ac7f2b07 TP |
131 | %{__aclocal} |
132 | %{__autoconf} | |
64485ac5 JK |
133 | |
134 | %if %{with initrd} | |
44d58241 | 135 | # kcc |
d536b3d1 | 136 | %configure \ |
c4009345 | 137 | CC="klcc -static" \ |
0f8f5516 | 138 | CLDFLAGS="%{rpmldflags}" \ |
64485ac5 | 139 | --disable-selinux \ |
c4009345 JB |
140 | --disable-dynamic_link \ |
141 | --enable-static_link \ | |
64485ac5 JK |
142 | --with-optimisation="%{rpmcflags}" \ |
143 | --with-user=%(id -u) \ | |
144 | --with-group=%(id -g) \ | |
d831393d ER |
145 | --with-interface=ioctl \ |
146 | --disable-nls | |
c4009345 | 147 | sed -i -e 's#rpl_malloc#malloc#g' include/configure.h |
64485ac5 JK |
148 | %{__make} |
149 | ||
150 | cp -a dmsetup/dmsetup.static initrd-dmsetup | |
44d58241 ER |
151 | cp -a lib/ioctl/libdevmapper.a initrd-libdevmapper-klibc.a |
152 | %{__make} clean | |
153 | ||
154 | # uclibc (for lvm2) | |
155 | %configure \ | |
bd502012 | 156 | CC="%{_target_cpu}-uclibc-gcc" \ |
0f8f5516 | 157 | CLDFLAGS="%{rpmldflags}" \ |
44d58241 | 158 | --disable-selinux \ |
bd502012 ER |
159 | --disable-dynamic_link \ |
160 | --with-optimisation="-Os" \ | |
161 | --with-interface=ioctl \ | |
44d58241 ER |
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 | |
64485ac5 JK |
167 | %{__make} clean |
168 | %endif | |
169 | ||
170 | %configure \ | |
0f8f5516 | 171 | CLDFLAGS="%{rpmldflags}" \ |
64485ac5 | 172 | --%{?with_selinux:en}%{!?with_selinux:dis}able-selinux \ |
c4009345 | 173 | --with-optimisation="%{rpmcflags}" \ |
9dfe67ca PS |
174 | --with-user=%(id -u) \ |
175 | --with-group=%(id -g) \ | |
af449e2d | 176 | --with-interface=ioctl \ |
20f45f1d | 177 | --enable-dmeventd \ |
af449e2d | 178 | --disable-klibc |
24effc5a JR |
179 | %{__make} |
180 | ||
181 | %install | |
182 | rm -rf $RPM_BUILD_ROOT | |
44d58241 | 183 | install -d $RPM_BUILD_ROOT/{%{_lib},%{_libdir}/%{name}} |
24effc5a | 184 | |
2b3200b7 PG |
185 | %{__make} install \ |
186 | DESTDIR=$RPM_BUILD_ROOT | |
24effc5a | 187 | |
fddd209a | 188 | SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper.so.*.*) |
a4826f8d | 189 | ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper.so |
c4009345 JB |
190 | SONAME=$(cd $RPM_BUILD_ROOT%{_libdir}; echo libdevmapper-event.so.*.*) |
191 | ln -sf /%{_lib}/${SONAME} $RPM_BUILD_ROOT%{_libdir}/libdevmapper-event.so | |
9b4e9149 | 192 | mv -f $RPM_BUILD_ROOT%{_libdir}/lib*.so.*.* $RPM_BUILD_ROOT/%{_lib} |
c4009345 | 193 | install scripts/* $RPM_BUILD_ROOT%{_libdir}/%{name} |
3f80d918 | 194 | |
bc9650f9 | 195 | install lib/ioctl/libdevmapper.a $RPM_BUILD_ROOT%{_libdir} |
c4009345 JB |
196 | install dmeventd/libdevmapper-event.a $RPM_BUILD_ROOT%{_libdir} |
197 | ||
198 | %if %{with initrd} | |
7f0aa7db | 199 | install -d $RPM_BUILD_ROOT/usr/{{%{_lib},include}/klibc,%{_target_cpu}-linux-uclibc/usr/{lib,include}} |
c4009345 | 200 | install initrd-dmsetup $RPM_BUILD_ROOT%{_sbindir} |
44d58241 | 201 | install initrd-libdevmapper-klibc.a $RPM_BUILD_ROOT/usr/%{_lib}/klibc/libdevmapper.a |
7f0aa7db | 202 | install initrd-libdevmapper-uclibc.a $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a |
c4009345 | 203 | install include/libdevmapper.h $RPM_BUILD_ROOT/usr/include/klibc |
44d58241 | 204 | install include/libdevmapper.h $RPM_BUILD_ROOT/usr/%{_target_cpu}-linux-uclibc/usr/include |
c4009345 | 205 | %endif |
7858f662 | 206 | |
24effc5a JR |
207 | %clean |
208 | rm -rf $RPM_BUILD_ROOT | |
209 | ||
82ab75b9 | 210 | %post -p /sbin/ldconfig |
3f80d918 JR |
211 | %postun -p /sbin/ldconfig |
212 | ||
24effc5a JR |
213 | %files |
214 | %defattr(644,root,root,755) | |
4b55423a | 215 | %doc INTRO INSTALL README scripts/* |
47656ea8 | 216 | %attr(755,root,root) %{_sbindir}/dmeventd |
64485ac5 | 217 | %attr(755,root,root) %{_sbindir}/dmsetup |
c4009345 JB |
218 | %attr(755,root,root) /%{_lib}/libdevmapper.so.*.* |
219 | %attr(755,root,root) /%{_lib}/libdevmapper-event.so.*.* | |
3f80d918 JR |
220 | %{_mandir}/man8/* |
221 | ||
222 | %files devel | |
223 | %defattr(644,root,root,755) | |
9dfe67ca | 224 | %attr(755,root,root) %{_libdir}/libdevmapper.so |
c4009345 JB |
225 | %attr(755,root,root) %{_libdir}/libdevmapper-event.so |
226 | %{_includedir}/libdevmapper*.h | |
7858f662 AF |
227 | |
228 | %files static | |
229 | %defattr(644,root,root,755) | |
c4009345 JB |
230 | %{_libdir}/libdevmapper.a |
231 | %{_libdir}/libdevmapper-event.a | |
e4b9886f | 232 | |
233 | %files scripts | |
234 | %defattr(644,root,root,755) | |
235 | %dir %{_libdir}/%{name} | |
236 | %{_libdir}/%{name}/* | |
64485ac5 | 237 | |
79c38c76 | 238 | %if %{with initrd} |
64485ac5 JK |
239 | %files initrd |
240 | %defattr(644,root,root,755) | |
241 | %attr(755,root,root) %{_sbindir}/initrd-dmsetup | |
af449e2d JK |
242 | |
243 | %files initrd-devel | |
244 | %defattr(644,root,root,755) | |
8ae4c2e7 | 245 | %{_prefix}/%{_lib}/klibc/libdevmapper.a |
7f0aa7db | 246 | %{_prefix}/%{_target_cpu}-linux-uclibc/usr/lib/libdevmapper.a |
8ae4c2e7 | 247 | %{_includedir}/klibc/libdevmapper.h |
44d58241 | 248 | %{_prefix}/%{_target_cpu}-linux-uclibc/usr/include/libdevmapper.h |
79c38c76 | 249 | %endif |