]>
Commit | Line | Data |
---|---|---|
3f52d642 JB |
1 | # |
2 | # Conditional build: | |
3dfbba1b | 3 | %bcond_with initrd # without initrd version |
2d5d6d76 | 4 | %bcond_with dietlibc # build initrd version with static glibc instead of dietlibc |
68c065cd | 5 | %bcond_without selinux # build without SELinux support (needs selinux-disabled device-mapper) |
e21bd244 | 6 | |
05654b6c | 7 | %define rel 3 |
e21bd244 | 8 | %define subver rc16.3 |
ebec4317 | 9 | Summary: Device-mapper RAID tool |
121078cd | 10 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper |
23d76f1c | 11 | Name: dmraid |
12 | Version: 1.0.0 | |
e21bd244 | 13 | Release: 0.%{subver}.%{rel} |
b22dd630 | 14 | License: GPL v2+ |
23d76f1c | 15 | Group: Base |
b22dd630 JB |
16 | Source0: http://people.redhat.com/~heinzm/sw/dmraid/src/%{name}-%{version}.rc16-3.tar.bz2 |
17 | # Source0-md5: 819338fcef98e8e25819f0516722beeb | |
05654b6c JR |
18 | Source1: dmraid-activation.sh |
19 | Source2: dmraid-activation.service | |
4d0aa4a9 | 20 | Patch0: %{name}-selinux-static.patch |
b22dd630 JB |
21 | Patch1: %{name}-optflags.patch |
22 | Patch2: %{name}-unsigned.patch | |
23 | Patch3: %{name}-diet.patch | |
24 | Patch4: %{name}-format.patch | |
23d76f1c | 25 | URL: http://people.redhat.com/~heinzm/sw/dmraid/ |
26 | BuildRequires: autoconf | |
ebec4317 | 27 | BuildRequires: automake |
add5855c | 28 | BuildRequires: device-mapper-devel >= 1.02.02 |
1a668278 | 29 | BuildRequires: zlib-devel |
b5cee4d5 | 30 | %if %{with initrd} |
68c065cd JR |
31 | %if %{with dietlibc} |
32 | BuildRequires: device-mapper-dietlibc | |
33 | BuildRequires: dietlibc-static >= 2:0.31-5 | |
34 | %else | |
b5cee4d5 | 35 | BuildRequires: device-mapper-static >= 1.02.05-0.4 |
36 | BuildRequires: glibc-static | |
2d5d6d76 | 37 | BuildRequires: udev-static |
68c065cd JR |
38 | %if %{with selinux} |
39 | BuildRequires: libselinux-static | |
40 | BuildRequires: libsepol-static | |
41 | %endif | |
42 | %endif | |
43 | %endif | |
44 | %if %{with selinux} | |
45 | BuildRequires: libselinux-devel | |
46 | BuildRequires: libsepol-devel | |
b5cee4d5 | 47 | %endif |
05654b6c JR |
48 | BuildRequires: rpmbuild(macros) >= 1.671 |
49 | Requires: systemd-units >= 38 | |
23d76f1c | 50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
6f013d0d JR |
52 | %define _sbindir /sbin |
53 | ||
23d76f1c | 54 | %description |
55 | DMRAID supports device discovery, set activation and display of | |
56 | properties for ATARAID on Linux >= 2.4 using device-mapper. | |
57 | ||
c95e574d JR |
58 | %description -l pl.UTF-8 |
59 | DMRAID obsługuje wykrywanie urządzeń, ustawianie aktywacji i | |
60 | wyświetlanie właściwości ATARAID-u na Linuksie >= 2.4 przy użyciu | |
ebec4317 JB |
61 | device-mappera. |
62 | ||
36674070 | 63 | %package devel |
ebaa32bf | 64 | Summary: Header files for dmraid library |
121078cd | 65 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki dmraid |
36674070 | 66 | Group: Development/Libraries |
07712890 | 67 | Requires: %{name} = %{version}-%{release} |
36674070 ER |
68 | |
69 | %description devel | |
70 | dmraid-devel provides a library interface for RAID device discovery, | |
71 | RAID set activation and display of properties for ATARAID volumes. | |
72 | ||
c95e574d JR |
73 | %description devel -l pl.UTF-8 |
74 | Ten pakiet udostępnia interfejs biblioteczny do wykrywania urządzeń | |
75 | RAID, włączania zestawu RAID i wyświetlania właściwości wolumenów | |
ebaa32bf JB |
76 | ATARAID. |
77 | ||
36674070 | 78 | %package static |
ebaa32bf | 79 | Summary: Static library for dmraid |
121078cd | 80 | Summary(pl.UTF-8): Statyczna biblioteka dmraid |
36674070 ER |
81 | Group: Development/Libraries |
82 | Requires: %{name}-devel = %{version}-%{release} | |
83 | ||
84 | %description static | |
85 | dmraid-static provides a library interface for RAID device discovery, | |
86 | RAID set activation and display of properties for ATARAID volumes. | |
87 | ||
c95e574d JR |
88 | %description static -l pl.UTF-8 |
89 | Ten pakiet udostępnia statyczną bibliotekę do wykrywania urządzeń | |
90 | RAID, włączania zestawu RAID i wyświetlania właściwości wolumenów | |
ebaa32bf JB |
91 | ATARAID. |
92 | ||
d8d39b7c | 93 | %package initrd |
94 | Summary: Device-mapper RAID tool - statically linked version | |
121078cd | 95 | Summary(pl.UTF-8): Narzędzie do RAID-u opartego o device-mapper - wersja statyczna |
d8d39b7c | 96 | Group: Base |
d0a66218 | 97 | Conflicts: geninitrd < 10000.10 |
d8d39b7c | 98 | |
99 | %description initrd | |
3f52d642 | 100 | Statically linked version of dmraid utility. |
d8d39b7c | 101 | |
c95e574d JR |
102 | %description initrd -l pl.UTF-8 |
103 | Statycznie skonsolidowana wersja programu narzędziowego dmraid. | |
d8d39b7c | 104 | |
23d76f1c | 105 | %prep |
106 | %setup -q -n %{name} | |
b22dd630 | 107 | mv %{version}.*/dmraid/* . |
b5cee4d5 | 108 | %{?with_selinux:%patch0 -p2} |
56b461b5 JB |
109 | %patch1 -p1 |
110 | %patch2 -p1 | |
3c62db72 | 111 | %patch3 -p1 |
68c065cd | 112 | %patch4 -p1 |
23d76f1c | 113 | |
114 | %build | |
ee76a598 | 115 | cp -f /usr/share/automake/config.sub autoconf |
23d76f1c | 116 | %{__aclocal} |
117 | %{__autoconf} | |
118 | ||
3f52d642 JB |
119 | %if %{with initrd} |
120 | %configure \ | |
eec64f5f | 121 | %if %{with dietlibc} |
fcfd5328 | 122 | CC="diet %{__cc} %{rpmcflags} %{rpmldflags} -Os -static" \ |
68c065cd JR |
123 | --disable-libselinux \ |
124 | --disable-libsepol \ | |
eec64f5f JR |
125 | %else |
126 | %if %{with selinux} | |
127 | --enable-libselinux \ | |
128 | --enable-libsepol \ | |
129 | %endif | |
68c065cd | 130 | %endif |
3f52d642 | 131 | --enable-static_link |
68c065cd | 132 | |
4623ff68 | 133 | %{__make} -j1 |
152b8c5d | 134 | mv -f tools/dmraid dmraid-initrd |
d8d39b7c | 135 | %{__make} clean |
3f52d642 JB |
136 | %endif |
137 | ||
56b461b5 | 138 | %configure \ |
3dfbba1b JR |
139 | --with-usrlibdir=%{_libdir} \ |
140 | --disable-static_link \ | |
141 | --enable-led \ | |
142 | --enable-intel_led | |
4623ff68 | 143 | %{__make} -j1 |
23d76f1c | 144 | |
145 | %install | |
146 | rm -rf $RPM_BUILD_ROOT | |
05654b6c | 147 | install -d $RPM_BUILD_ROOT{/%{_lib},%{systemdunitdir}} |
23d76f1c | 148 | |
56b461b5 | 149 | %{__make} install \ |
b22dd630 | 150 | DESTDIR=$RPM_BUILD_ROOT |
23d76f1c | 151 | |
6f013d0d JR |
152 | mv $RPM_BUILD_ROOT%{_libdir}/libdmraid.so.* $RPM_BUILD_ROOT/%{_lib} |
153 | ln -sf /%{_lib}/$(cd $RPM_BUILD_ROOT/%{_lib} ; echo libdmraid.so.*.*.*) \ | |
154 | $RPM_BUILD_ROOT%{_libdir}/libdmraid.so | |
155 | ||
56b461b5 | 156 | %if %{with initrd} |
152b8c5d | 157 | install -d $RPM_BUILD_ROOT%{_libdir}/initrd |
e21bd244 | 158 | install -p dmraid-initrd $RPM_BUILD_ROOT%{_libdir}/initrd/dmraid |
56b461b5 | 159 | %endif |
36674070 | 160 | |
05654b6c JR |
161 | # Install systemd unit |
162 | install -p %{SOURCE1} $RPM_BUILD_ROOT/lib/systemd/dmraid-activation | |
163 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{systemdunitdir}/dmraid-activation.service | |
164 | ||
23d76f1c | 165 | %clean |
166 | rm -rf $RPM_BUILD_ROOT | |
167 | ||
05654b6c JR |
168 | %post |
169 | /sbin/ldconfig | |
170 | %systemd_post dmraid-activation.service | |
171 | ||
172 | %preun | |
173 | %systemd_preun dmraid-activation.service | |
174 | ||
175 | %postun | |
176 | /sbin/ldconfig | |
177 | %systemd_reload | |
178 | ||
179 | %triggerpostun -- %{name} < 1.0.0-0.rc16.3.3 | |
180 | %systemd_trigger dmraid-activation.service | |
56b461b5 | 181 | |
23d76f1c | 182 | %files |
183 | %defattr(644,root,root,755) | |
b22dd630 | 184 | %doc CHANGELOG CREDITS KNOWN_BUGS README TODO doc/dmraid_design.txt |
05654b6c JR |
185 | %attr(755,root,root) /lib/systemd/dmraid-activation |
186 | %{systemdunitdir}/dmraid-activation.service | |
b22dd630 | 187 | %attr(755,root,root) %{_sbindir}/dmevent_tool |
56b461b5 | 188 | %attr(755,root,root) %{_sbindir}/dmraid |
6f013d0d | 189 | %attr(755,root,root) /%{_lib}/libdmraid.so.*.*.* |
b22dd630 JB |
190 | %attr(755,root,root) %ghost /%{_lib}/libdmraid.so.1 |
191 | %attr(755,root,root) %{_libdir}/libdmraid-events-isw.so | |
192 | %attr(755,root,root) %{_libdir}/device-mapper/libdmraid-events-isw.so | |
193 | %{_mandir}/man8/dmevent_tool.8* | |
194 | %{_mandir}/man8/dmraid.8* | |
d8d39b7c | 195 | |
36674070 ER |
196 | %files devel |
197 | %defattr(644,root,root,755) | |
56b461b5 | 198 | %attr(755,root,root) %{_libdir}/libdmraid.so |
36674070 ER |
199 | %{_includedir}/dmraid |
200 | ||
201 | %files static | |
202 | %defattr(644,root,root,755) | |
203 | %{_libdir}/libdmraid.a | |
204 | ||
3f52d642 | 205 | %if %{with initrd} |
d8d39b7c | 206 | %files initrd |
207 | %defattr(644,root,root,755) | |
152b8c5d | 208 | %attr(755,root,root) %{_libdir}/initrd/dmraid |
3f52d642 | 209 | %endif |