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