]> git.proxmox.com Git - mirror_zfs.git/blame - rpm/generic/zfs.spec.in
Move the libraries into separate packages
[mirror_zfs.git] / rpm / generic / zfs.spec.in
CommitLineData
f3757573
BB
1%global _sbindir /sbin
2%global _libdir /%{_lib}
3%if 0%{?fedora} >= 17
4%global _udevdir %{_prefix}/lib/udev
5%global _dracutdir %{_prefix}/lib/dracut
6%else
7%global _udevdir /lib/udev
4788a01d 8%global _dracutdir %{_prefix}/share/dracut
f3757573
BB
9%endif
10
11%bcond_with debug
12%bcond_with blkid
881f45c6 13%bcond_with systemd
f3757573 14
881f45c6
RE
15# Generic enable switch for systemd
16%if %{with systemd}
17%define _systemd 1
18%endif
19
20# Fedora >= 15 comes with systemd, but only >= 18 has
21# the proper macros
22%if 0%{?fedora} >= 18
23%define _systemd 1
24%endif
25
26# opensuse >= 12.1 comes with systemd, but only >= 13.1
27# has the proper macros
28%if 0%{?suse_version} >= 1310
29%define _systemd 1
30%endif
f3757573
BB
31
32Name: @PACKAGE@
33Version: @VERSION@
34Release: @RELEASE@%{?dist}
35Summary: Commands to control the kernel modules and libraries
36
37Group: System Environment/Kernel
38License: @ZFS_META_LICENSE@
39URL: http://zfsonlinux.org/
40Source0: %{name}-%{version}.tar.gz
41BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42ExclusiveArch: i386 i686 x86_64
43
44# May build but untested on ppc/ppc64
45ExcludeArch: ppc ppc64
46
68a2e016 47Requires: spl = %{version}
c9b5cc8c
TF
48Requires: libzpool2 = %{version}
49Requires: libnvpair1 = %{version}
50Requires: libuutil1 = %{version}
51Requires: libzfs2 = %{version}
28967367 52Requires: %{name}-kmod = %{version}
f3757573
BB
53Provides: %{name}-kmod-common = %{version}
54
f12971e6
RE
55# zfs-fuse provides the same commands and man pages that ZoL does. Renaming
56# those on either side would conflict with all available documentation.
57Conflicts: zfs-fuse
58
f3757573
BB
59%if 0%{?rhel}%{?fedora}%{?suse_version}
60BuildRequires: zlib-devel
61BuildRequires: libuuid-devel
62%if %{with blkid}
63BuildRequires: libblkid-devel
64%endif
f3757573 65%endif
881f45c6
RE
66%if 0%{?_systemd}
67Requires(post): systemd
68Requires(preun): systemd
69Requires(postun): systemd
70BuildRequires: systemd
71%endif
f3757573
BB
72
73%description
c9b5cc8c 74This package contains the ZFS command line utilities.
f3757573 75
c9b5cc8c
TF
76%package -n libzpool2
77Summary: Native ZFS pool library for Linux
78Group: System Environment/Kernel
79
80%description -n libzpool2
81This package contains the zpool library, which provides support
82for managing zpools
83
84%post-n libzpool2 -p /sbin/ldconfig
85%postun -n libzpool2 -p /sbin/ldconfig
86
87%package -n libnvpair1
88Summary: Solaris name-value library for Linux
89Group: System Environment/Kernel
90
91%description -n libnvpair1
92This package contains routines for packing and unpacking name-value
93pairs. This functionality is used to portably transport data across
94process boundaries, between kernel and user space, and can be used
95to write self describing data structures on disk.
96
97%post-n libnvpair1 -p /sbin/ldconfig
98%postun -n libnvpair1 -p /sbin/ldconfig
99
100%package -n libuutil1
101Summary: Solaris userland utility library for Linux
102Group: System Environment/Kernel
103
104%description -n libuutil1
105This library provides a variety of compatibility functions for ZFS on Linux:
106 * libspl: The Solaris Porting Layer userland library, which provides APIs
107 that make it possible to run Solaris user code in a Linux environment
108 with relatively minimal modification.
109 * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
110 library.
111 * libefi: The Extensible Firmware Interface library for GUID disk
112 partitioning.
113 * libshare: NFS, SMB, and iSCSI service integration for ZFS.
114
115%post-n libuutil1 -p /sbin/ldconfig
116%postun -n libuutil1 -p /sbin/ldconfig
117
118%package -n libzfs2
119Summary: Native ZFS filesystem library for Linux
120Group: System Environment/Kernel
121
122%description -n libzfs2
123This package provides support for managing ZFS filesystems
124
125%post-n libzfs2 -p /sbin/ldconfig
126%postun -n libzfs2 -p /sbin/ldconfig
127
128%package -n libzfs2-devel
f3757573
BB
129Summary: Development headers
130Group: System Environment/Kernel
c9b5cc8c
TF
131Requires: libzfs2 = %{version}
132Requires: libzpool2 = %{version}
133Requires: libnvpair1 = %{version}
134Requires: libuutil1 = %{version}
135Provides: libzpool2-devel
136Provides: libnvpair1-devel
137Provides: libuutil1-devel
138Obsoletes: zfs-devel
f3757573 139
c9b5cc8c 140%description -n libzfs2-devel
f3757573
BB
141This package contains the header files needed for building additional
142applications against the ZFS libraries.
143
144%package test
145Summary: Test infrastructure
146Group: System Environment/Kernel
147Requires: %{name}%{?_isa} = %{version}-%{release}
148Requires: parted
149Requires: lsscsi
150Requires: mdadm
151Requires: bc
152
153%description test
154This package contains test infrastructure and support scripts for
155validating the file system.
156
157%package dracut
158Summary: Dracut module
159Group: System Environment/Kernel
160Requires: %{name}%{?_isa} = %{version}-%{release}
161Requires: dracut
162
163%description dracut
164This package contains a dracut module used to construct an initramfs
165image which is ZFS aware.
166
167%prep
168%if %{with debug}
169 %define debug --enable-debug
170%else
171 %define debug --disable-debug
172%endif
173%if %{with blkid}
174 %define blkid --with-blkid
175%else
176 %define blkid --without-blkid
177%endif
881f45c6
RE
178%if 0%{?_systemd}
179 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
180%else
181 %define systemd --enable-sysvinit --disable-systemd
182%endif
f3757573
BB
183
184%setup -q
185
186%build
187%configure \
188 --with-config=user \
189 --with-udevdir=%{_udevdir} \
190 --with-dracutdir=%{_dracutdir} \
191 --disable-static \
192 %{debug} \
881f45c6
RE
193 %{blkid} \
194 %{systemd}
f3757573
BB
195make %{?_smp_mflags}
196
197%install
198%{__rm} -rf $RPM_BUILD_ROOT
199make install DESTDIR=%{?buildroot}
200find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
201
ba661a6e 202%post
881f45c6
RE
203%if 0%{?_systemd}
204%systemd_post zfs.target
205%else
ba661a6e 206[ -x /sbin/chkconfig ] && /sbin/chkconfig --add zfs
881f45c6 207%endif
168d056c 208exit 0
ba661a6e
BB
209
210%preun
881f45c6
RE
211%if 0%{?_systemd}
212%systemd_preun zfs.target
213%else
ba661a6e
BB
214if [ $1 -eq 0 ] ; then
215 [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs
216fi
881f45c6 217%endif
168d056c 218exit 0
f3757573 219
881f45c6 220%postun
881f45c6
RE
221%if 0%{?_systemd}
222%systemd_postun zfs.target
223%endif
f3757573
BB
224
225%files
f3757573 226%{_sbindir}/*
fb02fabf 227%{_bindir}/*
9e246ac3 228%{_libexecdir}/%{name}
f3757573
BB
229%{_mandir}/man1/*
230%{_mandir}/man5/*
231%{_mandir}/man8/*
232%{_udevdir}/vdev_id
233%{_udevdir}/zvol_id
234%{_udevdir}/rules.d/*
235%config(noreplace) %{_sysconfdir}/%{name}
881f45c6
RE
236%if 0%{?_systemd}
237/usr/lib/modules-load.d/*
238%{_unitdir}/*
239%{_presetdir}/*
240%else
b7f59425 241%{_sysconfdir}/init.d/*
881f45c6 242%endif
f3757573 243
c9b5cc8c
TF
244%files -n libzpool2
245%{_libdir}/libzpool.so.*
246
247%files -n libnvpair1
248%{_libdir}/libnvpair.so.*
249
250%files -n libuutil1
251%{_libdir}/libuutil.so.*
252
253%files -n libzfs2
254%{_libdir}/libzfs*.so.*
255
256%files -n libzfs2-devel
f3757573
BB
257%{_libdir}/*.so
258%{_includedir}/*
c9b5cc8c
TF
259%doc AUTHORS COPYRIGHT DISCLAIMER
260%doc OPENSOLARIS.LICENSE README.markdown
f3757573
BB
261
262%files test
263%{_datadir}/%{name}
264
265%files dracut
266%doc dracut/README.dracut.markdown
267%{_dracutdir}/modules.d/*
268
269%changelog
0c28fb48
BB
270* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
271- Released 0.6.2-1
36c0b627
BB
272* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
273- First official stable release.