]> git.pld-linux.org Git - packages/zfs.git/blob - zfs.spec
- update to current git snapshot, rel 2
[packages/zfs.git] / zfs.spec
1 # TODO:
2 # - PLDify init script
3 # - unpackaged initramfs-tools support:
4 #   /usr/share/initramfs-tools/conf-hooks.d/zfs
5 #   /usr/share/initramfs-tools/hooks/zfs
6 #   /usr/share/initramfs-tools/scripts/zfs
7 #
8 # Conditional build:
9 %bcond_without  kernel          # don't build kernel modules
10 %bcond_without  userspace       # don't build userspace programs
11 %bcond_without  python          # CPython module
12 %bcond_with     verbose         # verbose build (V=1)
13 #
14 # The goal here is to have main, userspace, package built once with
15 # simple release number, and only rebuild kernel packages with kernel
16 # version as part of release number, without the need to bump release
17 # with every kernel change.
18 %if 0%{?_pld_builder:1} && %{with kernel} && %{with userspace}
19 %{error:kernel and userspace cannot be built at the same time on PLD builders}
20 exit 1
21 %endif
22
23 %if %{without userspace}
24 # nothing to be placed to debuginfo package
25 %define         _enable_debug_packages  0
26 %endif
27
28 %define         _duplicate_files_terminate_build        0
29
30 %define rel     2
31 %define pname   zfs
32 Summary:        Native Linux port of the ZFS filesystem
33 Summary(pl.UTF-8):      Natywny linuksowy port systemu plików ZFS
34 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
35 %define gitrev  1511_g4338c5c06
36 Version:        0.7.9
37 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
38 License:        CDDL
39 Group:          Applications/System
40 #Source0:       https://github.com/zfsonlinux/zfs/releases/download/zfs-%{version}/%{pname}-%{version}.tar.gz
41 Source0:        %{pname}-%{version}-%{gitrev}.tar.gz
42 # Source0-md5:  ceb367d302942e2291f1ad86c1e0d2be
43 Patch0:         x32.patch
44 Patch1:         am.patch
45 URL:            http://zfsonlinux.org/
46 BuildRequires:  autoconf >= 2.50
47 BuildRequires:  automake
48 BuildRequires:  libtool
49 BuildRequires:  rpmbuild(macros) >= 1.714
50 %if %{with kernel}
51 %{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
52 %endif
53 %if %{with userspace}
54 BuildRequires:  libblkid-devel
55 BuildRequires:  libselinux-devel
56 BuildRequires:  libuuid-devel
57 BuildRequires:  zlib-devel
58 %if %{with python}
59 BuildRequires:  rpm-pythonprov
60 BuildRequires:  python-modules
61 BuildRequires:  python-setuptools
62 %endif
63 %endif
64 Requires:       %{pname}-libs = %{version}-%{release}
65 Obsoletes:      spl < 0.7.9-2
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67
68 %define         dracutlibdir    %{_prefix}/lib/dracut
69
70 %description
71 ZFS is an advanced file system and volume manager which was originally
72 developed for Solaris and is now maintained by the Illumos community.
73
74 ZFS on Linux, which is also known as ZoL, is currently feature
75 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
76 ZPL layers.
77
78 %description -l pl.UTF-8
79 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
80 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
81
82 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
83 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
84 SPA, DMU, ZVOL i ZPL.
85
86 %package libs
87 Summary:        ZFS on Linux libraries
88 Summary(pl.UTF-8):      Biblioteki ZFS-a dla Linuksa
89 License:        CDDL
90 Group:          Libraries
91 Requires(post,postun):  /sbin/ldconfig
92
93 %description libs
94 ZFS on Linux libraries.
95
96 %description libs -l pl.UTF-8
97 Biblioteki ZFS-a dla Linuksa.
98
99 %package devel
100 Summary:        Header files for ZFS libraries
101 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek ZFS-a
102 License:        CDDL
103 Group:          Development/Libraries
104 Requires:       %{pname}-libs = %{version}-%{release}
105 Requires:       libselinux-devel
106 Requires:       libuuid-devel
107 Requires:       zlib-devel
108
109 %description devel
110 Header files for ZFS libraries.
111
112 %description devel -l pl.UTF-8
113 Pliki nagłówkowe bibliotek ZFS-a.
114
115 %package static
116 Summary:        Static ZFS libraries
117 Summary(pl.UTF-8):      Statyczne biblioteki ZFS-a
118 License:        CDDL
119 Group:          Development/Libraries
120 Requires:       %{pname}-devel = %{version}-%{release}
121
122 %description static
123 Static ZFS libraries.
124
125 %description static -l pl.UTF-8
126 Statyczne biblioteki ZFS-a.
127
128 %package -n dracut-zfs
129 Summary:        ZFS support for Dracut
130 Summary(pl.UTF-8):      Obsługa ZFS-a dla Dracuta
131 Group:          Applications/System
132 Requires:       %{pname} = %{version}-%{release}
133 Requires:       dracut
134
135 %description -n dracut-zfs
136 ZFS support for Dracut.
137
138 %description -n dracut-zfs -l pl.UTF-8
139 Obsługa ZFS-a dla Dracuta.
140
141 %package -n python-pyzfs
142 Summary:        Wrapper for libzfs_core C library
143 License:        Apache v2.0
144 Group:          Libraries/Python
145 Requires:       %{pname}-libs = %{version}-%{release}
146
147 %description -n python-pyzfs
148 Wrapper for libzfs_core C library.
149
150 %package -n kernel-zfs-common-devel
151 Summary:        ZFS Linux kernel headers
152 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa
153 Group:          Development/Building
154 Obsoletes:      kernel-spl-common-devel < 0.7.9-2
155
156 %description -n kernel-zfs-common-devel
157 ZFS Linux kernel headers common for all PLD kernel versions.
158
159 %description -n kernel-zfs-common-devel -l pl.UTF-8
160 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
161 wersji jąder PLD.
162
163 %define kernel_pkg()\
164 %package -n kernel%{_alt_kernel}-zfs\
165 Summary:        ZFS Linux kernel modules\
166 Summary(pl.UTF-8):      ZFS - moduły jądra Linuksa\
167 Release:        %{rel}@%{_kernel_ver_str}\
168 Group:          Base/Kernel\
169 Requires(post,postun):  /sbin/depmod\
170 %requires_releq_kernel\
171 Requires(postun):       %releq_kernel\
172 \
173 %description -n kernel%{_alt_kernel}-zfs\
174 ZFS Linux kernel modules.\
175 \
176 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
177 ZFS - moduły jądra Linuksa.\
178 \
179 %package -n kernel%{_alt_kernel}-zfs-devel\
180 Summary:        ZFS Linux kernel headers\
181 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa\
182 Release:        %{rel}@%{_kernel_ver_str}\
183 Group:          Development/Building\
184 Requires:       kernel%{_alt_kernel}-headers\
185 Requires:       kernel-zfs-common-devel\
186 Obsoletes:      kernel-spl-devel < 0.7.9-2\
187 \
188 %description -n kernel%{_alt_kernel}-zfs-devel\
189 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
190 version %{_kernel_ver}.\
191 \
192 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
193 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
194 pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
195 \
196 %files -n kernel%{_alt_kernel}-zfs\
197 %defattr(644,root,root,755)\
198 %dir /lib/modules/%{_kernel_ver}/misc/lua\
199 /lib/modules/%{_kernel_ver}/misc/lua/zlua.ko*\
200 %dir /lib/modules/%{_kernel_ver}/misc/avl\
201 /lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
202 %dir /lib/modules/%{_kernel_ver}/misc/icp\
203 /lib/modules/%{_kernel_ver}/misc/icp/icp.ko*\
204 %dir /lib/modules/%{_kernel_ver}/misc/nvpair\
205 /lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
206 %dir /lib/modules/%{_kernel_ver}/misc/spl\
207 /lib/modules/%{_kernel_ver}/misc/spl/spl.ko*\
208 %dir /lib/modules/%{_kernel_ver}/misc/unicode\
209 /lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
210 %dir /lib/modules/%{_kernel_ver}/misc/zcommon\
211 /lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
212 %dir /lib/modules/%{_kernel_ver}/misc/zfs\
213 /lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
214 \
215 %files -n kernel%{_alt_kernel}-zfs-devel\
216 %defattr(644,root,root,755)\
217 /usr/src/spl-%{version}/%{_kernel_ver}\
218 /usr/src/zfs-%{version}/%{_kernel_ver}\
219 \
220 %post   -n kernel%{_alt_kernel}-zfs\
221 %depmod %{_kernel_ver}\
222 \
223 %postun -n kernel%{_alt_kernel}-zfs\
224 %depmod %{_kernel_ver}\
225 %{nil}
226
227 %define build_kernel_pkg()\
228 %configure \\\
229         --disable-silent-rules \\\
230         --with-config="kernel" \\\
231         --with-linux=%{_kernelsrcdir}\\\
232         --with-linux-obj=%{_kernelsrcdir}\
233 \
234 %{__make} clean\
235 %{__make} %{?with_verbose:V=1}\
236 p=`pwd`\
237 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
238 %{nil}
239
240 %{?with_kernel:%{expand:%create_kernel_packages}}
241
242 %prep
243 %setup -q -n %{pname}-%{version}
244 %patch0 -p1
245 %patch1 -p1
246
247 %build
248 %{__libtoolize}
249 %{__aclocal} -I config
250 %{__autoconf}
251 %{__autoheader}
252 %{__automake}
253 %{?with_kernel:%{expand:%build_kernel_packages}}
254
255 %if %{with userspace}
256 %configure \
257         --disable-silent-rules \
258         --with-config="user" \
259         --with-linux=%{_kernelsrcdir} \
260         --with-systemdunitdir=%{systemdunitdir} \
261         --with-systemdpresetdir=/etc/systemd/system-preset \
262         --with-udevdir=/lib/udev
263
264 %{__make} \
265         %{?with_verbose:V=1}
266
267 %if %{with python}
268 cd contrib/pyzfs
269 %py_build %{?with_tests:test}
270 cd ../..
271 %endif
272 %endif
273
274 %install
275 rm -rf $RPM_BUILD_ROOT
276
277 %if %{with kernel}
278 install -d $RPM_BUILD_ROOT
279 cp -a installed/* $RPM_BUILD_ROOT
280 %endif
281
282 %if %{with userspace}
283 %{__make} install \
284         DESTDIR=$RPM_BUILD_ROOT \
285         DEFAULT_INIT_DIR=/etc/rc.d/init.d
286
287 %if %{with python}
288 %{__rm} -rf $RPM_BUILD_ROOT%{py_sitescriptdir}
289 cd contrib/pyzfs
290 %py_install
291
292 %py_ocomp $RPM_BUILD_ROOT%{py_sitescriptdir}
293 %py_comp $RPM_BUILD_ROOT%{py_sitescriptdir}
294
295 %py_postclean
296 cd ../..
297 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/libzfs_core/test
298 %endif
299
300 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
301 %{__mv} $RPM_BUILD_ROOT%{_npkgconfigdir}/* $RPM_BUILD_ROOT%{_pkgconfigdir}
302
303 # Debian specific stuff
304 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/initramfs-tools
305
306 # Package these? These are integration tests of the implementation.
307 %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/zfs/{zfs-tests,test-runner,runfiles}
308 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{raidz_test,test-runner}.1*
309 %{__rm} $RPM_BUILD_ROOT%{_bindir}/raidz_test
310 %endif
311
312 %clean
313 rm -rf $RPM_BUILD_ROOT
314
315 %post   libs -p /sbin/ldconfig
316 %postun libs -p /sbin/ldconfig
317
318 %if %{with userspace}
319 %files
320 %defattr(644,root,root,755)
321 %doc AUTHORS COPYRIGHT LICENSE README.md
322 %attr(755,root,root) /sbin/mount.zfs
323 %attr(755,root,root) %{_bindir}/arc_summary.py
324 %attr(755,root,root) %{_bindir}/arcstat.py
325 %attr(755,root,root) %{_bindir}/dbufstat.py
326 %attr(755,root,root) %{_bindir}/zgenhostid
327 %attr(755,root,root) %{_sbindir}/fsck.zfs
328 %attr(755,root,root) %{_sbindir}/zdb
329 %attr(755,root,root) %{_sbindir}/zed
330 %attr(755,root,root) %{_sbindir}/zfs
331 %attr(755,root,root) %{_sbindir}/zhack
332 %attr(755,root,root) %{_sbindir}/zinject
333 %attr(755,root,root) %{_sbindir}/zpool
334 %attr(755,root,root) %{_sbindir}/zstreamdump
335 %attr(755,root,root) %{_sbindir}/ztest
336 %dir %{_sysconfdir}/zfs
337 # package *.example as %doc? (they cannot act as default configuration)
338 %{_sysconfdir}/zfs/vdev_id.conf.*.example
339 %dir %{_sysconfdir}/zfs/zed.d
340 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
341 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
342 %dir %{_sysconfdir}/zfs/zpool.d
343 %attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zpool.d/*
344 %attr(754,root,root) /etc/rc.d/init.d/zfs-import
345 %attr(754,root,root) /etc/rc.d/init.d/zfs-mount
346 %attr(754,root,root) /etc/rc.d/init.d/zfs-share
347 %attr(754,root,root) /etc/rc.d/init.d/zfs-zed
348 %config(noreplace) %verify(not md5 mtime size) /etc/default/zfs
349 /etc/zfs/zfs-functions
350 /usr/lib/modules-load.d/zfs.conf
351 /etc/systemd/system-preset/50-zfs.preset
352 /usr/lib/systemd/system-generators/zfs-mount-generator
353 %{systemdunitdir}/zfs.target
354 %{systemdunitdir}/zfs-import.target
355 %{systemdunitdir}/zfs-import-cache.service
356 %{systemdunitdir}/zfs-import-scan.service
357 %{systemdunitdir}/zfs-mount.service
358 %{systemdunitdir}/zfs-share.service
359 %{systemdunitdir}/zfs-zed.service
360 %attr(755,root,root) /lib/udev/vdev_id
361 %attr(755,root,root) /lib/udev/zvol_id
362 /lib/udev/rules.d/60-zvol.rules
363 /lib/udev/rules.d/69-vdev.rules
364 /lib/udev/rules.d/90-zfs.rules
365 %dir %{_libexecdir}/zfs
366 %dir %{_libexecdir}/zfs/zed.d
367 %attr(755,root,root) %{_libexecdir}/zfs/zed.d/*.sh
368 %dir %{_libexecdir}/zfs/zpool.d
369 %attr(755,root,root) %{_libexecdir}/zfs/zpool.d/*
370 %dir %{_datadir}/zfs
371 %attr(755,root,root) %{_datadir}/zfs/*.sh
372 %{_mandir}/man1/zhack.1*
373 %{_mandir}/man1/ztest.1*
374 %{_mandir}/man5/spl-module-parameters.5*
375 %{_mandir}/man5/vdev_id.conf.5*
376 %{_mandir}/man5/zfs-events.5*
377 %{_mandir}/man5/zfs-module-parameters.5*
378 %{_mandir}/man5/zpool-features.5*
379 %{_mandir}/man8/fsck.zfs.8*
380 %{_mandir}/man8/mount.zfs.8*
381 %{_mandir}/man8/vdev_id.8*
382 %{_mandir}/man8/zdb.8*
383 %{_mandir}/man8/zed.8*
384 %{_mandir}/man8/zfs.8*
385 %{_mandir}/man8/zfs-mount-generator.8*
386 %{_mandir}/man8/zfs-program.8*
387 %{_mandir}/man8/zgenhostid.8*
388 %{_mandir}/man8/zinject.8*
389 %{_mandir}/man8/zpool.8*
390 %{_mandir}/man8/zstreamdump.8*
391
392 %files libs
393 %defattr(644,root,root,755)
394 %attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
395 %attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
396 %attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
397 %attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
398 %attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
399 %attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
400 %attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
401 %attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
402 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
403 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
404
405 %files devel
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_libdir}/libnvpair.so
408 %attr(755,root,root) %{_libdir}/libuutil.so
409 %attr(755,root,root) %{_libdir}/libzfs.so
410 %attr(755,root,root) %{_libdir}/libzfs_core.so
411 %attr(755,root,root) %{_libdir}/libzpool.so
412 %{_libdir}/libnvpair.la
413 %{_libdir}/libuutil.la
414 %{_libdir}/libzfs.la
415 %{_libdir}/libzfs_core.la
416 %{_libdir}/libzpool.la
417 %{_includedir}/libspl
418 %{_includedir}/libzfs
419 %{_pkgconfigdir}/libzfs.pc
420 %{_pkgconfigdir}/libzfs_core.pc
421
422 %files static
423 %defattr(644,root,root,755)
424 %{_libdir}/libnvpair.a
425 %{_libdir}/libuutil.a
426 %{_libdir}/libzfs.a
427 %{_libdir}/libzfs_core.a
428 %{_libdir}/libzpool.a
429
430 %files -n dracut-zfs
431 %defattr(644,root,root,755)
432 %doc contrib/dracut/README.dracut.markdown
433 %dir %{dracutlibdir}/modules.d/02zfsexpandknowledge
434 %attr(755,root,root) %{dracutlibdir}/modules.d/02zfsexpandknowledge/module-setup.sh
435 %dir %{dracutlibdir}/modules.d/90zfs
436 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/export-zfs.sh
437 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
438 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
439 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
440 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-generator.sh
441 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-lib.sh
442 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-load-key.sh
443 %attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/zfs-needshutdown.sh
444
445 %if %{with python}
446 %files -n python-pyzfs
447 %defattr(644,root,root,755)
448 %doc contrib/pyzfs/README
449 %{py_sitescriptdir}/libzfs_core
450 %{py_sitescriptdir}/pyzfs-*-py*.egg-info
451 %endif
452 %endif
453
454 %if %{with kernel}
455 %files -n kernel-zfs-common-devel
456 %defattr(644,root,root,755)
457 %dir /usr/src/zfs-%{version}
458 /usr/src/zfs-%{version}/include
459 /usr/src/zfs-%{version}/zfs.release
460 /usr/src/zfs-%{version}/zfs_config.h
461 %dir /usr/src/spl-%{version}
462 /usr/src/spl-%{version}/include
463 /usr/src/spl-%{version}/spl.release
464 /usr/src/spl-%{version}/spl_config.h
465 %endif
This page took 0.126718 seconds and 4 git commands to generate.