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