]>
Commit | Line | Data |
---|---|---|
bff0a8a1 JB |
1 | # TODO: PLDify init script |
2 | # | |
3 | # Conditional build: | |
bff0a8a1 JB |
4 | %bcond_without kernel # don't build kernel modules |
5 | %bcond_without userspace # don't build userspace programs | |
6 | %bcond_with verbose # verbose build (V=1) | |
7 | # | |
3921af7f JR |
8 | # The goal here is to have main, userspace, package built once with |
9 | # simple release number, and only rebuild kernel packages with kernel | |
10 | # version as part of release number, without the need to bump release | |
11 | # with every kernel change. | |
12 | %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace} | |
13 | %{error:kernel and userspace cannot be built at the same time on PLD builders} | |
14 | exit 1 | |
15 | %endif | |
16 | ||
bff0a8a1 JB |
17 | %if %{without userspace} |
18 | # nothing to be placed to debuginfo package | |
19 | %define _enable_debug_packages 0 | |
20 | %endif | |
3921af7f JR |
21 | |
22 | %define _duplicate_files_terminate_build 0 | |
23 | ||
3921af7f | 24 | %define pname zfs |
4be71d8b | 25 | %define rel 8 |
bff0a8a1 JB |
26 | Summary: Native Linux port of the ZFS filesystem |
27 | Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS | |
3921af7f | 28 | Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel} |
ec61a23e | 29 | Version: 0.6.3 |
3921af7f | 30 | Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}} |
bff0a8a1 JB |
31 | License: CDDL (ZFS), GPL v2+ (ZPIOS) |
32 | Group: Applications/System | |
33 | Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz | |
ec61a23e | 34 | # Source0-md5: 5bcc32c122934d421eba68e16826637d |
3921af7f | 35 | Patch0: %{pname}-link.patch |
97d46215 | 36 | Patch1: linux-3.18.patch |
bbb69220 | 37 | Patch2: x32.patch |
00012a30 | 38 | Patch3: linux-3.19.patch |
4be71d8b | 39 | Patch4: linux-4.0.patch |
bff0a8a1 JB |
40 | URL: http://zfsonlinux.org/ |
41 | BuildRequires: autoconf >= 2.50 | |
42 | BuildRequires: automake | |
43 | BuildRequires: libtool | |
1b58aab1 | 44 | BuildRequires: rpmbuild(macros) >= 1.701 |
2d67b9de JR |
45 | %if %{with kernel} |
46 | %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2} | |
47 | %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3} | |
48 | %endif | |
bff0a8a1 JB |
49 | %if %{with userspace} |
50 | BuildRequires: libblkid-devel | |
51 | BuildRequires: libselinux-devel | |
52 | BuildRequires: libuuid-devel | |
53 | BuildRequires: zlib-devel | |
54 | %endif | |
55 | Requires: %{pname}-libs = %{version}-%{release} | |
56 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
57 | ||
8fa57ce6 JP |
58 | %define dracutlibdir %{_prefix}/lib/dracut |
59 | ||
bff0a8a1 JB |
60 | %description |
61 | ZFS is an advanced file system and volume manager which was originally | |
62 | developed for Solaris and is now maintained by the Illumos community. | |
63 | ||
64 | ZFS on Linux, which is also known as ZoL, is currently feature | |
65 | complete. It includes fully functional and stable SPA, DMU, ZVOL, and | |
66 | ZPL layers. | |
67 | ||
68 | %description -l pl.UTF-8 | |
69 | ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie | |
70 | stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos. | |
71 | ||
72 | ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w | |
73 | pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy | |
74 | SPA, DMU, ZVOL i ZPL. | |
75 | ||
76 | %package libs | |
77 | Summary: ZFS on Linux libraries | |
78 | Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa | |
79 | License: CDDL | |
80 | Group: Libraries | |
8fa57ce6 | 81 | Requires(post,postun): /sbin/ldconfig |
bff0a8a1 JB |
82 | |
83 | %description libs | |
84 | ZFS on Linux libraries. | |
85 | ||
86 | %description libs -l pl.UTF-8 | |
87 | Biblioteki ZFS-a dla Linuksa. | |
88 | ||
89 | %package devel | |
90 | Summary: Header files for ZFS libraries | |
91 | Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a | |
92 | License: CDDL | |
93 | Group: Development/Libraries | |
94 | Requires: %{pname}-libs = %{version}-%{release} | |
95 | Requires: libselinux-devel | |
96 | Requires: libuuid-devel | |
97 | Requires: zlib-devel | |
98 | ||
99 | %description devel | |
100 | Header files for ZFS libraries. | |
101 | ||
102 | %description devel -l pl.UTF-8 | |
103 | Pliki nagłówkowe bibliotek ZFS-a. | |
104 | ||
105 | %package static | |
106 | Summary: Static ZFS libraries | |
107 | Summary(pl.UTF-8): Statyczne biblioteki ZFS-a | |
108 | License: CDDL | |
109 | Group: Development/Libraries | |
110 | Requires: %{pname}-devel = %{version}-%{release} | |
111 | ||
112 | %description static | |
113 | Static ZFS libraries. | |
114 | ||
115 | %description static -l pl.UTF-8 | |
116 | Statyczne biblioteki ZFS-a. | |
117 | ||
118 | %package -n dracut-zfs | |
119 | Summary: ZFS support for Dracut | |
120 | Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta | |
121 | Group: Applications/System | |
122 | Requires: %{pname} = %{version}-%{release} | |
123 | Requires: dracut | |
124 | ||
125 | %description -n dracut-zfs | |
126 | ZFS support for Dracut. | |
127 | ||
128 | %description -n dracut-zfs -l pl.UTF-8 | |
129 | Obsługa ZFS-a dla Dracuta. | |
130 | ||
3921af7f | 131 | %package -n kernel-zfs-common-devel |
bff0a8a1 JB |
132 | Summary: ZFS Linux kernel headers |
133 | Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa | |
bff0a8a1 | 134 | Group: Development/Building |
bff0a8a1 | 135 | |
3921af7f JR |
136 | %description -n kernel-zfs-common-devel |
137 | ZFS Linux kernel headers common for all PLD kernel versions. | |
138 | ||
139 | %description -n kernel-zfs-common-devel -l pl.UTF-8 | |
140 | ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich | |
141 | wersji jąder PLD. | |
142 | ||
143 | %define kernel_pkg()\ | |
144 | %package -n kernel%{_alt_kernel}-zfs\ | |
145 | Summary: ZFS Linux kernel modules\ | |
146 | Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\ | |
147 | Release: %{rel}@%{_kernel_ver_str}\ | |
148 | Group: Base/Kernel\ | |
149 | Requires(post,postun): /sbin/depmod\ | |
3921af7f JR |
150 | %requires_releq_kernel\ |
151 | Requires(postun): %releq_kernel\ | |
3921af7f JR |
152 | \ |
153 | %description -n kernel%{_alt_kernel}-zfs\ | |
154 | ZFS Linux kernel modules.\ | |
155 | \ | |
156 | %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\ | |
157 | ZFS - moduły jądra Linuksa.\ | |
158 | \ | |
159 | %package -n kernel%{_alt_kernel}-zfs-devel\ | |
160 | Summary: ZFS Linux kernel headers\ | |
161 | Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\ | |
162 | Release: %{rel}@%{_kernel_ver_str}\ | |
163 | Group: Development/Building\ | |
3921af7f JR |
164 | Requires: kernel%{_alt_kernel}-headers\ |
165 | Requires: kernel-zfs-common-devel\ | |
3921af7f JR |
166 | \ |
167 | %description -n kernel%{_alt_kernel}-zfs-devel\ | |
168 | ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\ | |
169 | version %{_kernel_ver}.\ | |
170 | \ | |
171 | %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\ | |
172 | ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\ | |
173 | pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\ | |
174 | \ | |
175 | %files -n kernel%{_alt_kernel}-zfs\ | |
176 | %defattr(644,root,root,755)\ | |
177 | %dir /lib/modules/%{_kernel_ver}/misc/avl\ | |
178 | /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\ | |
179 | %dir /lib/modules/%{_kernel_ver}/misc/nvpair\ | |
180 | /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\ | |
181 | %dir /lib/modules/%{_kernel_ver}/misc/unicode\ | |
182 | /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\ | |
183 | %dir /lib/modules/%{_kernel_ver}/misc/zcommon\ | |
184 | /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\ | |
185 | %dir /lib/modules/%{_kernel_ver}/misc/zfs\ | |
186 | /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\ | |
187 | %dir /lib/modules/%{_kernel_ver}/misc/zpios\ | |
188 | /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\ | |
189 | \ | |
190 | %files -n kernel%{_alt_kernel}-zfs-devel\ | |
191 | %defattr(644,root,root,755)\ | |
192 | /usr/src/zfs-%{version}/%{_kernel_ver}\ | |
193 | \ | |
194 | %post -n kernel%{_alt_kernel}-zfs\ | |
195 | %depmod %{_kernel_ver}\ | |
196 | \ | |
197 | %postun -n kernel%{_alt_kernel}-zfs\ | |
198 | %depmod %{_kernel_ver}\ | |
199 | %{nil} | |
200 | ||
201 | %define build_kernel_pkg()\ | |
202 | %configure \\\ | |
203 | --disable-silent-rules \\\ | |
204 | --with-config="kernel" \\\ | |
205 | --with-linux=%{_kernelsrcdir}\ | |
206 | \ | |
207 | %{__make} clean\ | |
208 | %{__make} %{?with_verbose:V=1}\ | |
209 | p=`pwd`\ | |
210 | %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\ | |
211 | %{nil} | |
212 | ||
2d67b9de | 213 | %{?with_kernel:%{expand:%create_kernel_packages}} |
bff0a8a1 JB |
214 | |
215 | %prep | |
3921af7f | 216 | %setup -q -n %{pname}-%{version} |
bff0a8a1 | 217 | %patch0 -p1 |
97d46215 | 218 | %patch1 -p1 |
bbb69220 | 219 | %patch2 -p1 |
00012a30 | 220 | %patch3 -p1 |
4be71d8b | 221 | %patch4 -p1 |
bff0a8a1 JB |
222 | |
223 | %build | |
224 | %{__libtoolize} | |
225 | %{__aclocal} -I config | |
226 | %{__autoconf} | |
227 | %{__autoheader} | |
228 | %{__automake} | |
2d67b9de | 229 | %{?with_kernel:%{expand:%build_kernel_packages}} |
3921af7f JR |
230 | |
231 | %if %{with userspace} | |
bff0a8a1 JB |
232 | %configure \ |
233 | --disable-silent-rules \ | |
3921af7f | 234 | --with-config="user" \ |
bff0a8a1 | 235 | --with-linux=%{_kernelsrcdir} \ |
ec61a23e JB |
236 | --with-systemdunitdir=%{systemdunitdir} \ |
237 | --with-systemdpresetdir=/etc/systemd/system-preset \ | |
bff0a8a1 JB |
238 | --with-udevdir=/lib/udev |
239 | ||
240 | %{__make} \ | |
241 | %{?with_verbose:V=1} | |
3921af7f | 242 | %endif |
bff0a8a1 JB |
243 | |
244 | %install | |
245 | rm -rf $RPM_BUILD_ROOT | |
246 | ||
3921af7f JR |
247 | %if %{with kernel} |
248 | install -d $RPM_BUILD_ROOT | |
249 | cp -a installed/* $RPM_BUILD_ROOT | |
250 | %endif | |
251 | ||
252 | %if %{with userspace} | |
bff0a8a1 JB |
253 | %{__make} install \ |
254 | DESTDIR=$RPM_BUILD_ROOT \ | |
3921af7f JR |
255 | DEFAULT_INIT_DIR=/etc/rc.d/init.d |
256 | %endif | |
bff0a8a1 JB |
257 | |
258 | %clean | |
259 | rm -rf $RPM_BUILD_ROOT | |
260 | ||
8fa57ce6 JP |
261 | %post libs -p /sbin/ldconfig |
262 | %postun libs -p /sbin/ldconfig | |
263 | ||
bff0a8a1 JB |
264 | %if %{with userspace} |
265 | %files | |
266 | %defattr(644,root,root,755) | |
267 | %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown | |
268 | %attr(755,root,root) /sbin/mount.zfs | |
269 | %attr(755,root,root) %{_bindir}/arcstat.py | |
ec61a23e | 270 | %attr(755,root,root) %{_bindir}/dbufstat.py |
bff0a8a1 JB |
271 | %attr(755,root,root) %{_sbindir}/fsck.zfs |
272 | %attr(755,root,root) %{_sbindir}/zdb | |
ec61a23e | 273 | %attr(755,root,root) %{_sbindir}/zed |
bff0a8a1 JB |
274 | %attr(755,root,root) %{_sbindir}/zfs |
275 | %attr(755,root,root) %{_sbindir}/zhack | |
276 | %attr(755,root,root) %{_sbindir}/zinject | |
277 | %attr(755,root,root) %{_sbindir}/zpios | |
278 | %attr(755,root,root) %{_sbindir}/zpool | |
279 | %attr(755,root,root) %{_sbindir}/zstreamdump | |
280 | %attr(755,root,root) %{_sbindir}/ztest | |
281 | %dir %{_sysconfdir}/zfs | |
282 | # package *.example as %doc? (they cannot act as default configuration) | |
283 | %{_sysconfdir}/zfs/vdev_id.conf.*.example | |
ec61a23e JB |
284 | %dir %{_sysconfdir}/zfs/zed.d |
285 | %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh | |
286 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc | |
bff0a8a1 | 287 | %attr(754,root,root) /etc/rc.d/init.d/zfs |
ec61a23e JB |
288 | /usr/lib/modules-load.d/zfs.conf |
289 | /etc/systemd/system-preset/50-zfs.preset | |
290 | %{systemdunitdir}/zed.service | |
291 | %{systemdunitdir}/zfs.target | |
292 | %{systemdunitdir}/zfs-import-cache.service | |
293 | %{systemdunitdir}/zfs-import-scan.service | |
294 | %{systemdunitdir}/zfs-mount.service | |
295 | %{systemdunitdir}/zfs-share.service | |
bff0a8a1 JB |
296 | %attr(755,root,root) /lib/udev/vdev_id |
297 | %attr(755,root,root) /lib/udev/zvol_id | |
298 | /lib/udev/rules.d/60-zvol.rules | |
299 | /lib/udev/rules.d/69-vdev.rules | |
300 | /lib/udev/rules.d/90-zfs.rules | |
ec61a23e JB |
301 | %dir %{_libdir}/zfs |
302 | %dir %{_libdir}/zfs/zed.d | |
303 | %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh | |
bff0a8a1 JB |
304 | %dir %{_datadir}/zfs |
305 | %attr(755,root,root) %{_datadir}/zfs/*.sh | |
306 | %dir %{_datadir}/zfs/zpios-profile | |
307 | %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh | |
308 | %dir %{_datadir}/zfs/zpios-test | |
309 | %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh | |
310 | %dir %{_datadir}/zfs/zpool-config | |
311 | %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh | |
312 | %{_mandir}/man1/zhack.1* | |
313 | %{_mandir}/man1/zpios.1* | |
314 | %{_mandir}/man1/ztest.1* | |
315 | %{_mandir}/man5/vdev_id.conf.5* | |
ec61a23e | 316 | %{_mandir}/man5/zfs-module-parameters.5* |
bff0a8a1 JB |
317 | %{_mandir}/man5/zpool-features.5* |
318 | %{_mandir}/man8/fsck.zfs.8* | |
319 | %{_mandir}/man8/mount.zfs.8* | |
320 | %{_mandir}/man8/vdev_id.8* | |
321 | %{_mandir}/man8/zdb.8* | |
ec61a23e | 322 | %{_mandir}/man8/zed.8* |
bff0a8a1 JB |
323 | %{_mandir}/man8/zfs.8* |
324 | %{_mandir}/man8/zinject.8* | |
325 | %{_mandir}/man8/zpool.8* | |
326 | %{_mandir}/man8/zstreamdump.8* | |
327 | ||
328 | %files libs | |
329 | %defattr(644,root,root,755) | |
330 | %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.* | |
331 | %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1 | |
332 | %attr(755,root,root) %{_libdir}/libuutil.so.*.*.* | |
333 | %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1 | |
334 | %attr(755,root,root) %{_libdir}/libzfs.so.*.*.* | |
ec61a23e JB |
335 | %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2 |
336 | %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.* | |
337 | %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1 | |
bff0a8a1 | 338 | %attr(755,root,root) %{_libdir}/libzpool.so.*.*.* |
ec61a23e | 339 | %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2 |
bff0a8a1 JB |
340 | |
341 | %files devel | |
342 | %defattr(644,root,root,755) | |
343 | %attr(755,root,root) %{_libdir}/libnvpair.so | |
344 | %attr(755,root,root) %{_libdir}/libuutil.so | |
345 | %attr(755,root,root) %{_libdir}/libzfs.so | |
ec61a23e | 346 | %attr(755,root,root) %{_libdir}/libzfs_core.so |
bff0a8a1 JB |
347 | %attr(755,root,root) %{_libdir}/libzpool.so |
348 | %{_libdir}/libnvpair.la | |
349 | %{_libdir}/libuutil.la | |
350 | %{_libdir}/libzfs.la | |
ec61a23e | 351 | %{_libdir}/libzfs_core.la |
bff0a8a1 JB |
352 | %{_libdir}/libzpool.la |
353 | %{_includedir}/libspl | |
354 | %{_includedir}/libzfs | |
355 | ||
356 | %files static | |
357 | %defattr(644,root,root,755) | |
358 | %{_libdir}/libnvpair.a | |
359 | %{_libdir}/libuutil.a | |
360 | %{_libdir}/libzfs.a | |
ec61a23e | 361 | %{_libdir}/libzfs_core.a |
bff0a8a1 JB |
362 | %{_libdir}/libzpool.a |
363 | ||
364 | %files -n dracut-zfs | |
365 | %defattr(644,root,root,755) | |
366 | %doc dracut/README.dracut.markdown | |
8fa57ce6 JP |
367 | %dir %{dracutlibdir}/modules.d/90zfs |
368 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh | |
369 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh | |
370 | %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh | |
bff0a8a1 JB |
371 | %endif |
372 | ||
373 | %if %{with kernel} | |
3921af7f | 374 | %files -n kernel-zfs-common-devel |
bff0a8a1 | 375 | %defattr(644,root,root,755) |
e11b2ec8 | 376 | %dir /usr/src/zfs-%{version} |
3921af7f JR |
377 | /usr/src/zfs-%{version}/include |
378 | /usr/src/zfs-%{version}/zfs.release.in | |
379 | /usr/src/zfs-%{version}/zfs_config.h.in | |
bff0a8a1 | 380 | %endif |