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