]> git.pld-linux.org Git - packages/zfs.git/blame - zfs.spec
- fix broken build
[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
97d46215 45%define rel 4
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
97d46215 56Patch1: linux-3.18.patch
bff0a8a1
JB
57URL: http://zfsonlinux.org/
58BuildRequires: autoconf >= 2.50
59BuildRequires: automake
60BuildRequires: libtool
61%if %{with kernel}
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 237%patch0 -p1
97d46215 238%patch1 -p1
bff0a8a1
JB
239
240%build
241%{__libtoolize}
242%{__aclocal} -I config
243%{__autoconf}
244%{__autoheader}
245%{__automake}
3921af7f
JR
246%{?with_kernel:%{expand:%bkpkg}}
247
248%if %{with userspace}
bff0a8a1
JB
249%configure \
250 --disable-silent-rules \
3921af7f 251 --with-config="user" \
bff0a8a1 252 --with-linux=%{_kernelsrcdir} \
ec61a23e
JB
253 --with-systemdunitdir=%{systemdunitdir} \
254 --with-systemdpresetdir=/etc/systemd/system-preset \
bff0a8a1
JB
255 --with-udevdir=/lib/udev
256
257%{__make} \
258 %{?with_verbose:V=1}
3921af7f 259%endif
bff0a8a1
JB
260
261%install
262rm -rf $RPM_BUILD_ROOT
263
3921af7f
JR
264%if %{with kernel}
265install -d $RPM_BUILD_ROOT
266cp -a installed/* $RPM_BUILD_ROOT
267%endif
268
269%if %{with userspace}
bff0a8a1
JB
270%{__make} install \
271 DESTDIR=$RPM_BUILD_ROOT \
3921af7f
JR
272 DEFAULT_INIT_DIR=/etc/rc.d/init.d
273%endif
bff0a8a1
JB
274
275%clean
276rm -rf $RPM_BUILD_ROOT
277
8fa57ce6
JP
278%post libs -p /sbin/ldconfig
279%postun libs -p /sbin/ldconfig
280
bff0a8a1
JB
281%if %{with userspace}
282%files
283%defattr(644,root,root,755)
284%doc AUTHORS COPYRIGHT DISCLAIMER OPENSOLARIS.LICENSE README.markdown
285%attr(755,root,root) /sbin/mount.zfs
286%attr(755,root,root) %{_bindir}/arcstat.py
ec61a23e 287%attr(755,root,root) %{_bindir}/dbufstat.py
bff0a8a1
JB
288%attr(755,root,root) %{_sbindir}/fsck.zfs
289%attr(755,root,root) %{_sbindir}/zdb
ec61a23e 290%attr(755,root,root) %{_sbindir}/zed
bff0a8a1
JB
291%attr(755,root,root) %{_sbindir}/zfs
292%attr(755,root,root) %{_sbindir}/zhack
293%attr(755,root,root) %{_sbindir}/zinject
294%attr(755,root,root) %{_sbindir}/zpios
295%attr(755,root,root) %{_sbindir}/zpool
296%attr(755,root,root) %{_sbindir}/zstreamdump
297%attr(755,root,root) %{_sbindir}/ztest
298%dir %{_sysconfdir}/zfs
299# package *.example as %doc? (they cannot act as default configuration)
300%{_sysconfdir}/zfs/vdev_id.conf.*.example
ec61a23e
JB
301%dir %{_sysconfdir}/zfs/zed.d
302%attr(755,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/*.sh
303%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/zfs/zed.d/zed.rc
bff0a8a1 304%attr(754,root,root) /etc/rc.d/init.d/zfs
ec61a23e
JB
305/usr/lib/modules-load.d/zfs.conf
306/etc/systemd/system-preset/50-zfs.preset
307%{systemdunitdir}/zed.service
308%{systemdunitdir}/zfs.target
309%{systemdunitdir}/zfs-import-cache.service
310%{systemdunitdir}/zfs-import-scan.service
311%{systemdunitdir}/zfs-mount.service
312%{systemdunitdir}/zfs-share.service
bff0a8a1
JB
313%attr(755,root,root) /lib/udev/vdev_id
314%attr(755,root,root) /lib/udev/zvol_id
315/lib/udev/rules.d/60-zvol.rules
316/lib/udev/rules.d/69-vdev.rules
317/lib/udev/rules.d/90-zfs.rules
ec61a23e
JB
318%dir %{_libdir}/zfs
319%dir %{_libdir}/zfs/zed.d
320%attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
bff0a8a1
JB
321%dir %{_datadir}/zfs
322%attr(755,root,root) %{_datadir}/zfs/*.sh
323%dir %{_datadir}/zfs/zpios-profile
324%attr(755,root,root) %{_datadir}/zfs/zpios-profile/*.sh
325%dir %{_datadir}/zfs/zpios-test
326%attr(755,root,root) %{_datadir}/zfs/zpios-test/*.sh
327%dir %{_datadir}/zfs/zpool-config
328%attr(755,root,root) %{_datadir}/zfs/zpool-config/*.sh
329%{_mandir}/man1/zhack.1*
330%{_mandir}/man1/zpios.1*
331%{_mandir}/man1/ztest.1*
332%{_mandir}/man5/vdev_id.conf.5*
ec61a23e 333%{_mandir}/man5/zfs-module-parameters.5*
bff0a8a1
JB
334%{_mandir}/man5/zpool-features.5*
335%{_mandir}/man8/fsck.zfs.8*
336%{_mandir}/man8/mount.zfs.8*
337%{_mandir}/man8/vdev_id.8*
338%{_mandir}/man8/zdb.8*
ec61a23e 339%{_mandir}/man8/zed.8*
bff0a8a1
JB
340%{_mandir}/man8/zfs.8*
341%{_mandir}/man8/zinject.8*
342%{_mandir}/man8/zpool.8*
343%{_mandir}/man8/zstreamdump.8*
344
345%files libs
346%defattr(644,root,root,755)
347%attr(755,root,root) %{_libdir}/libnvpair.so.*.*.*
348%attr(755,root,root) %ghost %{_libdir}/libnvpair.so.1
349%attr(755,root,root) %{_libdir}/libuutil.so.*.*.*
350%attr(755,root,root) %ghost %{_libdir}/libuutil.so.1
351%attr(755,root,root) %{_libdir}/libzfs.so.*.*.*
ec61a23e
JB
352%attr(755,root,root) %ghost %{_libdir}/libzfs.so.2
353%attr(755,root,root) %{_libdir}/libzfs_core.so.*.*.*
354%attr(755,root,root) %ghost %{_libdir}/libzfs_core.so.1
bff0a8a1 355%attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
ec61a23e 356%attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
bff0a8a1
JB
357
358%files devel
359%defattr(644,root,root,755)
360%attr(755,root,root) %{_libdir}/libnvpair.so
361%attr(755,root,root) %{_libdir}/libuutil.so
362%attr(755,root,root) %{_libdir}/libzfs.so
ec61a23e 363%attr(755,root,root) %{_libdir}/libzfs_core.so
bff0a8a1
JB
364%attr(755,root,root) %{_libdir}/libzpool.so
365%{_libdir}/libnvpair.la
366%{_libdir}/libuutil.la
367%{_libdir}/libzfs.la
ec61a23e 368%{_libdir}/libzfs_core.la
bff0a8a1
JB
369%{_libdir}/libzpool.la
370%{_includedir}/libspl
371%{_includedir}/libzfs
372
373%files static
374%defattr(644,root,root,755)
375%{_libdir}/libnvpair.a
376%{_libdir}/libuutil.a
377%{_libdir}/libzfs.a
ec61a23e 378%{_libdir}/libzfs_core.a
bff0a8a1
JB
379%{_libdir}/libzpool.a
380
381%files -n dracut-zfs
382%defattr(644,root,root,755)
383%doc dracut/README.dracut.markdown
8fa57ce6
JP
384%dir %{dracutlibdir}/modules.d/90zfs
385%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/module-setup.sh
386%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/mount-zfs.sh
387%attr(755,root,root) %{dracutlibdir}/modules.d/90zfs/parse-zfs.sh
bff0a8a1
JB
388%endif
389
390%if %{with kernel}
3921af7f 391%files -n kernel-zfs-common-devel
bff0a8a1 392%defattr(644,root,root,755)
e11b2ec8 393%dir /usr/src/zfs-%{version}
3921af7f
JR
394/usr/src/zfs-%{version}/include
395/usr/src/zfs-%{version}/zfs.release.in
396/usr/src/zfs-%{version}/zfs_config.h.in
bff0a8a1 397%endif
This page took 0.14359 seconds and 4 git commands to generate.