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