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 Patch4: linux-4.0.patch
40 URL: http://zfsonlinux.org/
41 BuildRequires: autoconf >= 2.50
42 BuildRequires: automake
43 BuildRequires: libtool
44 BuildRequires: rpmbuild(macros) >= 1.701
46 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
47 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
50 BuildRequires: libblkid-devel
51 BuildRequires: libselinux-devel
52 BuildRequires: libuuid-devel
53 BuildRequires: zlib-devel
55 Requires: %{pname}-libs = %{version}-%{release}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %define dracutlibdir %{_prefix}/lib/dracut
61 ZFS is an advanced file system and volume manager which was originally
62 developed for Solaris and is now maintained by the Illumos community.
64 ZFS on Linux, which is also known as ZoL, is currently feature
65 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
68 %description -l pl.UTF-8
69 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
70 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
72 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
73 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
77 Summary: ZFS on Linux libraries
78 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
81 Requires(post,postun): /sbin/ldconfig
84 ZFS on Linux libraries.
86 %description libs -l pl.UTF-8
87 Biblioteki ZFS-a dla Linuksa.
90 Summary: Header files for ZFS libraries
91 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
93 Group: Development/Libraries
94 Requires: %{pname}-libs = %{version}-%{release}
95 Requires: libselinux-devel
96 Requires: libuuid-devel
100 Header files for ZFS libraries.
102 %description devel -l pl.UTF-8
103 Pliki nagłówkowe bibliotek ZFS-a.
106 Summary: Static ZFS libraries
107 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
109 Group: Development/Libraries
110 Requires: %{pname}-devel = %{version}-%{release}
113 Static ZFS libraries.
115 %description static -l pl.UTF-8
116 Statyczne biblioteki ZFS-a.
118 %package -n dracut-zfs
119 Summary: ZFS support for Dracut
120 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
121 Group: Applications/System
122 Requires: %{pname} = %{version}-%{release}
125 %description -n dracut-zfs
126 ZFS support for Dracut.
128 %description -n dracut-zfs -l pl.UTF-8
129 Obsługa ZFS-a dla Dracuta.
131 %package -n kernel-zfs-common-devel
132 Summary: ZFS Linux kernel headers
133 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
134 Group: Development/Building
136 %description -n kernel-zfs-common-devel
137 ZFS Linux kernel headers common for all PLD kernel versions.
139 %description -n kernel-zfs-common-devel -l pl.UTF-8
140 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
143 %define kernel_pkg()\
144 %package -n kernel%{_alt_kernel}-zfs\
145 Summary: ZFS Linux kernel modules\
146 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
147 Release: %{rel}@%{_kernel_ver_str}\
149 Requires(post,postun): /sbin/depmod\
150 %requires_releq_kernel\
151 Requires(postun): %releq_kernel\
153 %description -n kernel%{_alt_kernel}-zfs\
154 ZFS Linux kernel modules.\
156 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
157 ZFS - moduły jądra Linuksa.\
159 %package -n kernel%{_alt_kernel}-zfs-devel\
160 Summary: ZFS Linux kernel headers\
161 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
162 Release: %{rel}@%{_kernel_ver_str}\
163 Group: Development/Building\
164 Requires: kernel%{_alt_kernel}-headers\
165 Requires: kernel-zfs-common-devel\
167 %description -n kernel%{_alt_kernel}-zfs-devel\
168 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
169 version %{_kernel_ver}.\
171 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
172 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
173 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
175 %files -n kernel%{_alt_kernel}-zfs\
176 %defattr(644,root,root,755)\
177 %dir /lib/modules/%{_kernel_ver}/misc/avl\
178 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
179 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
180 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
181 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
182 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
183 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
184 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
185 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
186 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
187 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
188 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
190 %files -n kernel%{_alt_kernel}-zfs-devel\
191 %defattr(644,root,root,755)\
192 /usr/src/zfs-%{version}/%{_kernel_ver}\
194 %post -n kernel%{_alt_kernel}-zfs\
195 %depmod %{_kernel_ver}\
197 %postun -n kernel%{_alt_kernel}-zfs\
198 %depmod %{_kernel_ver}\
201 %define build_kernel_pkg()\
203 --disable-silent-rules \\\
204 --with-config="kernel" \\\
205 --with-linux=%{_kernelsrcdir}\
208 %{__make} %{?with_verbose:V=1}\
210 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
213 %{?with_kernel:%{expand:%create_kernel_packages}}
216 %setup -q -n %{pname}-%{version}
225 %{__aclocal} -I config
229 %{?with_kernel:%{expand:%build_kernel_packages}}
231 %if %{with userspace}
233 --disable-silent-rules \
234 --with-config="user" \
235 --with-linux=%{_kernelsrcdir} \
236 --with-systemdunitdir=%{systemdunitdir} \
237 --with-systemdpresetdir=/etc/systemd/system-preset \
238 --with-udevdir=/lib/udev
245 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT
249 cp -a installed/* $RPM_BUILD_ROOT
252 %if %{with userspace}
254 DESTDIR=$RPM_BUILD_ROOT \
255 DEFAULT_INIT_DIR=/etc/rc.d/init.d
259 rm -rf $RPM_BUILD_ROOT
261 %post libs -p /sbin/ldconfig
262 %postun libs -p /sbin/ldconfig
264 %if %{with userspace}
266 %defattr(644,root,root,755)
267 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
268 %attr(755,root,root) /sbin/mount.zfs
269 %attr(755,root,root) %{_bindir}/arcstat.py
270 %attr(755,root,root) %{_bindir}/dbufstat.py
271 %attr(755,root,root) %{_sbindir}/fsck.zfs
272 %attr(755,root,root) %{_sbindir}/zdb
273 %attr(755,root,root) %{_sbindir}/zed
274 %attr(755,root,root) %{_sbindir}/zfs
275 %attr(755,root,root) %{_sbindir}/zhack
276 %attr(755,root,root) %{_sbindir}/zinject
277 %attr(755,root,root) %{_sbindir}/zpios
278 %attr(755,root,root) %{_sbindir}/zpool
279 %attr(755,root,root) %{_sbindir}/zstreamdump
280 %attr(755,root,root) %{_sbindir}/ztest
281 %dir %{_sysconfdir}/zfs
282 # package *.example as %doc? (they cannot act as default configuration)
283 %{_sysconfdir}/zfs/vdev_id.conf.*.example
284 %dir %{_sysconfdir}/zfs/zed.d
285 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
286 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
287 %attr(754,root,root) /etc/rc.d/init.d/zfs
288 /usr/lib/modules-load.d/zfs.conf
289 /etc/systemd/system-preset/50-zfs.preset
290 %{systemdunitdir}/zed.service
291 %{systemdunitdir}/zfs.target
292 %{systemdunitdir}/zfs-import-cache.service
293 %{systemdunitdir}/zfs-import-scan.service
294 %{systemdunitdir}/zfs-mount.service
295 %{systemdunitdir}/zfs-share.service
296 %attr(755,root,root) /lib/udev/vdev_id
297 %attr(755,root,root) /lib/udev/zvol_id
298 /lib/udev/rules.d/60-zvol.rules
299 /lib/udev/rules.d/69-vdev.rules
300 /lib/udev/rules.d/90-zfs.rules
302 %dir %{_libdir}/zfs/zed.d
303 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
305 %attr(755,root,root) %{_datadir}/zfs/*.sh
306 %dir %{_datadir}/zfs/zpios-profile
307 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
308 %dir %{_datadir}/zfs/zpios-test
309 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
310 %dir %{_datadir}/zfs/zpool-config
311 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
312 %{_mandir}/man1/zhack.1*
313 %{_mandir}/man1/zpios.1*
314 %{_mandir}/man1/ztest.1*
315 %{_mandir}/man5/vdev_id.conf.5*
316 %{_mandir}/man5/zfs-module-parameters.5*
317 %{_mandir}/man5/zpool-features.5*
318 %{_mandir}/man8/fsck.zfs.8*
319 %{_mandir}/man8/mount.zfs.8*
320 %{_mandir}/man8/vdev_id.8*
321 %{_mandir}/man8/zdb.8*
322 %{_mandir}/man8/zed.8*
323 %{_mandir}/man8/zfs.8*
324 %{_mandir}/man8/zinject.8*
325 %{_mandir}/man8/zpool.8*
326 %{_mandir}/man8/zstreamdump.8*
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
331 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
332 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
333 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
334 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
335 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
336 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
337 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
338 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
339 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
342 %defattr(644,root,root,755)
343 %attr(755,root,root) %{_libdir}/libnvpair.so
344 %attr(755,root,root) %{_libdir}/libuutil.so
345 %attr(755,root,root) %{_libdir}/libzfs.so
346 %attr(755,root,root) %{_libdir}/libzfs_core.so
347 %attr(755,root,root) %{_libdir}/libzpool.so
348 %{_libdir}/libnvpair.la
349 %{_libdir}/libuutil.la
351 %{_libdir}/libzfs_core.la
352 %{_libdir}/libzpool.la
353 %{_includedir}/libspl
354 %{_includedir}/libzfs
357 %defattr(644,root,root,755)
358 %{_libdir}/libnvpair.a
359 %{_libdir}/libuutil.a
361 %{_libdir}/libzfs_core.a
362 %{_libdir}/libzpool.a
365 %defattr(644,root,root,755)
366 %doc dracut/README.dracut.markdown
367 %dir %{dracutlibdir}/modules.d/90zfs
368 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
369 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
370 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
374 %files -n kernel-zfs-common-devel
375 %defattr(644,root,root,755)
376 %dir /usr/src/zfs-%{version}
377 /usr/src/zfs-%{version}/include
378 /usr/src/zfs-%{version}/zfs.release.in
379 /usr/src/zfs-%{version}/zfs_config.h.in