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