]> git.pld-linux.org Git - packages/zfs.git/blob - zfs.spec
- drop non-dist kernel support
[packages/zfs.git] / zfs.spec
1 # TODO: PLDify init script
2 #
3 # Conditional build:
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 #
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}
14 exit 1
15 %endif
16
17 %if "%{_alt_kernel}" != "%{nil}"
18 %if 0%{?build_kernels:1}
19 %{error:alt_kernel and build_kernels are mutually exclusive}
20 exit 1
21 %endif
22 %undefine       with_userspace
23 %global         _build_kernels          %{alt_kernel}
24 %else
25 %global         _build_kernels          %{?build_kernels:,%{?build_kernels}}
26 %endif
27
28 %if %{without userspace}
29 # nothing to be placed to debuginfo package
30 %define         _enable_debug_packages  0
31 %endif
32
33 %define         _duplicate_files_terminate_build        0
34
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)
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
40 %define rel     4
41 Summary:        Native Linux port of the ZFS filesystem
42 Summary(pl.UTF-8):      Natywny linuksowy port systemu plików ZFS
43 Name:           %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
44 Version:        0.6.3
45 Release:        %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
46 License:        CDDL (ZFS), GPL v2+ (ZPIOS)
47 Group:          Applications/System
48 Source0:        http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/%{pname}-%{version}.tar.gz
49 # Source0-md5:  5bcc32c122934d421eba68e16826637d
50 Patch0:         %{pname}-link.patch
51 Patch1:         linux-3.18.patch
52 URL:            http://zfsonlinux.org/
53 BuildRequires:  autoconf >= 2.50
54 BuildRequires:  automake
55 BuildRequires:  libtool
56 BuildRequires:  rpmbuild(macros) >= 1.701
57 %{?with_kernel:%{expand:%kbrs}}
58 %if %{with userspace}
59 BuildRequires:  libblkid-devel
60 BuildRequires:  libselinux-devel
61 BuildRequires:  libuuid-devel
62 BuildRequires:  zlib-devel
63 %endif
64 Requires:       %{pname}-libs = %{version}-%{release}
65 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66
67 %define         dracutlibdir    %{_prefix}/lib/dracut
68
69 %description
70 ZFS is an advanced file system and volume manager which was originally
71 developed for Solaris and is now maintained by the Illumos community.
72
73 ZFS on Linux, which is also known as ZoL, is currently feature
74 complete. It includes fully functional and stable SPA, DMU, ZVOL, and
75 ZPL layers.
76
77 %description -l pl.UTF-8
78 ZFS to zaawansowany system plików i zarządca wolumenów, oryginalnie
79 stworzony dla Solarisa, obecnie utrzymywany przez społeczność Illumos.
80
81 ZFS dla Linuksa, znany takża jako ZoL (ZFS on Linux), jest obecnie w
82 pełni funkcjonalny. Zawiera w pełni funkcjonalne i stabilne warstwy
83 SPA, DMU, ZVOL i ZPL.
84
85 %package libs
86 Summary:        ZFS on Linux libraries
87 Summary(pl.UTF-8):      Biblioteki ZFS-a dla Linuksa
88 License:        CDDL
89 Group:          Libraries
90 Requires(post,postun):  /sbin/ldconfig
91
92 %description libs
93 ZFS on Linux libraries.
94
95 %description libs -l pl.UTF-8
96 Biblioteki ZFS-a dla Linuksa.
97
98 %package devel
99 Summary:        Header files for ZFS libraries
100 Summary(pl.UTF-8):      Pliki nagłówkowe bibliotek ZFS-a
101 License:        CDDL
102 Group:          Development/Libraries
103 Requires:       %{pname}-libs = %{version}-%{release}
104 Requires:       libselinux-devel
105 Requires:       libuuid-devel
106 Requires:       zlib-devel
107
108 %description devel
109 Header files for ZFS libraries.
110
111 %description devel -l pl.UTF-8
112 Pliki nagłówkowe bibliotek ZFS-a.
113
114 %package static
115 Summary:        Static ZFS libraries
116 Summary(pl.UTF-8):      Statyczne biblioteki ZFS-a
117 License:        CDDL
118 Group:          Development/Libraries
119 Requires:       %{pname}-devel = %{version}-%{release}
120
121 %description static
122 Static ZFS libraries.
123
124 %description static -l pl.UTF-8
125 Statyczne biblioteki ZFS-a.
126
127 %package -n dracut-zfs
128 Summary:        ZFS support for Dracut
129 Summary(pl.UTF-8):      Obsługa ZFS-a dla Dracuta
130 Group:          Applications/System
131 Requires:       %{pname} = %{version}-%{release}
132 Requires:       dracut
133
134 %description -n dracut-zfs
135 ZFS support for Dracut.
136
137 %description -n dracut-zfs -l pl.UTF-8
138 Obsługa ZFS-a dla Dracuta.
139
140 %package -n kernel-zfs-common-devel
141 Summary:        ZFS Linux kernel headers
142 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa
143 Group:          Development/Building
144
145 %description -n kernel-zfs-common-devel
146 ZFS Linux kernel headers common for all PLD kernel versions.
147
148 %description -n kernel-zfs-common-devel -l pl.UTF-8
149 ZFS - pliki nagłówkowe jądra Linuksa wspólne na wszystkich
150 wersji jąder PLD.
151
152 %define kernel_pkg()\
153 %package -n kernel%{_alt_kernel}-zfs\
154 Summary:        ZFS Linux kernel modules\
155 Summary(pl.UTF-8):      ZFS - moduły jądra Linuksa\
156 Release:        %{rel}@%{_kernel_ver_str}\
157 Group:          Base/Kernel\
158 Requires(post,postun):  /sbin/depmod\
159 %requires_releq_kernel\
160 Requires(postun):       %releq_kernel\
161 \
162 %description -n kernel%{_alt_kernel}-zfs\
163 ZFS Linux kernel modules.\
164 \
165 %description -n kernel%{_alt_kernel}-zfs -l pl.UTF-8\
166 ZFS - moduły jądra Linuksa.\
167 \
168 %package -n kernel%{_alt_kernel}-zfs-devel\
169 Summary:        ZFS Linux kernel headers\
170 Summary(pl.UTF-8):      ZFS - pliki nagłówkowe jądra Linuksa\
171 Release:        %{rel}@%{_kernel_ver_str}\
172 Group:          Development/Building\
173 Requires:       kernel%{_alt_kernel}-headers\
174 Requires:       kernel-zfs-common-devel\
175 \
176 %description -n kernel%{_alt_kernel}-zfs-devel\
177 ZFS Linux kernel headers configured for PLD kernel%{_alt_kernel},\
178 version %{_kernel_ver}.\
179 \
180 %description -n kernel%{_alt_kernel}-zfs-devel -l pl.UTF-8\
181 ZFS - pliki nagłówkowe jądra Linuksa skonfigurowane dla jądra PLD z\
182 pakietu 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}\
218 p=`pwd`\
219 %{__make} install DESTDIR=$p/installed INSTALL_MOD_DIR=misc\
220 %{nil}
221
222 %{?with_kernel:%{expand:%kpkg}}
223
224 %prep
225 %setup -q -n %{pname}-%{version}
226 %patch0 -p1
227 %patch1 -p1
228
229 %build
230 %{__libtoolize}
231 %{__aclocal} -I config
232 %{__autoconf}
233 %{__autoheader}
234 %{__automake}
235 %{?with_kernel:%{expand:%bkpkg}}
236
237 %if %{with userspace}
238 %configure \
239         --disable-silent-rules \
240         --with-config="user" \
241         --with-linux=%{_kernelsrcdir} \
242         --with-systemdunitdir=%{systemdunitdir} \
243         --with-systemdpresetdir=/etc/systemd/system-preset \
244         --with-udevdir=/lib/udev
245
246 %{__make} \
247         %{?with_verbose:V=1}
248 %endif
249
250 %install
251 rm -rf $RPM_BUILD_ROOT
252
253 %if %{with kernel}
254 install -d $RPM_BUILD_ROOT
255 cp -a installed/* $RPM_BUILD_ROOT
256 %endif
257
258 %if %{with userspace}
259 %{__make} install \
260         DESTDIR=$RPM_BUILD_ROOT \
261         DEFAULT_INIT_DIR=/etc/rc.d/init.d
262 %endif
263
264 %clean
265 rm -rf $RPM_BUILD_ROOT
266
267 %post   libs -p /sbin/ldconfig
268 %postun libs -p /sbin/ldconfig
269
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
276 %attr(755,root,root) %{_bindir}/dbufstat.py
277 %attr(755,root,root) %{_sbindir}/fsck.zfs
278 %attr(755,root,root) %{_sbindir}/zdb
279 %attr(755,root,root) %{_sbindir}/zed
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
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
293 %attr(754,root,root) /etc/rc.d/init.d/zfs
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
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
307 %dir %{_libdir}/zfs
308 %dir %{_libdir}/zfs/zed.d
309 %attr(755,root,root) %{_libdir}/zfs/zed.d/*.sh
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*
322 %{_mandir}/man5/zfs-module-parameters.5*
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*
328 %{_mandir}/man8/zed.8*
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.*.*.*
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
344 %attr(755,root,root) %{_libdir}/libzpool.so.*.*.*
345 %attr(755,root,root) %ghost %{_libdir}/libzpool.so.2
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
352 %attr(755,root,root) %{_libdir}/libzfs_core.so
353 %attr(755,root,root) %{_libdir}/libzpool.so
354 %{_libdir}/libnvpair.la
355 %{_libdir}/libuutil.la
356 %{_libdir}/libzfs.la
357 %{_libdir}/libzfs_core.la
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
367 %{_libdir}/libzfs_core.a
368 %{_libdir}/libzpool.a
369
370 %files -n dracut-zfs
371 %defattr(644,root,root,755)
372 %doc dracut/README.dracut.markdown
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
377 %endif
378
379 %if %{with kernel}
380 %files -n kernel-zfs-common-devel
381 %defattr(644,root,root,755)
382 %dir /usr/src/zfs-%{version}
383 /usr/src/zfs-%{version}/include
384 /usr/src/zfs-%{version}/zfs.release.in
385 /usr/src/zfs-%{version}/zfs_config.h.in
386 %endif
This page took 0.080624 seconds and 4 git commands to generate.