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