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,kernel%%{_alt_kernel}-spl-devel >= 0.6.3" ; 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: rpmbuild(macros) >= 1.379
62 %{?with_dist_kernel:%{expand:%kbrs}}
65 BuildRequires: libblkid-devel
66 BuildRequires: libselinux-devel
67 BuildRequires: libuuid-devel
68 BuildRequires: zlib-devel
70 Requires: %{pname}-libs = %{version}-%{release}
71 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73 %define dracutlibdir %{_prefix}/lib/dracut
76 ZFS is an advanced file system and volume manager which was originally
77 developed for Solaris and is now maintained by the Illumos community.
79 ZFS on Linux, which is also known as ZoL, is currently feature
80 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
83 %description -l pl.UTF-8
84 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
85 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
87 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
88 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
92 Summary: ZFS on Linux libraries
93 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
96 Requires(post,postun): /sbin/ldconfig
99 ZFS on Linux libraries.
101 %description libs -l pl.UTF-8
102 Biblioteki ZFS-a dla Linuksa.
105 Summary: Header files for ZFS libraries
106 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
108 Group: Development/Libraries
109 Requires: %{pname}-libs = %{version}-%{release}
110 Requires: libselinux-devel
111 Requires: libuuid-devel
115 Header files for ZFS libraries.
117 %description devel -l pl.UTF-8
118 Pliki nagłówkowe bibliotek ZFS-a.
121 Summary: Static ZFS libraries
122 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
124 Group: Development/Libraries
125 Requires: %{pname}-devel = %{version}-%{release}
128 Static ZFS libraries.
130 %description static -l pl.UTF-8
131 Statyczne biblioteki ZFS-a.
133 %package -n dracut-zfs
134 Summary: ZFS support for Dracut
135 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
136 Group: Applications/System
137 Requires: %{pname} = %{version}-%{release}
140 %description -n dracut-zfs
141 ZFS support for Dracut.
143 %description -n dracut-zfs -l pl.UTF-8
144 Obsługa ZFS-a dla Dracuta.
146 %package -n kernel-zfs-common-devel
147 Summary: ZFS Linux kernel headers
148 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
149 Group: Development/Building
151 %description -n kernel-zfs-common-devel
152 ZFS Linux kernel headers common for all PLD kernel versions.
154 %description -n kernel-zfs-common-devel -l pl.UTF-8
155 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
158 %define kernel_pkg()\
159 %package -n kernel%{_alt_kernel}-zfs\
160 Summary: ZFS Linux kernel modules\
161 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
162 Release: %{rel}@%{_kernel_ver_str}\
164 Requires(post,postun): /sbin/depmod\
165 %if %{with dist_kernel}\
166 %requires_releq_kernel\
167 Requires(postun): %releq_kernel\
170 %description -n kernel%{_alt_kernel}-zfs\
171 ZFS Linux kernel modules.\
173 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
174 ZFS - moduły jądra Linuksa.\
176 %package -n kernel%{_alt_kernel}-zfs-devel\
177 Summary: ZFS Linux kernel headers\
178 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
179 Release: %{rel}@%{_kernel_ver_str}\
180 Group: Development/Building\
181 %if %{with dist_kernel}\
182 Requires: kernel%{_alt_kernel}-headers\
183 Requires: kernel-zfs-common-devel\
186 %description -n kernel%{_alt_kernel}-zfs-devel\
187 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
188 version %{_kernel_ver}.\
190 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
191 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
192 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
194 %files -n kernel%{_alt_kernel}-zfs\
195 %defattr(644,root,root,755)\
196 %dir /lib/modules/%{_kernel_ver}/misc/avl\
197 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
198 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
199 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
200 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
201 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
202 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
203 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
204 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
205 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
206 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
207 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
209 %files -n kernel%{_alt_kernel}-zfs-devel\
210 %defattr(644,root,root,755)\
211 /usr/src/zfs-%{version}/%{_kernel_ver}\
213 %post -n kernel%{_alt_kernel}-zfs\
214 %depmod %{_kernel_ver}\
216 %postun -n kernel%{_alt_kernel}-zfs\
217 %depmod %{_kernel_ver}\
220 %define build_kernel_pkg()\
222 --disable-silent-rules \\\
223 --with-config="kernel" \\\
224 --with-linux=%{_kernelsrcdir}\
227 %{__make} %{?with_verbose:V=1}\
229 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
232 %{?with_kernel:%{expand:%kpkg}}
235 %setup -q -n %{pname}-%{version}
240 %{__aclocal} -I config
244 %{?with_kernel:%{expand:%bkpkg}}
246 %if %{with userspace}
248 --disable-silent-rules \
249 --with-config="user" \
250 --with-linux=%{_kernelsrcdir} \
251 --with-systemdunitdir=%{systemdunitdir} \
252 --with-systemdpresetdir=/etc/systemd/system-preset \
253 --with-udevdir=/lib/udev
260 rm -rf $RPM_BUILD_ROOT
263 install -d $RPM_BUILD_ROOT
264 cp -a installed/* $RPM_BUILD_ROOT
267 %if %{with userspace}
269 DESTDIR=$RPM_BUILD_ROOT \
270 DEFAULT_INIT_DIR=/etc/rc.d/init.d
274 rm -rf $RPM_BUILD_ROOT
276 %post libs -p /sbin/ldconfig
277 %postun libs -p /sbin/ldconfig
279 %if %{with userspace}
281 %defattr(644,root,root,755)
282 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
283 %attr(755,root,root) /sbin/mount.zfs
284 %attr(755,root,root) %{_bindir}/arcstat.py
285 %attr(755,root,root) %{_bindir}/dbufstat.py
286 %attr(755,root,root) %{_sbindir}/fsck.zfs
287 %attr(755,root,root) %{_sbindir}/zdb
288 %attr(755,root,root) %{_sbindir}/zed
289 %attr(755,root,root) %{_sbindir}/zfs
290 %attr(755,root,root) %{_sbindir}/zhack
291 %attr(755,root,root) %{_sbindir}/zinject
292 %attr(755,root,root) %{_sbindir}/zpios
293 %attr(755,root,root) %{_sbindir}/zpool
294 %attr(755,root,root) %{_sbindir}/zstreamdump
295 %attr(755,root,root) %{_sbindir}/ztest
296 %dir %{_sysconfdir}/zfs
297 # package *.example as %doc? (they cannot act as default configuration)
298 %{_sysconfdir}/zfs/vdev_id.conf.*.example
299 %dir %{_sysconfdir}/zfs/zed.d
300 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
301 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
302 %attr(754,root,root) /etc/rc.d/init.d/zfs
303 /usr/lib/modules-load.d/zfs.conf
304 /etc/systemd/system-preset/50-zfs.preset
305 %{systemdunitdir}/zed.service
306 %{systemdunitdir}/zfs.target
307 %{systemdunitdir}/zfs-import-cache.service
308 %{systemdunitdir}/zfs-import-scan.service
309 %{systemdunitdir}/zfs-mount.service
310 %{systemdunitdir}/zfs-share.service
311 %attr(755,root,root) /lib/udev/vdev_id
312 %attr(755,root,root) /lib/udev/zvol_id
313 /lib/udev/rules.d/60-zvol.rules
314 /lib/udev/rules.d/69-vdev.rules
315 /lib/udev/rules.d/90-zfs.rules
317 %dir %{_libdir}/zfs/zed.d
318 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
320 %attr(755,root,root) %{_datadir}/zfs/*.sh
321 %dir %{_datadir}/zfs/zpios-profile
322 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
323 %dir %{_datadir}/zfs/zpios-test
324 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
325 %dir %{_datadir}/zfs/zpool-config
326 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
327 %{_mandir}/man1/zhack.1*
328 %{_mandir}/man1/zpios.1*
329 %{_mandir}/man1/ztest.1*
330 %{_mandir}/man5/vdev_id.conf.5*
331 %{_mandir}/man5/zfs-module-parameters.5*
332 %{_mandir}/man5/zpool-features.5*
333 %{_mandir}/man8/fsck.zfs.8*
334 %{_mandir}/man8/mount.zfs.8*
335 %{_mandir}/man8/vdev_id.8*
336 %{_mandir}/man8/zdb.8*
337 %{_mandir}/man8/zed.8*
338 %{_mandir}/man8/zfs.8*
339 %{_mandir}/man8/zinject.8*
340 %{_mandir}/man8/zpool.8*
341 %{_mandir}/man8/zstreamdump.8*
344 %defattr(644,root,root,755)
345 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
346 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
347 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
348 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
349 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
350 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
351 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
352 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
353 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
354 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_libdir}/libnvpair.so
359 %attr(755,root,root) %{_libdir}/libuutil.so
360 %attr(755,root,root) %{_libdir}/libzfs.so
361 %attr(755,root,root) %{_libdir}/libzfs_core.so
362 %attr(755,root,root) %{_libdir}/libzpool.so
363 %{_libdir}/libnvpair.la
364 %{_libdir}/libuutil.la
366 %{_libdir}/libzfs_core.la
367 %{_libdir}/libzpool.la
368 %{_includedir}/libspl
369 %{_includedir}/libzfs
372 %defattr(644,root,root,755)
373 %{_libdir}/libnvpair.a
374 %{_libdir}/libuutil.a
376 %{_libdir}/libzfs_core.a
377 %{_libdir}/libzpool.a
380 %defattr(644,root,root,755)
381 %doc dracut/README.dracut.markdown
382 %dir %{dracutlibdir}/modules.d/90zfs
383 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
384 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
385 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.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