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