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: ffc51dcf5260d3c7e747fe78f8ae307c
40 Patch0: %{pname}-link.patch
42 Patch2: setattr_prepare.patch
43 URL: http://zfsonlinux.org/
44 BuildRequires: autoconf >= 2.50
45 BuildRequires: automake
46 BuildRequires: libtool
47 BuildRequires: rpmbuild(macros) >= 1.701
49 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
50 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
53 BuildRequires: libblkid-devel
54 BuildRequires: libselinux-devel
55 BuildRequires: libuuid-devel
56 BuildRequires: zlib-devel
58 Requires: %{pname}-libs = %{version}-%{release}
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 %define dracutlibdir %{_prefix}/lib/dracut
64 ZFS is an advanced file system and volume manager which was originally
65 developed for Solaris and is now maintained by the Illumos community.
67 ZFS on Linux, which is also known as ZoL, is currently feature
68 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
71 %description -l pl.UTF-8
72 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
73 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
75 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
76 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
80 Summary: ZFS on Linux libraries
81 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
84 Requires(post,postun): /sbin/ldconfig
87 ZFS on Linux libraries.
89 %description libs -l pl.UTF-8
90 Biblioteki ZFS-a dla Linuksa.
93 Summary: Header files for ZFS libraries
94 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
96 Group: Development/Libraries
97 Requires: %{pname}-libs = %{version}-%{release}
98 Requires: libselinux-devel
99 Requires: libuuid-devel
103 Header files for ZFS libraries.
105 %description devel -l pl.UTF-8
106 Pliki nagłówkowe bibliotek ZFS-a.
109 Summary: Static ZFS libraries
110 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
112 Group: Development/Libraries
113 Requires: %{pname}-devel = %{version}-%{release}
116 Static ZFS libraries.
118 %description static -l pl.UTF-8
119 Statyczne biblioteki ZFS-a.
121 %package -n dracut-zfs
122 Summary: ZFS support for Dracut
123 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
124 Group: Applications/System
125 Requires: %{pname} = %{version}-%{release}
128 %description -n dracut-zfs
129 ZFS support for Dracut.
131 %description -n dracut-zfs -l pl.UTF-8
132 Obsługa ZFS-a dla Dracuta.
134 %package -n kernel-zfs-common-devel
135 Summary: ZFS Linux kernel headers
136 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
137 Group: Development/Building
139 %description -n kernel-zfs-common-devel
140 ZFS Linux kernel headers common for all PLD kernel versions.
142 %description -n kernel-zfs-common-devel -l pl.UTF-8
143 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
146 %define kernel_pkg()\
147 %package -n kernel%{_alt_kernel}-zfs\
148 Summary: ZFS Linux kernel modules\
149 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
150 Release: %{rel}@%{_kernel_ver_str}\
152 Requires(post,postun): /sbin/depmod\
153 %requires_releq_kernel\
154 Requires(postun): %releq_kernel\
156 %description -n kernel%{_alt_kernel}-zfs\
157 ZFS Linux kernel modules.\
159 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
160 ZFS - moduły jądra Linuksa.\
162 %package -n kernel%{_alt_kernel}-zfs-devel\
163 Summary: ZFS Linux kernel headers\
164 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
165 Release: %{rel}@%{_kernel_ver_str}\
166 Group: Development/Building\
167 Requires: kernel%{_alt_kernel}-headers\
168 Requires: kernel-zfs-common-devel\
170 %description -n kernel%{_alt_kernel}-zfs-devel\
171 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
172 version %{_kernel_ver}.\
174 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
175 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
176 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
178 %files -n kernel%{_alt_kernel}-zfs\
179 %defattr(644,root,root,755)\
180 %dir /lib/modules/%{_kernel_ver}/misc/avl\
181 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
182 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
183 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
184 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
185 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
186 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
187 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
188 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
189 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
190 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
191 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
193 %files -n kernel%{_alt_kernel}-zfs-devel\
194 %defattr(644,root,root,755)\
195 /usr/src/zfs-%{version}/%{_kernel_ver}\
197 %post -n kernel%{_alt_kernel}-zfs\
198 %depmod %{_kernel_ver}\
200 %postun -n kernel%{_alt_kernel}-zfs\
201 %depmod %{_kernel_ver}\
204 %define build_kernel_pkg()\
206 --disable-silent-rules \\\
207 --with-config="kernel" \\\
208 --with-linux=%{_kernelsrcdir}\\\
209 --with-linux-obj=%{_kernelsrcdir}\
212 %{__make} %{?with_verbose:V=1}\
214 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
217 %{?with_kernel:%{expand:%create_kernel_packages}}
220 %setup -q -n %{pname}-%{version}
226 %{__aclocal} -I config
230 %{?with_kernel:%{expand:%build_kernel_packages}}
232 %if %{with userspace}
234 --disable-silent-rules \
235 --with-config="user" \
236 --with-linux=%{_kernelsrcdir} \
237 --with-systemdunitdir=%{systemdunitdir} \
238 --with-systemdpresetdir=/etc/systemd/system-preset \
239 --with-udevdir=/lib/udev
246 rm -rf $RPM_BUILD_ROOT
249 install -d $RPM_BUILD_ROOT
250 cp -a installed/* $RPM_BUILD_ROOT
253 %if %{with userspace}
255 DESTDIR=$RPM_BUILD_ROOT \
256 DEFAULT_INIT_DIR=/etc/rc.d/init.d
258 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
259 %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
263 rm -rf $RPM_BUILD_ROOT
265 %post libs -p /sbin/ldconfig
266 %postun libs -p /sbin/ldconfig
268 %if %{with userspace}
270 %defattr(644,root,root,755)
271 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
272 %attr(755,root,root) /sbin/mount.zfs
273 %attr(755,root,root) %{_bindir}/arc_summary.py
274 %attr(755,root,root) %{_bindir}/arcstat.py
275 %attr(755,root,root) %{_bindir}/dbufstat.py
276 %attr(755,root,root) %{_sbindir}/fsck.zfs
277 %attr(755,root,root) %{_sbindir}/zdb
278 %attr(755,root,root) %{_sbindir}/zed
279 %attr(755,root,root) %{_sbindir}/zfs
280 %attr(755,root,root) %{_sbindir}/zhack
281 %attr(755,root,root) %{_sbindir}/zinject
282 %attr(755,root,root) %{_sbindir}/zpios
283 %attr(755,root,root) %{_sbindir}/zpool
284 %attr(755,root,root) %{_sbindir}/zstreamdump
285 %attr(755,root,root) %{_sbindir}/ztest
286 %dir %{_sysconfdir}/zfs
287 # package *.example as %doc? (they cannot act as default configuration)
288 %{_sysconfdir}/zfs/vdev_id.conf.*.example
289 %dir %{_sysconfdir}/zfs/zed.d
290 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
291 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
292 %attr(754,root,root) /etc/rc.d/init.d/zfs-import
293 %attr(754,root,root) /etc/rc.d/init.d/zfs-mount
294 %attr(754,root,root) /etc/rc.d/init.d/zfs-share
295 %attr(754,root,root) /etc/rc.d/init.d/zfs-zed
296 %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
297 /etc/zfs/zfs-functions
298 /usr/lib/modules-load.d/zfs.conf
299 /etc/systemd/system-preset/50-zfs.preset
300 %{systemdunitdir}/zfs.target
301 %{systemdunitdir}/zfs-import-cache.service
302 %{systemdunitdir}/zfs-import-scan.service
303 %{systemdunitdir}/zfs-mount.service
304 %{systemdunitdir}/zfs-share.service
305 %{systemdunitdir}/zfs-zed.service
306 %attr(755,root,root) /lib/udev/vdev_id
307 %attr(755,root,root) /lib/udev/zvol_id
308 /lib/udev/rules.d/60-zvol.rules
309 /lib/udev/rules.d/69-vdev.rules
310 /lib/udev/rules.d/90-zfs.rules
312 %dir %{_libdir}/zfs/zed.d
313 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
315 %attr(755,root,root) %{_datadir}/zfs/*.sh
316 %dir %{_datadir}/zfs/zpios-profile
317 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
318 %dir %{_datadir}/zfs/zpios-test
319 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
320 %dir %{_datadir}/zfs/zpool-config
321 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
322 %{_mandir}/man1/zhack.1*
323 %{_mandir}/man1/zpios.1*
324 %{_mandir}/man1/ztest.1*
325 %{_mandir}/man5/vdev_id.conf.5*
326 %{_mandir}/man5/zfs-events.5*
327 %{_mandir}/man5/zfs-module-parameters.5*
328 %{_mandir}/man5/zpool-features.5*
329 %{_mandir}/man8/fsck.zfs.8*
330 %{_mandir}/man8/mount.zfs.8*
331 %{_mandir}/man8/vdev_id.8*
332 %{_mandir}/man8/zdb.8*
333 %{_mandir}/man8/zed.8*
334 %{_mandir}/man8/zfs.8*
335 %{_mandir}/man8/zinject.8*
336 %{_mandir}/man8/zpool.8*
337 %{_mandir}/man8/zstreamdump.8*
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
342 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
343 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
344 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
345 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
346 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
347 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
348 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
349 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
350 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_libdir}/libnvpair.so
355 %attr(755,root,root) %{_libdir}/libuutil.so
356 %attr(755,root,root) %{_libdir}/libzfs.so
357 %attr(755,root,root) %{_libdir}/libzfs_core.so
358 %attr(755,root,root) %{_libdir}/libzpool.so
359 %{_libdir}/libnvpair.la
360 %{_libdir}/libuutil.la
362 %{_libdir}/libzfs_core.la
363 %{_libdir}/libzpool.la
364 %{_includedir}/libspl
365 %{_includedir}/libzfs
366 %{_pkgconfigdir}/libzfs.pc
367 %{_pkgconfigdir}/libzfs_core.pc
370 %defattr(644,root,root,755)
371 %{_libdir}/libnvpair.a
372 %{_libdir}/libuutil.a
374 %{_libdir}/libzfs_core.a
375 %{_libdir}/libzpool.a
378 %defattr(644,root,root,755)
379 %doc contrib/dracut/README.dracut.markdown
380 %dir %{dracutlibdir}/modules.d/90zfs
381 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
382 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
383 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
384 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
385 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
389 %files -n kernel-zfs-common-devel
390 %defattr(644,root,root,755)
391 %dir /usr/src/zfs-%{version}
392 /usr/src/zfs-%{version}/include
393 /usr/src/zfs-%{version}/zfs.release.in
394 /usr/src/zfs-%{version}/zfs_config.h.in