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 URL: http://zfsonlinux.org/
39 BuildRequires: autoconf >= 2.50
40 BuildRequires: automake
41 BuildRequires: libtool
42 BuildRequires: rpmbuild(macros) >= 1.701
44 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
45 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-spl-devel >= 0.6.3}
48 BuildRequires: libblkid-devel
49 BuildRequires: libselinux-devel
50 BuildRequires: libuuid-devel
51 BuildRequires: zlib-devel
53 Requires: %{pname}-libs = %{version}-%{release}
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56 %define dracutlibdir %{_prefix}/lib/dracut
59 ZFS is an advanced file system and volume manager which was originally
60 developed for Solaris and is now maintained by the Illumos community.
62 ZFS on Linux, which is also known as ZoL, is currently feature
63 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
66 %description -l pl.UTF-8
67 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
68 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
70 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
71 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
75 Summary: ZFS on Linux libraries
76 Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
79 Requires(post,postun): /sbin/ldconfig
82 ZFS on Linux libraries.
84 %description libs -l pl.UTF-8
85 Biblioteki ZFS-a dla Linuksa.
88 Summary: Header files for ZFS libraries
89 Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
91 Group: Development/Libraries
92 Requires: %{pname}-libs = %{version}-%{release}
93 Requires: libselinux-devel
94 Requires: libuuid-devel
98 Header files for ZFS libraries.
100 %description devel -l pl.UTF-8
101 Pliki nagłówkowe bibliotek ZFS-a.
104 Summary: Static ZFS libraries
105 Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
107 Group: Development/Libraries
108 Requires: %{pname}-devel = %{version}-%{release}
111 Static ZFS libraries.
113 %description static -l pl.UTF-8
114 Statyczne biblioteki ZFS-a.
116 %package -n dracut-zfs
117 Summary: ZFS support for Dracut
118 Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
119 Group: Applications/System
120 Requires: %{pname} = %{version}-%{release}
123 %description -n dracut-zfs
124 ZFS support for Dracut.
126 %description -n dracut-zfs -l pl.UTF-8
127 Obsługa ZFS-a dla Dracuta.
129 %package -n kernel-zfs-common-devel
130 Summary: ZFS Linux kernel headers
131 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
132 Group: Development/Building
134 %description -n kernel-zfs-common-devel
135 ZFS Linux kernel headers common for all PLD kernel versions.
137 %description -n kernel-zfs-common-devel -l pl.UTF-8
138 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
141 %define kernel_pkg()\
142 %package -n kernel%{_alt_kernel}-zfs\
143 Summary: ZFS Linux kernel modules\
144 Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
145 Release: %{rel}@%{_kernel_ver_str}\
147 Requires(post,postun): /sbin/depmod\
148 %requires_releq_kernel\
149 Requires(postun): %releq_kernel\
151 %description -n kernel%{_alt_kernel}-zfs\
152 ZFS Linux kernel modules.\
154 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
155 ZFS - moduły jądra Linuksa.\
157 %package -n kernel%{_alt_kernel}-zfs-devel\
158 Summary: ZFS Linux kernel headers\
159 Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
160 Release: %{rel}@%{_kernel_ver_str}\
161 Group: Development/Building\
162 Requires: kernel%{_alt_kernel}-headers\
163 Requires: kernel-zfs-common-devel\
165 %description -n kernel%{_alt_kernel}-zfs-devel\
166 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
167 version %{_kernel_ver}.\
169 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
170 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
171 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
173 %files -n kernel%{_alt_kernel}-zfs\
174 %defattr(644,root,root,755)\
175 %dir /lib/modules/%{_kernel_ver}/misc/avl\
176 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
177 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
178 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
179 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
180 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
181 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
182 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
183 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
184 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
185 %dir /lib/modules/%{_kernel_ver}/misc/zpios\
186 /lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
188 %files -n kernel%{_alt_kernel}-zfs-devel\
189 %defattr(644,root,root,755)\
190 /usr/src/zfs-%{version}/%{_kernel_ver}\
192 %post -n kernel%{_alt_kernel}-zfs\
193 %depmod %{_kernel_ver}\
195 %postun -n kernel%{_alt_kernel}-zfs\
196 %depmod %{_kernel_ver}\
199 %define build_kernel_pkg()\
201 --disable-silent-rules \\\
202 --with-config="kernel" \\\
203 --with-linux=%{_kernelsrcdir}\
206 %{__make} %{?with_verbose:V=1}\
208 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
211 %{?with_kernel:%{expand:%create_kernel_packages}}
214 %setup -q -n %{pname}-%{version}
221 %{__aclocal} -I config
225 %{?with_kernel:%{expand:%build_kernel_packages}}
227 %if %{with userspace}
229 --disable-silent-rules \
230 --with-config="user" \
231 --with-linux=%{_kernelsrcdir} \
232 --with-systemdunitdir=%{systemdunitdir} \
233 --with-systemdpresetdir=/etc/systemd/system-preset \
234 --with-udevdir=/lib/udev
241 rm -rf $RPM_BUILD_ROOT
244 install -d $RPM_BUILD_ROOT
245 cp -a installed/* $RPM_BUILD_ROOT
248 %if %{with userspace}
250 DESTDIR=$RPM_BUILD_ROOT \
251 DEFAULT_INIT_DIR=/etc/rc.d/init.d
255 rm -rf $RPM_BUILD_ROOT
257 %post libs -p /sbin/ldconfig
258 %postun libs -p /sbin/ldconfig
260 %if %{with userspace}
262 %defattr(644,root,root,755)
263 %doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
264 %attr(755,root,root) /sbin/mount.zfs
265 %attr(755,root,root) %{_bindir}/arcstat.py
266 %attr(755,root,root) %{_bindir}/dbufstat.py
267 %attr(755,root,root) %{_sbindir}/fsck.zfs
268 %attr(755,root,root) %{_sbindir}/zdb
269 %attr(755,root,root) %{_sbindir}/zed
270 %attr(755,root,root) %{_sbindir}/zfs
271 %attr(755,root,root) %{_sbindir}/zhack
272 %attr(755,root,root) %{_sbindir}/zinject
273 %attr(755,root,root) %{_sbindir}/zpios
274 %attr(755,root,root) %{_sbindir}/zpool
275 %attr(755,root,root) %{_sbindir}/zstreamdump
276 %attr(755,root,root) %{_sbindir}/ztest
277 %dir %{_sysconfdir}/zfs
278 # package *.example as %doc? (they cannot act as default configuration)
279 %{_sysconfdir}/zfs/vdev_id.conf.*.example
280 %dir %{_sysconfdir}/zfs/zed.d
281 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
282 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
283 %attr(754,root,root) /etc/rc.d/init.d/zfs
284 /usr/lib/modules-load.d/zfs.conf
285 /etc/systemd/system-preset/50-zfs.preset
286 %{systemdunitdir}/zed.service
287 %{systemdunitdir}/zfs.target
288 %{systemdunitdir}/zfs-import-cache.service
289 %{systemdunitdir}/zfs-import-scan.service
290 %{systemdunitdir}/zfs-mount.service
291 %{systemdunitdir}/zfs-share.service
292 %attr(755,root,root) /lib/udev/vdev_id
293 %attr(755,root,root) /lib/udev/zvol_id
294 /lib/udev/rules.d/60-zvol.rules
295 /lib/udev/rules.d/69-vdev.rules
296 /lib/udev/rules.d/90-zfs.rules
298 %dir %{_libdir}/zfs/zed.d
299 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
301 %attr(755,root,root) %{_datadir}/zfs/*.sh
302 %dir %{_datadir}/zfs/zpios-profile
303 %attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
304 %dir %{_datadir}/zfs/zpios-test
305 %attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
306 %dir %{_datadir}/zfs/zpool-config
307 %attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
308 %{_mandir}/man1/zhack.1*
309 %{_mandir}/man1/zpios.1*
310 %{_mandir}/man1/ztest.1*
311 %{_mandir}/man5/vdev_id.conf.5*
312 %{_mandir}/man5/zfs-module-parameters.5*
313 %{_mandir}/man5/zpool-features.5*
314 %{_mandir}/man8/fsck.zfs.8*
315 %{_mandir}/man8/mount.zfs.8*
316 %{_mandir}/man8/vdev_id.8*
317 %{_mandir}/man8/zdb.8*
318 %{_mandir}/man8/zed.8*
319 %{_mandir}/man8/zfs.8*
320 %{_mandir}/man8/zinject.8*
321 %{_mandir}/man8/zpool.8*
322 %{_mandir}/man8/zstreamdump.8*
325 %defattr(644,root,root,755)
326 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
327 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
328 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
329 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
330 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
331 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
332 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
333 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
334 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
335 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
338 %defattr(644,root,root,755)
339 %attr(755,root,root) %{_libdir}/libnvpair.so
340 %attr(755,root,root) %{_libdir}/libuutil.so
341 %attr(755,root,root) %{_libdir}/libzfs.so
342 %attr(755,root,root) %{_libdir}/libzfs_core.so
343 %attr(755,root,root) %{_libdir}/libzpool.so
344 %{_libdir}/libnvpair.la
345 %{_libdir}/libuutil.la
347 %{_libdir}/libzfs_core.la
348 %{_libdir}/libzpool.la
349 %{_includedir}/libspl
350 %{_includedir}/libzfs
353 %defattr(644,root,root,755)
354 %{_libdir}/libnvpair.a
355 %{_libdir}/libuutil.a
357 %{_libdir}/libzfs_core.a
358 %{_libdir}/libzpool.a
361 %defattr(644,root,root,755)
362 %doc dracut/README.dracut.markdown
363 %dir %{dracutlibdir}/modules.d/90zfs
364 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
365 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
366 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
370 %files -n kernel-zfs-common-devel
371 %defattr(644,root,root,755)
372 %dir /usr/src/zfs-%{version}
373 /usr/src/zfs-%{version}/include
374 /usr/src/zfs-%{version}/zfs.release.in
375 /usr/src/zfs-%{version}/zfs_config.h.in