1 # TODO: PLDify init script
4 %bcond_without kernel # don't build kernel modules
5 %bcond_without userspace # don't build userspace programs
6 %bcond_with verbose # verbose build (V=1)
8 # The goal here is to have main, userspace, package built once with
9 # simple release number, and only rebuild kernel packages with kernel
10 # version as part of release number, without the need to bump release
11 # with every kernel change.
12 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
13 %{error:kernel and userspace cannot be built at the same time on PLD builders}
17 %if %{without userspace}
18 # nothing to be placed to debuginfo package
19 %define _enable_debug_packages 0
22 %define _duplicate_files_terminate_build 0
26 Summary: Native Linux port of the ZFS filesystem
27 Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS
28 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
30 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
31 License: CDDL (ZFS), GPL v2+ (ZPIOS)
32 Group: Applications/System
33 Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz
34 # Source0-md5: 0421551f728c1fd4239bdd9932ba2c52
35 Patch0: %{pname}-link.patch
37 URL: http://zfsonlinux.org/
38 BuildRequires: autoconf >= 2.50
39 BuildRequires: automake
40 BuildRequires: libtool
41 BuildRequires: rpmbuild(macros) >= 1.701
43 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
44 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
47 BuildRequires: libblkid-devel
48 BuildRequires: libselinux-devel
49 BuildRequires: libuuid-devel
50 BuildRequires: zlib-devel
52 Requires: %{pname}-libs = %{version}-%{release}
53 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55 %define dracutlibdir %{_prefix}/lib/dracut
58 ZFS is an advanced file system and volume manager which was originally
59 developed for Solaris and is now maintained by the Illumos community.
61 ZFS on Linux, which is also known as ZoL, is currently feature
62 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
65 %description -l pl.UTF-8
66 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
67 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
69 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
70 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
74 Summary: ZFS on Linux libraries
75 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
78 Requires(post,postun): /sbin/ldconfig
81 ZFS on Linux libraries.
83 %description libs -l pl.UTF-8
84 Biblioteki ZFS-a dla Linuksa.
87 Summary: Header files for ZFS libraries
88 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
90 Group: Development/Libraries
91 Requires: %{pname}-libs = %{version}-%{release}
92 Requires: libselinux-devel
93 Requires: libuuid-devel
97 Header files for ZFS libraries.
99 %description devel -l pl.UTF-8
100 Pliki nagłówkowe bibliotek ZFS-a.
103 Summary: Static ZFS libraries
104 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
106 Group: Development/Libraries
107 Requires: %{pname}-devel = %{version}-%{release}
110 Static ZFS libraries.
112 %description static -l pl.UTF-8
113 Statyczne biblioteki ZFS-a.
115 %package -n dracut-zfs
116 Summary: ZFS support for Dracut
117 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
118 Group: Applications/System
119 Requires: %{pname} = %{version}-%{release}
122 %description -n dracut-zfs
123 ZFS support for Dracut.
125 %description -n dracut-zfs -l pl.UTF-8
126 Obsługa ZFS-a dla Dracuta.
128 %package -n kernel-zfs-common-devel
129 Summary: ZFS Linux kernel headers
130 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
131 Group: Development/Building
133 %description -n kernel-zfs-common-devel
134 ZFS Linux kernel headers common for all PLD kernel versions.
136 %description -n kernel-zfs-common-devel -l pl.UTF-8
137 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
140 %define kernel_pkg()\
141 %package -n kernel%{_alt_kernel}-zfs\
142 Summary: ZFS Linux kernel modules\
143 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
144 Release: %{rel}@%{_kernel_ver_str}\
146 Requires(post,postun): /sbin/depmod\
147 %requires_releq_kernel\
148 Requires(postun): %releq_kernel\
150 %description -n kernel%{_alt_kernel}-zfs\
151 ZFS Linux kernel modules.\
153 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
154 ZFS - moduły jądra Linuksa.\
156 %package -n kernel%{_alt_kernel}-zfs-devel\
157 Summary: ZFS Linux kernel headers\
158 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
159 Release: %{rel}@%{_kernel_ver_str}\
160 Group: Development/Building\
161 Requires: kernel%{_alt_kernel}-headers\
162 Requires: kernel-zfs-common-devel\
164 %description -n kernel%{_alt_kernel}-zfs-devel\
165 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
166 version %{_kernel_ver}.\
168 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
169 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
170 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
172 %files -n kernel%{_alt_kernel}-zfs\
173 %defattr(644,root,root,755)\
174 %dir /lib/modules/%{_kernel_ver}/misc/avl\
175 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
176 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
177 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
178 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
179 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
180 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
181 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
182 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
183 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
184 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
185 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
187 %files -n kernel%{_alt_kernel}-zfs-devel\
188 %defattr(644,root,root,755)\
189 /usr/src/zfs-%{version}/%{_kernel_ver}\
191 %post -n kernel%{_alt_kernel}-zfs\
192 %depmod %{_kernel_ver}\
194 %postun -n kernel%{_alt_kernel}-zfs\
195 %depmod %{_kernel_ver}\
198 %define build_kernel_pkg()\
200 --disable-silent-rules \\\
201 --with-config="kernel" \\\
202 --with-linux=%{_kernelsrcdir}\
205 %{__make} %{?with_verbose:V=1}\
207 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
210 %{?with_kernel:%{expand:%create_kernel_packages}}
213 %setup -q -n %{pname}-%{version}
219 %{__aclocal} -I config
223 %{?with_kernel:%{expand:%build_kernel_packages}}
225 %if %{with userspace}
227 --disable-silent-rules \
228 --with-config="user" \
229 --with-linux=%{_kernelsrcdir} \
230 --with-systemdunitdir=%{systemdunitdir} \
231 --with-systemdpresetdir=/etc/systemd/system-preset \
232 --with-udevdir=/lib/udev
239 rm -rf $RPM_BUILD_ROOT
242 install -d $RPM_BUILD_ROOT
243 cp -a installed/* $RPM_BUILD_ROOT
246 %if %{with userspace}
248 DESTDIR=$RPM_BUILD_ROOT \
249 DEFAULT_INIT_DIR=/etc/rc.d/init.d
251 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
252 %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
256 rm -rf $RPM_BUILD_ROOT
258 %post libs -p /sbin/ldconfig
259 %postun libs -p /sbin/ldconfig
261 %if %{with userspace}
263 %defattr(644,root,root,755)
264 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
265 %attr(755,root,root) /sbin/mount.zfs
266 %attr(755,root,root) %{_bindir}/arc_summary.py
267 %attr(755,root,root) %{_bindir}/arcstat.py
268 %attr(755,root,root) %{_bindir}/dbufstat.py
269 %attr(755,root,root) %{_sbindir}/fsck.zfs
270 %attr(755,root,root) %{_sbindir}/zdb
271 %attr(755,root,root) %{_sbindir}/zed
272 %attr(755,root,root) %{_sbindir}/zfs
273 %attr(755,root,root) %{_sbindir}/zhack
274 %attr(755,root,root) %{_sbindir}/zinject
275 %attr(755,root,root) %{_sbindir}/zpios
276 %attr(755,root,root) %{_sbindir}/zpool
277 %attr(755,root,root) %{_sbindir}/zstreamdump
278 %attr(755,root,root) %{_sbindir}/ztest
279 %dir %{_sysconfdir}/zfs
280 # package *.example as %doc? (they cannot act as default configuration)
281 %{_sysconfdir}/zfs/vdev_id.conf.*.example
282 %dir %{_sysconfdir}/zfs/zed.d
283 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
284 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
285 %attr(754,root,root) /etc/rc.d/init.d/zfs-import
286 %attr(754,root,root) /etc/rc.d/init.d/zfs-mount
287 %attr(754,root,root) /etc/rc.d/init.d/zfs-share
288 %attr(754,root,root) /etc/rc.d/init.d/zfs-zed
289 %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
290 /etc/zfs/zfs-functions
291 /usr/lib/modules-load.d/zfs.conf
292 /etc/systemd/system-preset/50-zfs.preset
293 %{systemdunitdir}/zed.service
294 %{systemdunitdir}/zfs.target
295 %{systemdunitdir}/zfs-import-cache.service
296 %{systemdunitdir}/zfs-import-scan.service
297 %{systemdunitdir}/zfs-mount.service
298 %{systemdunitdir}/zfs-share.service
299 %attr(755,root,root) /lib/udev/vdev_id
300 %attr(755,root,root) /lib/udev/zvol_id
301 /lib/udev/rules.d/60-zvol.rules
302 /lib/udev/rules.d/69-vdev.rules
303 /lib/udev/rules.d/90-zfs.rules
305 %dir %{_libdir}/zfs/zed.d
306 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
308 %attr(755,root,root) %{_datadir}/zfs/*.sh
309 %dir %{_datadir}/zfs/zpios-profile
310 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
311 %dir %{_datadir}/zfs/zpios-test
312 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
313 %dir %{_datadir}/zfs/zpool-config
314 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
315 %{_mandir}/man1/zhack.1*
316 %{_mandir}/man1/zpios.1*
317 %{_mandir}/man1/ztest.1*
318 %{_mandir}/man5/vdev_id.conf.5*
319 %{_mandir}/man5/zfs-events.5*
320 %{_mandir}/man5/zfs-module-parameters.5*
321 %{_mandir}/man5/zpool-features.5*
322 %{_mandir}/man8/fsck.zfs.8*
323 %{_mandir}/man8/mount.zfs.8*
324 %{_mandir}/man8/vdev_id.8*
325 %{_mandir}/man8/zdb.8*
326 %{_mandir}/man8/zed.8*
327 %{_mandir}/man8/zfs.8*
328 %{_mandir}/man8/zinject.8*
329 %{_mandir}/man8/zpool.8*
330 %{_mandir}/man8/zstreamdump.8*
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
335 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
336 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
337 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
338 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
339 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
340 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
341 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
342 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
343 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
346 %defattr(644,root,root,755)
347 %attr(755,root,root) %{_libdir}/libnvpair.so
348 %attr(755,root,root) %{_libdir}/libuutil.so
349 %attr(755,root,root) %{_libdir}/libzfs.so
350 %attr(755,root,root) %{_libdir}/libzfs_core.so
351 %attr(755,root,root) %{_libdir}/libzpool.so
352 %{_libdir}/libnvpair.la
353 %{_libdir}/libuutil.la
355 %{_libdir}/libzfs_core.la
356 %{_libdir}/libzpool.la
357 %{_includedir}/libspl
358 %{_includedir}/libzfs
359 %{_pkgconfigdir}/libzfs.pc
360 %{_pkgconfigdir}/libzfs_core.pc
363 %defattr(644,root,root,755)
364 %{_libdir}/libnvpair.a
365 %{_libdir}/libuutil.a
367 %{_libdir}/libzfs_core.a
368 %{_libdir}/libzpool.a
371 %defattr(644,root,root,755)
372 %doc contrib/dracut/README.dracut.markdown
373 %dir %{dracutlibdir}/modules.d/90zfs
374 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
375 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
376 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
377 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
378 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
382 %files -n kernel-zfs-common-devel
383 %defattr(644,root,root,755)
384 %dir /usr/src/zfs-%{version}
385 /usr/src/zfs-%{version}/include
386 /usr/src/zfs-%{version}/zfs.release.in
387 /usr/src/zfs-%{version}/zfs_config.h.in