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