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: 5bcc32c122934d421eba68e16826637d
35 Patch0: %{pname}-link.patch
36 Patch1: linux-3.18.patch
38 Patch3: linux-3.19.patch
39 URL: http://zfsonlinux.org/
40 BuildRequires: autoconf >= 2.50
41 BuildRequires: automake
42 BuildRequires: libtool
43 BuildRequires: rpmbuild(macros) >= 1.701
45 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
46 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
49 BuildRequires: libblkid-devel
50 BuildRequires: libselinux-devel
51 BuildRequires: libuuid-devel
52 BuildRequires: zlib-devel
54 Requires: %{pname}-libs = %{version}-%{release}
55 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 %define dracutlibdir %{_prefix}/lib/dracut
60 ZFS is an advanced file system and volume manager which was originally
61 developed for Solaris and is now maintained by the Illumos community.
63 ZFS on Linux, which is also known as ZoL, is currently feature
64 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
67 %description -l pl.UTF-8
68 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
69 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
71 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
72 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
76 Summary: ZFS on Linux libraries
77 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
80 Requires(post,postun): /sbin/ldconfig
83 ZFS on Linux libraries.
85 %description libs -l pl.UTF-8
86 Biblioteki ZFS-a dla Linuksa.
89 Summary: Header files for ZFS libraries
90 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
92 Group: Development/Libraries
93 Requires: %{pname}-libs = %{version}-%{release}
94 Requires: libselinux-devel
95 Requires: libuuid-devel
99 Header files for ZFS libraries.
101 %description devel -l pl.UTF-8
102 Pliki nagłówkowe bibliotek ZFS-a.
105 Summary: Static ZFS libraries
106 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
108 Group: Development/Libraries
109 Requires: %{pname}-devel = %{version}-%{release}
112 Static ZFS libraries.
114 %description static -l pl.UTF-8
115 Statyczne biblioteki ZFS-a.
117 %package -n dracut-zfs
118 Summary: ZFS support for Dracut
119 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
120 Group: Applications/System
121 Requires: %{pname} = %{version}-%{release}
124 %description -n dracut-zfs
125 ZFS support for Dracut.
127 %description -n dracut-zfs -l pl.UTF-8
128 Obsługa ZFS-a dla Dracuta.
130 %package -n kernel-zfs-common-devel
131 Summary: ZFS Linux kernel headers
132 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
133 Group: Development/Building
135 %description -n kernel-zfs-common-devel
136 ZFS Linux kernel headers common for all PLD kernel versions.
138 %description -n kernel-zfs-common-devel -l pl.UTF-8
139 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
142 %define kernel_pkg()\
143 %package -n kernel%{_alt_kernel}-zfs\
144 Summary: ZFS Linux kernel modules\
145 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
146 Release: %{rel}@%{_kernel_ver_str}\
148 Requires(post,postun): /sbin/depmod\
149 %requires_releq_kernel\
150 Requires(postun): %releq_kernel\
152 %description -n kernel%{_alt_kernel}-zfs\
153 ZFS Linux kernel modules.\
155 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
156 ZFS - moduły jądra Linuksa.\
158 %package -n kernel%{_alt_kernel}-zfs-devel\
159 Summary: ZFS Linux kernel headers\
160 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
161 Release: %{rel}@%{_kernel_ver_str}\
162 Group: Development/Building\
163 Requires: kernel%{_alt_kernel}-headers\
164 Requires: kernel-zfs-common-devel\
166 %description -n kernel%{_alt_kernel}-zfs-devel\
167 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
168 version %{_kernel_ver}.\
170 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
171 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
172 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
174 %files -n kernel%{_alt_kernel}-zfs\
175 %defattr(644,root,root,755)\
176 %dir /lib/modules/%{_kernel_ver}/misc/avl\
177 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
178 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
179 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
180 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
181 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
182 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
183 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
184 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
185 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
186 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
187 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
189 %files -n kernel%{_alt_kernel}-zfs-devel\
190 %defattr(644,root,root,755)\
191 /usr/src/zfs-%{version}/%{_kernel_ver}\
193 %post -n kernel%{_alt_kernel}-zfs\
194 %depmod %{_kernel_ver}\
196 %postun -n kernel%{_alt_kernel}-zfs\
197 %depmod %{_kernel_ver}\
200 %define build_kernel_pkg()\
202 --disable-silent-rules \\\
203 --with-config="kernel" \\\
204 --with-linux=%{_kernelsrcdir}\
207 %{__make} %{?with_verbose:V=1}\
209 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
212 %{?with_kernel:%{expand:%create_kernel_packages}}
215 %setup -q -n %{pname}-%{version}
223 %{__aclocal} -I config
227 %{?with_kernel:%{expand:%build_kernel_packages}}
229 %if %{with userspace}
231 --disable-silent-rules \
232 --with-config="user" \
233 --with-linux=%{_kernelsrcdir} \
234 --with-systemdunitdir=%{systemdunitdir} \
235 --with-systemdpresetdir=/etc/systemd/system-preset \
236 --with-udevdir=/lib/udev
243 rm -rf $RPM_BUILD_ROOT
246 install -d $RPM_BUILD_ROOT
247 cp -a installed/* $RPM_BUILD_ROOT
250 %if %{with userspace}
252 DESTDIR=$RPM_BUILD_ROOT \
253 DEFAULT_INIT_DIR=/etc/rc.d/init.d
257 rm -rf $RPM_BUILD_ROOT
259 %post libs -p /sbin/ldconfig
260 %postun libs -p /sbin/ldconfig
262 %if %{with userspace}
264 %defattr(644,root,root,755)
265 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
266 %attr(755,root,root) /sbin/mount.zfs
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
286 /usr/lib/modules-load.d/zfs.conf
287 /etc/systemd/system-preset/50-zfs.preset
288 %{systemdunitdir}/zed.service
289 %{systemdunitdir}/zfs.target
290 %{systemdunitdir}/zfs-import-cache.service
291 %{systemdunitdir}/zfs-import-scan.service
292 %{systemdunitdir}/zfs-mount.service
293 %{systemdunitdir}/zfs-share.service
294 %attr(755,root,root) /lib/udev/vdev_id
295 %attr(755,root,root) /lib/udev/zvol_id
296 /lib/udev/rules.d/60-zvol.rules
297 /lib/udev/rules.d/69-vdev.rules
298 /lib/udev/rules.d/90-zfs.rules
300 %dir %{_libdir}/zfs/zed.d
301 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
303 %attr(755,root,root) %{_datadir}/zfs/*.sh
304 %dir %{_datadir}/zfs/zpios-profile
305 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
306 %dir %{_datadir}/zfs/zpios-test
307 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
308 %dir %{_datadir}/zfs/zpool-config
309 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
310 %{_mandir}/man1/zhack.1*
311 %{_mandir}/man1/zpios.1*
312 %{_mandir}/man1/ztest.1*
313 %{_mandir}/man5/vdev_id.conf.5*
314 %{_mandir}/man5/zfs-module-parameters.5*
315 %{_mandir}/man5/zpool-features.5*
316 %{_mandir}/man8/fsck.zfs.8*
317 %{_mandir}/man8/mount.zfs.8*
318 %{_mandir}/man8/vdev_id.8*
319 %{_mandir}/man8/zdb.8*
320 %{_mandir}/man8/zed.8*
321 %{_mandir}/man8/zfs.8*
322 %{_mandir}/man8/zinject.8*
323 %{_mandir}/man8/zpool.8*
324 %{_mandir}/man8/zstreamdump.8*
327 %defattr(644,root,root,755)
328 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
329 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
330 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
331 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
332 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
333 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
334 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
335 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
336 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
337 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{_libdir}/libnvpair.so
342 %attr(755,root,root) %{_libdir}/libuutil.so
343 %attr(755,root,root) %{_libdir}/libzfs.so
344 %attr(755,root,root) %{_libdir}/libzfs_core.so
345 %attr(755,root,root) %{_libdir}/libzpool.so
346 %{_libdir}/libnvpair.la
347 %{_libdir}/libuutil.la
349 %{_libdir}/libzfs_core.la
350 %{_libdir}/libzpool.la
351 %{_includedir}/libspl
352 %{_includedir}/libzfs
355 %defattr(644,root,root,755)
356 %{_libdir}/libnvpair.a
357 %{_libdir}/libuutil.a
359 %{_libdir}/libzfs_core.a
360 %{_libdir}/libzpool.a
363 %defattr(644,root,root,755)
364 %doc dracut/README.dracut.markdown
365 %dir %{dracutlibdir}/modules.d/90zfs
366 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
367 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
368 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
372 %files -n kernel-zfs-common-devel
373 %defattr(644,root,root,755)
374 %dir /usr/src/zfs-%{version}
375 /usr/src/zfs-%{version}/include
376 /usr/src/zfs-%{version}/zfs.release.in
377 /usr/src/zfs-%{version}/zfs_config.h.in