]> git.pld-linux.org Git - packages/zfs.git/blob - zfs.spec
- up to 0.8.1
[packages/zfs.git] / zfs.spec
1 # TODO:
2 # - PLDify init script
3 # - unpackaged initramfs-tools support:
4 #   /usr/share/initramfs-tools/conf-hooks.d/zfs
5 #   /usr/share/initramfs-tools/hooks/zfs
6 #   /usr/share/initramfs-tools/scripts/zfs
7 #
8 # Conditional build:
9 %bcond_without  kernel          # don't build kernel modules
10 %bcond_without  userspace       # don't build userspace programs
11 %bcond_without  python2         # CPython 2.x module
12 %bcond_without  python3         # CPython 3.x module
13 %bcond_with     verbose         # verbose build (V=1)
14 #
15 # The goal here is to have main, userspace, package built once with
16 # simple release number, and only rebuild kernel packages with kernel
17 # version as part of release number, without the need to bump release
18 # with every kernel change.
19 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
20 %{error:kernel and userspace cannot be built at the same time on PLD builders}
21 exit 1
22 %endif
23
24 %if %{without userspace}
25 # nothing to be placed to debuginfo package
26 %define         _enable_debug_packages  0
27 %endif
28
29 %define         _duplicate_files_terminate_build        0
30
31 %define rel     1
32 %define pname   zfs
33 Summary:        Native Linux port of the ZFS filesystem
34 Summary(pl.UTF-8):      Natywny linuksowy port systemu plików ZFS
35 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
36 Version:        0.8.1
37 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
38 License:        CDDL
39 Group:          Applications/System
40 #Source0:       https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz
41 Source0:        https://github.com/zfsonlinux/zfs/archive/zfs-%{version}/%{pname}-%{version}.tar.gz
42 # Source0-md5:  db6618a09f6494e1126b14a1302f77c8
43 Patch0:         x32.patch
44 Patch1:         am.patch
45 URL:            http://zfsonlinux.org/
46 BuildRequires:  autoconf >= 2.50
47 BuildRequires:  automake
48 BuildRequires:  libtool
49 BuildRequires:  rpmbuild(macros) >= 1.714
50 %if %{with kernel}
51 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
52 %endif
53 %if %{with userspace}
54 # only for mmap_libaio test command
55 #BuildRequires: libaio-devel
56 BuildRequires:  libblkid-devel
57 BuildRequires:  libselinux-devel
58 # if xdr gets removed from glibc
59 #BuildRequires: libtirpc-devel
60 BuildRequires:  libuuid-devel
61 BuildRequires:  openssl-devel
62 BuildRequires:  pkgconfig
63 BuildRequires:  udev-devel
64 BuildRequires:  zlib-devel
65 %if %{with python2}
66 BuildRequires:  python-cffi
67 BuildRequires:  python-modules >= 1:2.6
68 BuildRequires:  python-setuptools
69 %endif
70 %if %{with python3}
71 BuildRequires:  python3-cffi
72 BuildRequires:  python3-modules >= 1:3.4
73 BuildRequires:  python3-setuptools
74 %endif
75 %if %{with python2} || %{with python3}
76 BuildRequires:  rpm-pythonprov
77 %endif
78 %endif
79 Requires:       %{pname}-libs = %{version}-%{release}
80 Obsoletes:      spl < 0.7.9-2
81 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82
83 %define         dracutlibdir    %{_prefix}/lib/dracut
84
85 %description
86 ZFS is an advanced file system and volume manager which was originally
87 developed for Solaris and is now maintained by the Illumos community.
88
89 ZFS on Linux, which is also known as ZoL, is currently feature
90 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
91 ZPL layers.
92
93 %description -l pl.UTF-8
94 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
95 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
96
97 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
98 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
99 SPA, DMU, ZVOL i ZPL.
100
101 %package libs
102 Summary:        ZFS on Linux libraries
103 Summary(pl.UTF-8):      Biblioteki ZFS-a dla Linuksa
104 License:        CDDL
105 Group:          Libraries
106 Requires(post,postun):  /sbin/ldconfig
107
108 %description libs
109 ZFS on Linux libraries.
110
111 %description libs -l pl.UTF-8
112 Biblioteki ZFS-a dla Linuksa.
113
114 %package devel
115 Summary:        Header files for ZFS libraries
116 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek ZFS-a
117 License:        CDDL
118 Group:          Development/Libraries
119 Requires:       %{pname}-libs = %{version}-%{release}
120 Requires:       libselinux-devel
121 Requires:       libuuid-devel
122 Requires:       zlib-devel
123
124 %description devel
125 Header files for ZFS libraries.
126
127 %description devel -l pl.UTF-8
128 Pliki nagłówkowe bibliotek ZFS-a.
129
130 %package static
131 Summary:        Static ZFS libraries
132 Summary(pl.UTF-8):      Statyczne biblioteki ZFS-a
133 License:        CDDL
134 Group:          Development/Libraries
135 Requires:       %{pname}-devel = %{version}-%{release}
136
137 %description static
138 Static ZFS libraries.
139
140 %description static -l pl.UTF-8
141 Statyczne biblioteki ZFS-a.
142
143 %package -n dracut-zfs
144 Summary:        ZFS support for Dracut
145 Summary(pl.UTF-8):      Obsługa ZFS-a dla Dracuta
146 Group:          Applications/System
147 Requires:       %{pname} = %{version}-%{release}
148 Requires:       dracut
149
150 %description -n dracut-zfs
151 ZFS support for Dracut.
152
153 %description -n dracut-zfs -l pl.UTF-8
154 Obsługa ZFS-a dla Dracuta.
155
156 %package -n python-pyzfs
157 Summary:        Python 2 wrapper for libzfs_core C library
158 Summary(pl.UTF-8):      Interfejs Pythona 2 do biblioteki C libzfs_core
159 License:        Apache v2.0
160 Group:          Libraries/Python
161 Requires:       %{pname}-libs = %{version}-%{release}
162
163 %description -n python-pyzfs
164 Python 2 wrapper for libzfs_core C library.
165
166 %description -n python-pyzfs -l pl.UTF-8
167 Interfejs Pythona 2 do biblioteki C libzfs_core.
168
169 %package -n python3-pyzfs
170 Summary:        Python 3 wrapper for libzfs_core C library
171 Summary(pl.UTF-8):      Interfejs Pythona 3 do biblioteki C libzfs_core
172 License:        Apache v2.0
173 Group:          Libraries/Python
174 Requires:       %{pname}-libs = %{version}-%{release}
175
176 %description -n python3-pyzfs
177 Python 3 wrapper for libzfs_core C library.
178
179 %description -n python3-pyzfs -l pl.UTF-8
180 Interfejs Pythona 3 do biblioteki C libzfs_core.
181
182 %package -n kernel-zfs-common-devel
183 Summary:        ZFS Linux kernel headers
184 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa
185 Group:          Development/Building
186 Obsoletes:      kernel-spl-common-devel < 0.7.9-2
187
188 %description -n kernel-zfs-common-devel
189 ZFS Linux kernel headers common for all PLD kernel versions.
190
191 %description -n kernel-zfs-common-devel -l pl.UTF-8
192 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
193 wersji jąder PLD.
194
195 %define kernel_pkg()\
196 %package -n kernel%{_alt_kernel}-zfs\
197 Summary:        ZFS Linux kernel modules\
198 Summary(pl.UTF-8):      ZFS - moduły jądra Linuksa\
199 Release:        %{rel}@%{_kernel_ver_str}\
200 Group:          Base/Kernel\
201 Requires(post,postun):  /sbin/depmod\
202 %requires_releq_kernel\
203 Requires(postun):       %releq_kernel\
204 \
205 %description -n kernel%{_alt_kernel}-zfs\
206 ZFS Linux kernel modules.\
207 \
208 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
209 ZFS - moduły jądra Linuksa.\
210 \
211 %package -n kernel%{_alt_kernel}-zfs-devel\
212 Summary:        ZFS Linux kernel headers\
213 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa\
214 Release:        %{rel}@%{_kernel_ver_str}\
215 Group:          Development/Building\
216 Requires:       kernel%{_alt_kernel}-headers\
217 Requires:       kernel-zfs-common-devel\
218 Obsoletes:      kernel-spl-devel < 0.7.9-2\
219 \
220 %description -n kernel%{_alt_kernel}-zfs-devel\
221 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
222 version %{_kernel_ver}.\
223 \
224 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
225 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
226 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
227 \
228 %files -n kernel%{_alt_kernel}-zfs\
229 %defattr(644,root,root,755)\
230 %dir /lib/modules/%{_kernel_ver}/misc/lua\
231 /lib/modules/%{_kernel_ver}/misc/lua/zlua.ko*\
232 %dir /lib/modules/%{_kernel_ver}/misc/avl\
233 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
234 %dir /lib/modules/%{_kernel_ver}/misc/icp\
235 /lib/modules/%{_kernel_ver}/misc/icp/icp.ko*\
236 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
237 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
238 %dir /lib/modules/%{_kernel_ver}/misc/spl\
239 /lib/modules/%{_kernel_ver}/misc/spl/spl.ko*\
240 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
241 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
242 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
243 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
244 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
245 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
246 \
247 %files -n kernel%{_alt_kernel}-zfs-devel\
248 %defattr(644,root,root,755)\
249 /usr/src/zfs-%{version}/%{_kernel_ver}\
250 \
251 %post   -n kernel%{_alt_kernel}-zfs\
252 %depmod %{_kernel_ver}\
253 \
254 %postun -n kernel%{_alt_kernel}-zfs\
255 %depmod %{_kernel_ver}\
256 %{nil}
257
258 %define build_kernel_pkg()\
259 %configure \\\
260         --disable-silent-rules \\\
261         --with-config="kernel" \\\
262         --with-linux=%{_kernelsrcdir}\\\
263         --with-linux-obj=%{_kernelsrcdir}\
264 \
265 %{__make} clean\
266 %{__make} %{?with_verbose:V=1}\
267 p=`pwd`\
268 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
269 %{nil}
270
271 %{?with_kernel:%{expand:%create_kernel_packages}}
272
273 %prep
274 %setup -q -n %{pname}-zfs-%{version}
275 %patch0 -p1
276 %patch1 -p1
277
278 %build
279 %{__libtoolize}
280 %{__aclocal} -I config
281 %{__autoconf}
282 %{__autoheader}
283 %{__automake}
284 %{?with_kernel:%{expand:%build_kernel_packages}}
285
286 %if %{with userspace}
287 %configure \
288         --disable-silent-rules \
289         --with-config="user" \
290         --with-linux=%{_kernelsrcdir} \
291         --with-systemdunitdir=%{systemdunitdir} \
292         --with-systemdpresetdir=/etc/systemd/system-preset \
293         --with-systemdmodulesloaddir=/etc/modules-load.d \
294         --with-systemdgeneratordir=/lib/systemd/system-generators \
295         --with-udevdir=/lib/udev
296
297 %{__make} \
298         %{?with_verbose:V=1}
299
300 %if %{with python2}
301 cd contrib/pyzfs
302 %py_build
303 cd ../..
304 %endif
305
306 %if %{with python3}
307 cd contrib/pyzfs
308 %py3_build
309 cd ../..
310 %endif
311 %endif
312
313 %install
314 rm -rf $RPM_BUILD_ROOT
315
316 %if %{with kernel}
317 install -d $RPM_BUILD_ROOT
318 cp -a installed/* $RPM_BUILD_ROOT
319 # Drop unneeded spl compat links
320 %{__rm} -r $RPM_BUILD_ROOT/usr/src/spl-%{version}
321 %endif
322
323 %if %{with userspace}
324 %{__make} install \
325         DESTDIR=$RPM_BUILD_ROOT \
326         DEFAULT_INIT_DIR=/etc/rc.d/init.d
327
328 %if %{with python2}
329 %{__rm} -rf $RPM_BUILD_ROOT%{py_sitescriptdir}
330 cd contrib/pyzfs
331 %py_install
332
333 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
334 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
335
336 %py_postclean
337 cd ../..
338 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/libzfs_core/test
339 %endif
340
341 %if %{with python3}
342 %{__rm} -rf $RPM_BUILD_ROOT{%{py3_sitescriptdir},/usr/local/share/python3*}
343 cd contrib/pyzfs
344 %py3_install
345 cd ../..
346 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/libzfs_core/test
347 %endif
348
349 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
350 %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
351
352 # Debian specific stuff
353 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/initramfs-tools
354
355 # Package these? These are integration tests of the implementation.
356 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zfs/{zfs-tests,test-runner,runfiles}
357 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{raidz_test,test-runner}.1*
358 %{__rm} $RPM_BUILD_ROOT%{_bindir}/raidz_test
359 %endif
360
361 %clean
362 rm -rf $RPM_BUILD_ROOT
363
364 %post   libs -p /sbin/ldconfig
365 %postun libs -p /sbin/ldconfig
366
367 %if %{with userspace}
368 %files
369 %defattr(644,root,root,755)
370 %doc AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
371 %attr(755,root,root) /sbin/mount.zfs
372 %attr(755,root,root) %{_bindir}/arc_summary
373 %attr(755,root,root) %{_bindir}/arcstat
374 %attr(755,root,root) %{_bindir}/dbufstat
375 %attr(755,root,root) %{_bindir}/zgenhostid
376 %attr(755,root,root) %{_sbindir}/fsck.zfs
377 %attr(755,root,root) %{_sbindir}/zdb
378 %attr(755,root,root) %{_sbindir}/zed
379 %attr(755,root,root) %{_sbindir}/zfs
380 %attr(755,root,root) %{_sbindir}/zhack
381 %attr(755,root,root) %{_sbindir}/zinject
382 %attr(755,root,root) %{_sbindir}/zpool
383 %attr(755,root,root) %{_sbindir}/zstreamdump
384 %attr(755,root,root) %{_sbindir}/ztest
385 %dir %{_sysconfdir}/zfs
386 # package *.example as %doc? (they cannot act as default configuration)
387 %{_sysconfdir}/zfs/vdev_id.conf.*.example
388 %dir %{_sysconfdir}/zfs/zed.d
389 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
390 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
391 %dir %{_sysconfdir}/zfs/zpool.d
392 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zpool.d/*
393 %attr(754,root,root) /etc/rc.d/init.d/zfs-import
394 %attr(754,root,root) /etc/rc.d/init.d/zfs-mount
395 %attr(754,root,root) /etc/rc.d/init.d/zfs-share
396 %attr(754,root,root) /etc/rc.d/init.d/zfs-zed
397 %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
398 /etc/zfs/zfs-functions
399 %config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/zfs.conf
400 /etc/systemd/system-preset/50-zfs.preset
401 /lib/systemd/system-generators/zfs-mount-generator
402 %{systemdunitdir}/zfs.target
403 %{systemdunitdir}/zfs-import.target
404 %{systemdunitdir}/zfs-import-cache.service
405 %{systemdunitdir}/zfs-import-scan.service
406 %{systemdunitdir}/zfs-mount.service
407 %{systemdunitdir}/zfs-share.service
408 %{systemdunitdir}/zfs-zed.service
409 %attr(755,root,root) /lib/udev/vdev_id
410 %attr(755,root,root) /lib/udev/zvol_id
411 /lib/udev/rules.d/60-zvol.rules
412 /lib/udev/rules.d/69-vdev.rules
413 /lib/udev/rules.d/90-zfs.rules
414 %dir %{_libexecdir}/zfs
415 %dir %{_libexecdir}/zfs/zed.d
416 %attr(755,root,root) %{_libexecdir}/zfs/zed.d/*.sh
417 %dir %{_libexecdir}/zfs/zpool.d
418 %attr(755,root,root) %{_libexecdir}/zfs/zpool.d/*
419 %dir %{_datadir}/zfs
420 %attr(755,root,root) %{_datadir}/zfs/*.sh
421 %{_mandir}/man1/zhack.1*
422 %{_mandir}/man1/ztest.1*
423 %{_mandir}/man5/spl-module-parameters.5*
424 %{_mandir}/man5/vdev_id.conf.5*
425 %{_mandir}/man5/zfs-events.5*
426 %{_mandir}/man5/zfs-module-parameters.5*
427 %{_mandir}/man5/zpool-features.5*
428 %{_mandir}/man8/fsck.zfs.8*
429 %{_mandir}/man8/mount.zfs.8*
430 %{_mandir}/man8/vdev_id.8*
431 %{_mandir}/man8/zdb.8*
432 %{_mandir}/man8/zed.8*
433 %{_mandir}/man8/zfs.8*
434 %{_mandir}/man8/zfs-mount-generator.8*
435 %{_mandir}/man8/zfs-program.8*
436 %{_mandir}/man8/zgenhostid.8*
437 %{_mandir}/man8/zinject.8*
438 %{_mandir}/man8/zpool.8*
439 %{_mandir}/man8/zstreamdump.8*
440
441 %files libs
442 %defattr(644,root,root,755)
443 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
444 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
445 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
446 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
447 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
448 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
449 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
450 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
451 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
452 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
453
454 %files devel
455 %defattr(644,root,root,755)
456 %attr(755,root,root) %{_libdir}/libnvpair.so
457 %attr(755,root,root) %{_libdir}/libuutil.so
458 %attr(755,root,root) %{_libdir}/libzfs.so
459 %attr(755,root,root) %{_libdir}/libzfs_core.so
460 %attr(755,root,root) %{_libdir}/libzpool.so
461 %{_libdir}/libnvpair.la
462 %{_libdir}/libuutil.la
463 %{_libdir}/libzfs.la
464 %{_libdir}/libzfs_core.la
465 %{_libdir}/libzpool.la
466 %{_includedir}/libspl
467 %{_includedir}/libzfs
468 %{_pkgconfigdir}/libzfs.pc
469 %{_pkgconfigdir}/libzfs_core.pc
470
471 %files static
472 %defattr(644,root,root,755)
473 %{_libdir}/libnvpair.a
474 %{_libdir}/libuutil.a
475 %{_libdir}/libzfs.a
476 %{_libdir}/libzfs_core.a
477 %{_libdir}/libzpool.a
478
479 %files -n dracut-zfs
480 %defattr(644,root,root,755)
481 %doc contrib/dracut/README.dracut.markdown
482 %dir %{dracutlibdir}/modules.d/02zfsexpandknowledge
483 %attr(755,root,root) %{dracutlibdir}/modules.d/02zfsexpandknowledge/module-setup.sh
484 %dir %{dracutlibdir}/modules.d/90zfs
485 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
486 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
487 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
488 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
489 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-env-bootfs.service
490 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-generator.sh
491 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
492 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-load-key.sh
493 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-needshutdown.sh
494
495 %if %{with python2}
496 %files -n python-pyzfs
497 %defattr(644,root,root,755)
498 %doc contrib/pyzfs/README
499 %{py_sitescriptdir}/libzfs_core
500 %{py_sitescriptdir}/pyzfs-*-py*.egg-info
501 %endif
502
503 %if %{with python3}
504 %files -n python3-pyzfs
505 %defattr(644,root,root,755)
506 %doc contrib/pyzfs/README
507 %{py3_sitescriptdir}/libzfs_core
508 %{py3_sitescriptdir}/pyzfs-*-py*.egg-info
509 %endif
510 %endif
511
512 %if %{with kernel}
513 %files -n kernel-zfs-common-devel
514 %defattr(644,root,root,755)
515 %dir /usr/src/zfs-%{version}
516 /usr/src/zfs-%{version}/include
517 /usr/src/zfs-%{version}/zfs.release
518 /usr/src/zfs-%{version}/zfs_config.h
519 %endif
This page took 0.133093 seconds and 4 git commands to generate.