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