1 # TODO: PLDify init script
4 %bcond_without dist_kernel # allow non-distribution kernel
5 %bcond_without kernel # don't build kernel modules
6 %bcond_without userspace # don't build userspace programs
7 %bcond_with verbose # verbose build (V=1)
10 %undefine with_dist_kernel
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 "%{_alt_kernel}" != "%{nil}"
23 %if 0%{?build_kernels:1}
24 %{error:alt_kernel and build_kernels are mutually exclusive}
27 %undefine with_userspace
28 %global _build_kernels %{alt_kernel}
30 %global _build_kernels %{?build_kernels:,%{?build_kernels}}
33 %if %{without userspace}
34 # nothing to be placed to debuginfo package
35 %define _enable_debug_packages 0
38 %define _duplicate_files_terminate_build 0
40 %define kbrs %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo "BuildRequires:kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2" ; done)
41 %define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done)
42 %define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done)
46 Summary: Native Linux port of the ZFS filesystem
47 Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS
48 Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
50 Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
51 License: CDDL (ZFS), GPL v2+ (ZPIOS)
52 Group: Applications/System
53 Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz
54 # Source0-md5: 5bcc32c122934d421eba68e16826637d
55 Patch0: %{pname}-link.patch
56 URL: http://zfsonlinux.org/
57 BuildRequires: autoconf >= 2.50
58 BuildRequires: automake
59 BuildRequires: libtool
61 BuildRequires: kernel%{_alt_kernel}-spl-devel >= 0.6.3
62 BuildRequires: rpmbuild(macros) >= 1.379
63 %{?with_dist_kernel:%{expand:%kbrs}}
66 BuildRequires: libblkid-devel
67 BuildRequires: libselinux-devel
68 BuildRequires: libuuid-devel
69 BuildRequires: zlib-devel
71 Requires: %{pname}-libs = %{version}-%{release}
72 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
74 %define dracutlibdir %{_prefix}/lib/dracut
77 ZFS is an advanced file system and volume manager which was originally
78 developed for Solaris and is now maintained by the Illumos community.
80 ZFS on Linux, which is also known as ZoL, is currently feature
81 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
84 %description -l pl.UTF-8
85 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
86 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
88 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
89 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
93 Summary: ZFS on Linux libraries
94 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
97 Requires(post,postun): /sbin/ldconfig
100 ZFS on Linux libraries.
102 %description libs -l pl.UTF-8
103 Biblioteki ZFS-a dla Linuksa.
106 Summary: Header files for ZFS libraries
107 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
109 Group: Development/Libraries
110 Requires: %{pname}-libs = %{version}-%{release}
111 Requires: libselinux-devel
112 Requires: libuuid-devel
116 Header files for ZFS libraries.
118 %description devel -l pl.UTF-8
119 Pliki nagłówkowe bibliotek ZFS-a.
122 Summary: Static ZFS libraries
123 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
125 Group: Development/Libraries
126 Requires: %{pname}-devel = %{version}-%{release}
129 Static ZFS libraries.
131 %description static -l pl.UTF-8
132 Statyczne biblioteki ZFS-a.
134 %package -n dracut-zfs
135 Summary: ZFS support for Dracut
136 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
137 Group: Applications/System
138 Requires: %{pname} = %{version}-%{release}
141 %description -n dracut-zfs
142 ZFS support for Dracut.
144 %description -n dracut-zfs -l pl.UTF-8
145 Obsługa ZFS-a dla Dracuta.
147 %package -n kernel-zfs-common-devel
148 Summary: ZFS Linux kernel headers
149 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
150 Group: Development/Building
152 %description -n kernel-zfs-common-devel
153 ZFS Linux kernel headers common for all PLD kernel versions.
155 %description -n kernel-zfs-common-devel -l pl.UTF-8
156 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
159 %define kernel_pkg()\
160 %package -n kernel%{_alt_kernel}-zfs\
161 Summary: ZFS Linux kernel modules\
162 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
163 Release: %{rel}@%{_kernel_ver_str}\
165 Requires(post,postun): /sbin/depmod\
166 %if %{with dist_kernel}\
167 %requires_releq_kernel\
168 Requires(postun): %releq_kernel\
171 %description -n kernel%{_alt_kernel}-zfs\
172 ZFS Linux kernel modules.\
174 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
175 ZFS - moduły jądra Linuksa.\
177 %package -n kernel%{_alt_kernel}-zfs-devel\
178 Summary: ZFS Linux kernel headers\
179 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
180 Release: %{rel}@%{_kernel_ver_str}\
181 Group: Development/Building\
182 %if %{with dist_kernel}\
183 Requires: kernel%{_alt_kernel}-headers\
184 Requires: kernel-zfs-common-devel\
187 %description -n kernel%{_alt_kernel}-zfs-devel\
188 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
189 version %{_kernel_ver}.\
191 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
192 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
193 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
195 %files -n kernel%{_alt_kernel}-zfs\
196 %defattr(644,root,root,755)\
197 %dir /lib/modules/%{_kernel_ver}/misc/avl\
198 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
199 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
200 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
201 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
202 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
203 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
204 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
205 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
206 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
207 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
208 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
210 %files -n kernel%{_alt_kernel}-zfs-devel\
211 %defattr(644,root,root,755)\
212 /usr/src/zfs-%{version}/%{_kernel_ver}\
214 %post -n kernel%{_alt_kernel}-zfs\
215 %depmod %{_kernel_ver}\
217 %postun -n kernel%{_alt_kernel}-zfs\
218 %depmod %{_kernel_ver}\
221 %define build_kernel_pkg()\
223 --disable-silent-rules \\\
224 --with-config="kernel" \\\
225 --with-linux=%{_kernelsrcdir}\
228 %{__make} %{?with_verbose:V=1}\
230 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
233 %{?with_kernel:%{expand:%kpkg}}
236 %setup -q -n %{pname}-%{version}
241 %{__aclocal} -I config
245 %{?with_kernel:%{expand:%bkpkg}}
247 %if %{with userspace}
249 --disable-silent-rules \
250 --with-config="user" \
251 --with-linux=%{_kernelsrcdir} \
252 --with-systemdunitdir=%{systemdunitdir} \
253 --with-systemdpresetdir=/etc/systemd/system-preset \
254 --with-udevdir=/lib/udev
261 rm -rf $RPM_BUILD_ROOT
264 install -d $RPM_BUILD_ROOT
265 cp -a installed/* $RPM_BUILD_ROOT
268 %if %{with userspace}
270 DESTDIR=$RPM_BUILD_ROOT \
271 DEFAULT_INIT_DIR=/etc/rc.d/init.d
275 rm -rf $RPM_BUILD_ROOT
277 %post libs -p /sbin/ldconfig
278 %postun libs -p /sbin/ldconfig
280 %if %{with userspace}
282 %defattr(644,root,root,755)
283 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
284 %attr(755,root,root) /sbin/mount.zfs
285 %attr(755,root,root) %{_bindir}/arcstat.py
286 %attr(755,root,root) %{_bindir}/dbufstat.py
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 %attr(754,root,root) /etc/rc.d/init.d/zfs
304 /usr/lib/modules-load.d/zfs.conf
305 /etc/systemd/system-preset/50-zfs.preset
306 %{systemdunitdir}/zed.service
307 %{systemdunitdir}/zfs.target
308 %{systemdunitdir}/zfs-import-cache.service
309 %{systemdunitdir}/zfs-import-scan.service
310 %{systemdunitdir}/zfs-mount.service
311 %{systemdunitdir}/zfs-share.service
312 %attr(755,root,root) /lib/udev/vdev_id
313 %attr(755,root,root) /lib/udev/zvol_id
314 /lib/udev/rules.d/60-zvol.rules
315 /lib/udev/rules.d/69-vdev.rules
316 /lib/udev/rules.d/90-zfs.rules
318 %dir %{_libdir}/zfs/zed.d
319 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
321 %attr(755,root,root) %{_datadir}/zfs/*.sh
322 %dir %{_datadir}/zfs/zpios-profile
323 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
324 %dir %{_datadir}/zfs/zpios-test
325 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
326 %dir %{_datadir}/zfs/zpool-config
327 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
328 %{_mandir}/man1/zhack.1*
329 %{_mandir}/man1/zpios.1*
330 %{_mandir}/man1/ztest.1*
331 %{_mandir}/man5/vdev_id.conf.5*
332 %{_mandir}/man5/zfs-module-parameters.5*
333 %{_mandir}/man5/zpool-features.5*
334 %{_mandir}/man8/fsck.zfs.8*
335 %{_mandir}/man8/mount.zfs.8*
336 %{_mandir}/man8/vdev_id.8*
337 %{_mandir}/man8/zdb.8*
338 %{_mandir}/man8/zed.8*
339 %{_mandir}/man8/zfs.8*
340 %{_mandir}/man8/zinject.8*
341 %{_mandir}/man8/zpool.8*
342 %{_mandir}/man8/zstreamdump.8*
345 %defattr(644,root,root,755)
346 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
347 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
348 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
349 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
350 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
351 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
352 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
353 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
354 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
355 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
358 %defattr(644,root,root,755)
359 %attr(755,root,root) %{_libdir}/libnvpair.so
360 %attr(755,root,root) %{_libdir}/libuutil.so
361 %attr(755,root,root) %{_libdir}/libzfs.so
362 %attr(755,root,root) %{_libdir}/libzfs_core.so
363 %attr(755,root,root) %{_libdir}/libzpool.so
364 %{_libdir}/libnvpair.la
365 %{_libdir}/libuutil.la
367 %{_libdir}/libzfs_core.la
368 %{_libdir}/libzpool.la
369 %{_includedir}/libspl
370 %{_includedir}/libzfs
373 %defattr(644,root,root,755)
374 %{_libdir}/libnvpair.a
375 %{_libdir}/libuutil.a
377 %{_libdir}/libzfs_core.a
378 %{_libdir}/libzpool.a
381 %defattr(644,root,root,755)
382 %doc dracut/README.dracut.markdown
383 %dir %{dracutlibdir}/modules.d/90zfs
384 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
385 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
386 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
390 %files -n kernel-zfs-common-devel
391 %defattr(644,root,root,755)
392 /usr/src/zfs-%{version}/include
393 /usr/src/zfs-%{version}/zfs.release.in
394 /usr/src/zfs-%{version}/zfs_config.h.in