- drop non-dist kernel support
[packages/zfs.git] / zfs.spec
CommitLineData
bff0a8a1
JB
1# TODO: PLDify init script
2#
3# Conditional build:
bff0a8a1
JB
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)
7#
3921af7f
JR
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}
14exit 1
15%endif
16
bff0a8a1 17%if "%{_alt_kernel}" != "%{nil}"
3921af7f
JR
18%if 0%{?build_kernels:1}
19%{error:alt_kernel and build_kernels are mutually exclusive}
20exit 1
21%endif
bff0a8a1 22%undefine with_userspace
3921af7f
JR
23%global _build_kernels %{alt_kernel}
24%else
25%global _build_kernels %{?build_kernels:,%{?build_kernels}}
bff0a8a1 26%endif
3921af7f 27
bff0a8a1
JB
28%if %{without userspace}
29# nothing to be placed to debuginfo package
30%define _enable_debug_packages 0
31%endif
3921af7f
JR
32
33%define _duplicate_files_terminate_build 0
34
aa3d3945 35%define kbrs %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo "BuildRequires:kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2,kernel%%{_alt_kernel}-spl-devel >= 0.6.3" ; done)
3921af7f
JR
36%define kpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%kernel_pkg ; done)
37%define bkpkg %(echo %{_build_kernels} | tr , '\\n' | while read n ; do echo %%undefine alt_kernel ; [ -z "$n" ] || echo %%define alt_kernel $n ; echo %%build_kernel_pkg ; done)
38
39%define pname zfs
97d46215 40%define rel 4
bff0a8a1
JB
41Summary: Native Linux port of the ZFS filesystem
42Summary(pl.UTF-8): Natywny linuksowy port systemu plików ZFS
3921af7f 43Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
ec61a23e 44Version: 0.6.3
3921af7f 45Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
bff0a8a1
JB
46License: CDDL (ZFS), GPL v2+ (ZPIOS)
47Group: Applications/System
48Source0: http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz
ec61a23e 49# Source0-md5: 5bcc32c122934d421eba68e16826637d
3921af7f 50Patch0: %{pname}-link.patch
97d46215 51Patch1: linux-3.18.patch
bff0a8a1
JB
52URL: http://zfsonlinux.org/
53BuildRequires: autoconf >= 2.50
54BuildRequires: automake
55BuildRequires: libtool
1b58aab1
JR
56BuildRequires: rpmbuild(macros) >= 1.701
57%{?with_kernel:%{expand:%kbrs}}
bff0a8a1
JB
58%if %{with userspace}
59BuildRequires: libblkid-devel
60BuildRequires: libselinux-devel
61BuildRequires: libuuid-devel
62BuildRequires: zlib-devel
63%endif
64Requires: %{pname}-libs = %{version}-%{release}
65BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
8fa57ce6
JP
67%define dracutlibdir %{_prefix}/lib/dracut
68
bff0a8a1
JB
69%description
70ZFS is an advanced file system and volume manager which was originally
71developed for Solaris and is now maintained by the Illumos community.
72
73ZFS on Linux, which is also known as ZoL, is currently feature
74complete. It includes fully functional and stable SPA, DMU, ZVOL, and
75ZPL layers.
76
77%description -l pl.UTF-8
78ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
79stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
80
81ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
82pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
83SPA, DMU, ZVOL i ZPL.
84
85%package libs
86Summary: ZFS on Linux libraries
87Summary(pl.UTF-8): Biblioteki ZFS-a dla Linuksa
88License: CDDL
89Group: Libraries
8fa57ce6 90Requires(post,postun): /sbin/ldconfig
bff0a8a1
JB
91
92%description libs
93ZFS on Linux libraries.
94
95%description libs -l pl.UTF-8
96Biblioteki ZFS-a dla Linuksa.
97
98%package devel
99Summary: Header files for ZFS libraries
100Summary(pl.UTF-8): Pliki nagłówkowe bibliotek ZFS-a
101License: CDDL
102Group: Development/Libraries
103Requires: %{pname}-libs = %{version}-%{release}
104Requires: libselinux-devel
105Requires: libuuid-devel
106Requires: zlib-devel
107
108%description devel
109Header files for ZFS libraries.
110
111%description devel -l pl.UTF-8
112Pliki nagłówkowe bibliotek ZFS-a.
113
114%package static
115Summary: Static ZFS libraries
116Summary(pl.UTF-8): Statyczne biblioteki ZFS-a
117License: CDDL
118Group: Development/Libraries
119Requires: %{pname}-devel = %{version}-%{release}
120
121%description static
122Static ZFS libraries.
123
124%description static -l pl.UTF-8
125Statyczne biblioteki ZFS-a.
126
127%package -n dracut-zfs
128Summary: ZFS support for Dracut
129Summary(pl.UTF-8): Obsługa ZFS-a dla Dracuta
130Group: Applications/System
131Requires: %{pname} = %{version}-%{release}
132Requires: dracut
133
134%description -n dracut-zfs
135ZFS support for Dracut.
136
137%description -n dracut-zfs -l pl.UTF-8
138Obsługa ZFS-a dla Dracuta.
139
3921af7f 140%package -n kernel-zfs-common-devel
bff0a8a1
JB
141Summary: ZFS Linux kernel headers
142Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa
bff0a8a1 143Group: Development/Building
bff0a8a1 144
3921af7f
JR
145%description -n kernel-zfs-common-devel
146ZFS Linux kernel headers common for all PLD kernel versions.
147
148%description -n kernel-zfs-common-devel -l pl.UTF-8
149ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
150wersji jąder PLD.
151
152%define kernel_pkg()\
153%package -n kernel%{_alt_kernel}-zfs\
154Summary: ZFS Linux kernel modules\
155Summary(pl.UTF-8): ZFS - moduły jądra Linuksa\
156Release: %{rel}@%{_kernel_ver_str}\
157Group: Base/Kernel\
158Requires(post,postun): /sbin/depmod\
3921af7f
JR
159%requires_releq_kernel\
160Requires(postun): %releq_kernel\
3921af7f
JR
161\
162%description -n kernel%{_alt_kernel}-zfs\
163ZFS Linux kernel modules.\
164\
165%description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
166ZFS - moduły jądra Linuksa.\
167\
168%package -n kernel%{_alt_kernel}-zfs-devel\
169Summary: ZFS Linux kernel headers\
170Summary(pl.UTF-8): ZFS - pliki nagłówkowe jądra Linuksa\
171Release: %{rel}@%{_kernel_ver_str}\
172Group: Development/Building\
3921af7f
JR
173Requires: kernel%{_alt_kernel}-headers\
174Requires: kernel-zfs-common-devel\
3921af7f
JR
175\
176%description -n kernel%{_alt_kernel}-zfs-devel\
177ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
178version %{_kernel_ver}.\
179\
180%description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
181ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
182pakietu kernel%{_alt_kernel} w wersji %{_kernel_ver}.\
183\
184%files -n kernel%{_alt_kernel}-zfs\
185%defattr(644,root,root,755)\
186%dir /lib/modules/%{_kernel_ver}/misc/avl\
187/lib/modules/%{_kernel_ver}/misc/avl/zavl.ko*\
188%dir /lib/modules/%{_kernel_ver}/misc/nvpair\
189/lib/modules/%{_kernel_ver}/misc/nvpair/znvpair.ko*\
190%dir /lib/modules/%{_kernel_ver}/misc/unicode\
191/lib/modules/%{_kernel_ver}/misc/unicode/zunicode.ko*\
192%dir /lib/modules/%{_kernel_ver}/misc/zcommon\
193/lib/modules/%{_kernel_ver}/misc/zcommon/zcommon.ko*\
194%dir /lib/modules/%{_kernel_ver}/misc/zfs\
195/lib/modules/%{_kernel_ver}/misc/zfs/zfs.ko*\
196%dir /lib/modules/%{_kernel_ver}/misc/zpios\
197/lib/modules/%{_kernel_ver}/misc/zpios/zpios.ko*\
198\
199%files -n kernel%{_alt_kernel}-zfs-devel\
200%defattr(644,root,root,755)\
201/usr/src/zfs-%{version}/%{_kernel_ver}\
202\
203%post -n kernel%{_alt_kernel}-zfs\
204%depmod %{_kernel_ver}\
205\
206%postun -n kernel%{_alt_kernel}-zfs\
207%depmod %{_kernel_ver}\
208%{nil}
209
210%define build_kernel_pkg()\
211%configure \\\
212 --disable-silent-rules \\\
213 --with-config="kernel" \\\
214 --with-linux=%{_kernelsrcdir}\
215\
216%{__make} clean\
217%{__make} %{?with_verbose:V=1}\
218p=`pwd`\
219%{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
220%{nil}
221
222%{?with_kernel:%{expand:%kpkg}}
bff0a8a1
JB
223
224%prep
3921af7f 225%setup -q -n %{pname}-%{version}
bff0a8a1 226%patch0 -p1
97d46215 227%patch1 -p1
bff0a8a1
JB
228
229%build
230%{__libtoolize}
231%{__aclocal} -I config
232%{__autoconf}
233%{__autoheader}
234%{__automake}
3921af7f
JR
235%{?with_kernel:%{expand:%bkpkg}}
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
JR
261 DEFAULT_INIT_DIR=/etc/rc.d/init.d
262%endif
bff0a8a1
JB
263
264%clean
265rm -rf $RPM_BUILD_ROOT
266
8fa57ce6
JP
267%post libs -p /sbin/ldconfig
268%postun libs -p /sbin/ldconfig
269
bff0a8a1
JB
270%if %{with userspace}
271%files
272%defattr(644,root,root,755)
273%doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
274%attr(755,root,root) /sbin/mount.zfs
275%attr(755,root,root) %{_bindir}/arcstat.py
ec61a23e 276%attr(755,root,root) %{_bindir}/dbufstat.py
bff0a8a1
JB
277%attr(755,root,root) %{_sbindir}/fsck.zfs
278%attr(755,root,root) %{_sbindir}/zdb
ec61a23e 279%attr(755,root,root) %{_sbindir}/zed
bff0a8a1
JB
280%attr(755,root,root) %{_sbindir}/zfs
281%attr(755,root,root) %{_sbindir}/zhack
282%attr(755,root,root) %{_sbindir}/zinject
283%attr(755,root,root) %{_sbindir}/zpios
284%attr(755,root,root) %{_sbindir}/zpool
285%attr(755,root,root) %{_sbindir}/zstreamdump
286%attr(755,root,root) %{_sbindir}/ztest
287%dir %{_sysconfdir}/zfs
288# package *.example as %doc? (they cannot act as default configuration)
289%{_sysconfdir}/zfs/vdev_id.conf.*.example
ec61a23e
JB
290%dir %{_sysconfdir}/zfs/zed.d
291%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
292%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
bff0a8a1 293%attr(754,root,root) /etc/rc.d/init.d/zfs
ec61a23e
JB
294/usr/lib/modules-load.d/zfs.conf
295/etc/systemd/system-preset/50-zfs.preset
296%{systemdunitdir}/zed.service
297%{systemdunitdir}/zfs.target
298%{systemdunitdir}/zfs-import-cache.service
299%{systemdunitdir}/zfs-import-scan.service
300%{systemdunitdir}/zfs-mount.service
301%{systemdunitdir}/zfs-share.service
bff0a8a1
JB
302%attr(755,root,root) /lib/udev/vdev_id
303%attr(755,root,root) /lib/udev/zvol_id
304/lib/udev/rules.d/60-zvol.rules
305/lib/udev/rules.d/69-vdev.rules
306/lib/udev/rules.d/90-zfs.rules
ec61a23e
JB
307%dir %{_libdir}/zfs
308%dir %{_libdir}/zfs/zed.d
309%attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
bff0a8a1
JB
310%dir %{_datadir}/zfs
311%attr(755,root,root) %{_datadir}/zfs/*.sh
312%dir %{_datadir}/zfs/zpios-profile
313%attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
314%dir %{_datadir}/zfs/zpios-test
315%attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
316%dir %{_datadir}/zfs/zpool-config
317%attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
318%{_mandir}/man1/zhack.1*
319%{_mandir}/man1/zpios.1*
320%{_mandir}/man1/ztest.1*
321%{_mandir}/man5/vdev_id.conf.5*
ec61a23e 322%{_mandir}/man5/zfs-module-parameters.5*
bff0a8a1
JB
323%{_mandir}/man5/zpool-features.5*
324%{_mandir}/man8/fsck.zfs.8*
325%{_mandir}/man8/mount.zfs.8*
326%{_mandir}/man8/vdev_id.8*
327%{_mandir}/man8/zdb.8*
ec61a23e 328%{_mandir}/man8/zed.8*
bff0a8a1
JB
329%{_mandir}/man8/zfs.8*
330%{_mandir}/man8/zinject.8*
331%{_mandir}/man8/zpool.8*
332%{_mandir}/man8/zstreamdump.8*
333
334%files libs
335%defattr(644,root,root,755)
336%attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
337%attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
338%attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
339%attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
340%attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
ec61a23e
JB
341%attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
342%attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
343%attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
bff0a8a1 344%attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
ec61a23e 345%attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
bff0a8a1
JB
346
347%files devel
348%defattr(644,root,root,755)
349%attr(755,root,root) %{_libdir}/libnvpair.so
350%attr(755,root,root) %{_libdir}/libuutil.so
351%attr(755,root,root) %{_libdir}/libzfs.so
ec61a23e 352%attr(755,root,root) %{_libdir}/libzfs_core.so
bff0a8a1
JB
353%attr(755,root,root) %{_libdir}/libzpool.so
354%{_libdir}/libnvpair.la
355%{_libdir}/libuutil.la
356%{_libdir}/libzfs.la
ec61a23e 357%{_libdir}/libzfs_core.la
bff0a8a1
JB
358%{_libdir}/libzpool.la
359%{_includedir}/libspl
360%{_includedir}/libzfs
361
362%files static
363%defattr(644,root,root,755)
364%{_libdir}/libnvpair.a
365%{_libdir}/libuutil.a
366%{_libdir}/libzfs.a
ec61a23e 367%{_libdir}/libzfs_core.a
bff0a8a1
JB
368%{_libdir}/libzpool.a
369
370%files -n dracut-zfs
371%defattr(644,root,root,755)
372%doc dracut/README.dracut.markdown
8fa57ce6
JP
373%dir %{dracutlibdir}/modules.d/90zfs
374%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
375%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
376%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
bff0a8a1
JB
377%endif
378
379%if %{with kernel}
3921af7f 380%files -n kernel-zfs-common-devel
bff0a8a1 381%defattr(644,root,root,755)
e11b2ec8 382%dir /usr/src/zfs-%{version}
3921af7f
JR
383/usr/src/zfs-%{version}/include
384/usr/src/zfs-%{version}/zfs.release.in
385/usr/src/zfs-%{version}/zfs_config.h.in
bff0a8a1 386%endif
This page took 0.192712 seconds and 4 git commands to generate.