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