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
9 %bcond_without kernel # don't build kernel modules
10 %bcond_without userspace # don't build userspace programs
11 %bcond_with verbose # verbose build (V=1)
13 # The goal here is to have main, userspace, package built once with
14 # simple release number, and only rebuild kernel packages with kernel
15 # version as part of release number, without the need to bump release
16 # with every kernel change.
17 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
18 %{error:kernel and userspace cannot be built at the same time on PLD builders}
22 %if %{without userspace}
23 # nothing to be placed to debuginfo package
24 %define _enable_debug_packages 0
27 %define _duplicate_files_terminate_build 0
31 Summary: Native Linux port of the ZFS filesystem
32 Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS
33 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
35 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
36 License: CDDL (ZFS), GPL v2+ (ZPIOS)
37 Group: Applications/System
38 Source0: https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz
39 # Source0-md5: 51c5dbef614120029491534375a5dd43
40 Patch0: %{pname}-link.patch
42 Patch2: xattr-in-glibc.patch
43 Patch3: randstruct.patch
44 URL: http://zfsonlinux.org/
45 BuildRequires: autoconf >= 2.50
46 BuildRequires: automake
47 BuildRequires: libtool
48 BuildRequires: rpmbuild(macros) >= 1.701
50 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
51 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
54 BuildRequires: libblkid-devel
55 BuildRequires: libselinux-devel
56 BuildRequires: libuuid-devel
57 BuildRequires: zlib-devel
59 Requires: %{pname}-libs = %{version}-%{release}
60 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 %define dracutlibdir %{_prefix}/lib/dracut
65 ZFS is an advanced file system and volume manager which was originally
66 developed for Solaris and is now maintained by the Illumos community.
68 ZFS on Linux, which is also known as ZoL, is currently feature
69 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
72 %description -l pl.UTF-8
73 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
74 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
76 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
77 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
81 Summary: ZFS on Linux libraries
82 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
85 Requires(post,postun): /sbin/ldconfig
88 ZFS on Linux libraries.
90 %description libs -l pl.UTF-8
91 Biblioteki ZFS-a dla Linuksa.
94 Summary: Header files for ZFS libraries
95 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
97 Group: Development/Libraries
98 Requires: %{pname}-libs = %{version}-%{release}
99 Requires: libselinux-devel
100 Requires: libuuid-devel
104 Header files for ZFS libraries.
106 %description devel -l pl.UTF-8
107 Pliki nagłówkowe bibliotek ZFS-a.
110 Summary: Static ZFS libraries
111 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
113 Group: Development/Libraries
114 Requires: %{pname}-devel = %{version}-%{release}
117 Static ZFS libraries.
119 %description static -l pl.UTF-8
120 Statyczne biblioteki ZFS-a.
122 %package -n dracut-zfs
123 Summary: ZFS support for Dracut
124 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
125 Group: Applications/System
126 Requires: %{pname} = %{version}-%{release}
129 %description -n dracut-zfs
130 ZFS support for Dracut.
132 %description -n dracut-zfs -l pl.UTF-8
133 Obsługa ZFS-a dla Dracuta.
135 %package -n kernel-zfs-common-devel
136 Summary: ZFS Linux kernel headers
137 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
138 Group: Development/Building
140 %description -n kernel-zfs-common-devel
141 ZFS Linux kernel headers common for all PLD kernel versions.
143 %description -n kernel-zfs-common-devel -l pl.UTF-8
144 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
147 %define kernel_pkg()\
148 %package -n kernel%{_alt_kernel}-zfs\
149 Summary: ZFS Linux kernel modules\
150 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
151 Release: %{rel}@%{_kernel_ver_str}\
153 Requires(post,postun): /sbin/depmod\
154 %requires_releq_kernel\
155 Requires(postun): %releq_kernel\
157 %description -n kernel%{_alt_kernel}-zfs\
158 ZFS Linux kernel modules.\
160 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
161 ZFS - moduły jądra Linuksa.\
163 %package -n kernel%{_alt_kernel}-zfs-devel\
164 Summary: ZFS Linux kernel headers\
165 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
166 Release: %{rel}@%{_kernel_ver_str}\
167 Group: Development/Building\
168 Requires: kernel%{_alt_kernel}-headers\
169 Requires: kernel-zfs-common-devel\
171 %description -n kernel%{_alt_kernel}-zfs-devel\
172 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
173 version %{_kernel_ver}.\
175 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
176 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
177 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
179 %files -n kernel%{_alt_kernel}-zfs\
180 %defattr(644,root,root,755)\
181 %dir /lib/modules/%{_kernel_ver}/misc/avl\
182 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
183 %dir /lib/modules/%{_kernel_ver}/misc/icp\
184 /lib/modules/%{_kernel_ver}/misc/icp/icp.ko*\
185 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
186 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
187 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
188 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
189 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
190 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
191 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
192 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
193 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
194 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
196 %files -n kernel%{_alt_kernel}-zfs-devel\
197 %defattr(644,root,root,755)\
198 /usr/src/zfs-%{version}/%{_kernel_ver}\
200 %post -n kernel%{_alt_kernel}-zfs\
201 %depmod %{_kernel_ver}\
203 %postun -n kernel%{_alt_kernel}-zfs\
204 %depmod %{_kernel_ver}\
207 %define build_kernel_pkg()\
209 --disable-silent-rules \\\
210 --with-config="kernel" \\\
211 --with-linux=%{_kernelsrcdir}\\\
212 --with-linux-obj=%{_kernelsrcdir}\
215 %{__make} %{?with_verbose:V=1}\
217 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
220 %{?with_kernel:%{expand:%create_kernel_packages}}
223 %setup -q -n %{pname}-%{version}
231 %{__aclocal} -I config
235 %{?with_kernel:%{expand:%build_kernel_packages}}
237 %if %{with userspace}
239 --disable-silent-rules \
240 --with-config="user" \
241 --with-linux=%{_kernelsrcdir} \
242 --with-systemdunitdir=%{systemdunitdir} \
243 --with-systemdpresetdir=/etc/systemd/system-preset \
244 --with-udevdir=/lib/udev
251 rm -rf $RPM_BUILD_ROOT
254 install -d $RPM_BUILD_ROOT
255 cp -a installed/* $RPM_BUILD_ROOT
258 %if %{with userspace}
260 DESTDIR=$RPM_BUILD_ROOT \
261 DEFAULT_INIT_DIR=/etc/rc.d/init.d
263 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
264 %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
266 # Package these? These are integration tests of the implementation.
267 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zfs/{zfs-tests,test-runner,runfiles}
268 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{raidz_test,test-runner}.1*
269 %{__rm} $RPM_BUILD_ROOT%{_bindir}/raidz_test
273 rm -rf $RPM_BUILD_ROOT
275 %post libs -p /sbin/ldconfig
276 %postun libs -p /sbin/ldconfig
278 %if %{with userspace}
280 %defattr(644,root,root,755)
281 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
282 %attr(755,root,root) /sbin/mount.zfs
283 %attr(755,root,root) %{_bindir}/arc_summary.py
284 %attr(755,root,root) %{_bindir}/arcstat.py
285 %attr(755,root,root) %{_bindir}/dbufstat.py
286 %attr(755,root,root) %{_bindir}/zgenhostid
287 %attr(755,root,root) %{_sbindir}/fsck.zfs
288 %attr(755,root,root) %{_sbindir}/zdb
289 %attr(755,root,root) %{_sbindir}/zed
290 %attr(755,root,root) %{_sbindir}/zfs
291 %attr(755,root,root) %{_sbindir}/zhack
292 %attr(755,root,root) %{_sbindir}/zinject
293 %attr(755,root,root) %{_sbindir}/zpios
294 %attr(755,root,root) %{_sbindir}/zpool
295 %attr(755,root,root) %{_sbindir}/zstreamdump
296 %attr(755,root,root) %{_sbindir}/ztest
297 %dir %{_sysconfdir}/zfs
298 # package *.example as %doc? (they cannot act as default configuration)
299 %{_sysconfdir}/zfs/vdev_id.conf.*.example
300 %dir %{_sysconfdir}/zfs/zed.d
301 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
302 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
303 %dir %{_sysconfdir}/zfs/zpool.d
304 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zpool.d/*
305 %attr(754,root,root) /etc/rc.d/init.d/zfs-import
306 %attr(754,root,root) /etc/rc.d/init.d/zfs-mount
307 %attr(754,root,root) /etc/rc.d/init.d/zfs-share
308 %attr(754,root,root) /etc/rc.d/init.d/zfs-zed
309 %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
310 /etc/zfs/zfs-functions
311 /usr/lib/modules-load.d/zfs.conf
312 /etc/systemd/system-preset/50-zfs.preset
313 %{systemdunitdir}/zfs.target
314 %{systemdunitdir}/zfs-import.target
315 %{systemdunitdir}/zfs-import-cache.service
316 %{systemdunitdir}/zfs-import-scan.service
317 %{systemdunitdir}/zfs-mount.service
318 %{systemdunitdir}/zfs-share.service
319 %{systemdunitdir}/zfs-zed.service
320 %attr(755,root,root) /lib/udev/vdev_id
321 %attr(755,root,root) /lib/udev/zvol_id
322 /lib/udev/rules.d/60-zvol.rules
323 /lib/udev/rules.d/69-vdev.rules
324 /lib/udev/rules.d/90-zfs.rules
325 %dir %{_libexecdir}/zfs
326 %dir %{_libexecdir}/zfs/zed.d
327 %attr(755,root,root) %{_libexecdir}/zfs/zed.d/*.sh
328 %dir %{_libexecdir}/zfs/zpool.d
329 %attr(755,root,root) %{_libexecdir}/zfs/zpool.d/*
331 %attr(755,root,root) %{_datadir}/zfs/*.sh
332 %dir %{_datadir}/zfs/zpios-profile
333 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
334 %dir %{_datadir}/zfs/zpios-test
335 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
336 %dir %{_datadir}/zfs/zpool-config
337 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
338 %{_mandir}/man1/zhack.1*
339 %{_mandir}/man1/zpios.1*
340 %{_mandir}/man1/ztest.1*
341 %{_mandir}/man5/vdev_id.conf.5*
342 %{_mandir}/man5/zfs-events.5*
343 %{_mandir}/man5/zfs-module-parameters.5*
344 %{_mandir}/man5/zpool-features.5*
345 %{_mandir}/man8/fsck.zfs.8*
346 %{_mandir}/man8/mount.zfs.8*
347 %{_mandir}/man8/vdev_id.8*
348 %{_mandir}/man8/zdb.8*
349 %{_mandir}/man8/zed.8*
350 %{_mandir}/man8/zfs.8*
351 %{_mandir}/man8/zgenhostid.8*
352 %{_mandir}/man8/zinject.8*
353 %{_mandir}/man8/zpool.8*
354 %{_mandir}/man8/zstreamdump.8*
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
359 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
360 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
361 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
362 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
363 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
364 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
365 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
366 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
367 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
370 %defattr(644,root,root,755)
371 %attr(755,root,root) %{_libdir}/libnvpair.so
372 %attr(755,root,root) %{_libdir}/libuutil.so
373 %attr(755,root,root) %{_libdir}/libzfs.so
374 %attr(755,root,root) %{_libdir}/libzfs_core.so
375 %attr(755,root,root) %{_libdir}/libzpool.so
376 %{_libdir}/libnvpair.la
377 %{_libdir}/libuutil.la
379 %{_libdir}/libzfs_core.la
380 %{_libdir}/libzpool.la
381 %{_includedir}/libspl
382 %{_includedir}/libzfs
383 %{_pkgconfigdir}/libzfs.pc
384 %{_pkgconfigdir}/libzfs_core.pc
387 %defattr(644,root,root,755)
388 %{_libdir}/libnvpair.a
389 %{_libdir}/libuutil.a
391 %{_libdir}/libzfs_core.a
392 %{_libdir}/libzpool.a
395 %defattr(644,root,root,755)
396 %doc contrib/dracut/README.dracut.markdown
397 %dir %{dracutlibdir}/modules.d/02zfsexpandknowledge
398 %attr(755,root,root) %{dracutlibdir}/modules.d/02zfsexpandknowledge/module-setup.sh
399 %dir %{dracutlibdir}/modules.d/90zfs
400 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
401 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
402 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
403 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
404 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-generator.sh
405 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
406 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-needshutdown.sh
410 %files -n kernel-zfs-common-devel
411 %defattr(644,root,root,755)
412 %dir /usr/src/zfs-%{version}
413 /usr/src/zfs-%{version}/include
414 /usr/src/zfs-%{version}/zfs.release.in
415 /usr/src/zfs-%{version}/zfs_config.h.in