]> git.proxmox.com Git - mirror_zfs.git/blob - rpm/generic/zfs.spec.in
Merge branch 'zed-initial'
[mirror_zfs.git] / rpm / generic / zfs.spec.in
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
8 %global _dracutdir %{_prefix}/share/dracut
9 %endif
10
11 %bcond_with debug
12 %bcond_with blkid
13 %bcond_with systemd
14
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
31
32 Name: @PACKAGE@
33 Version: @VERSION@
34 Release: @RELEASE@%{?dist}
35 Summary: Commands to control the kernel modules and libraries
36
37 Group: System Environment/Kernel
38 License: @ZFS_META_LICENSE@
39 URL: http://zfsonlinux.org/
40 Source0: %{name}-%{version}.tar.gz
41 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42 ExclusiveArch: i386 i686 x86_64
43
44 # May build but untested on ppc/ppc64
45 ExcludeArch: ppc ppc64
46
47 Requires: spl = %{version}
48 Requires: %{name}-kmod = %{version}
49 Provides: %{name}-kmod-common = %{version}
50
51 # zfs-fuse provides the same commands and man pages that ZoL does. Renaming
52 # those on either side would conflict with all available documentation.
53 Conflicts: zfs-fuse
54
55 %if 0%{?rhel}%{?fedora}%{?suse_version}
56 BuildRequires: zlib-devel
57 BuildRequires: libuuid-devel
58 %if %{with blkid}
59 BuildRequires: libblkid-devel
60 %endif
61 %endif
62 %if 0%{?_systemd}
63 Requires(post): systemd
64 Requires(preun): systemd
65 Requires(postun): systemd
66 BuildRequires: systemd
67 %endif
68
69 %description
70 This package contains the ZFS command line utilities and libraries.
71
72 %package devel
73 Summary: Development headers
74 Group: System Environment/Kernel
75 Requires: %{name}%{?_isa} = %{version}-%{release}
76
77 %description devel
78 This package contains the header files needed for building additional
79 applications against the ZFS libraries.
80
81 %package test
82 Summary: Test infrastructure
83 Group: System Environment/Kernel
84 Requires: %{name}%{?_isa} = %{version}-%{release}
85 Requires: parted
86 Requires: lsscsi
87 Requires: mdadm
88 Requires: bc
89
90 %description test
91 This package contains test infrastructure and support scripts for
92 validating the file system.
93
94 %package dracut
95 Summary: Dracut module
96 Group: System Environment/Kernel
97 Requires: %{name}%{?_isa} = %{version}-%{release}
98 Requires: dracut
99
100 %description dracut
101 This package contains a dracut module used to construct an initramfs
102 image which is ZFS aware.
103
104 %prep
105 %if %{with debug}
106 %define debug --enable-debug
107 %else
108 %define debug --disable-debug
109 %endif
110 %if %{with blkid}
111 %define blkid --with-blkid
112 %else
113 %define blkid --without-blkid
114 %endif
115 %if 0%{?_systemd}
116 %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
117 %else
118 %define systemd --enable-sysvinit --disable-systemd
119 %endif
120
121 %setup -q
122
123 %build
124 %configure \
125 --with-config=user \
126 --with-udevdir=%{_udevdir} \
127 --with-dracutdir=%{_dracutdir} \
128 --disable-static \
129 %{debug} \
130 %{blkid} \
131 %{systemd}
132 make %{?_smp_mflags}
133
134 %install
135 %{__rm} -rf $RPM_BUILD_ROOT
136 make install DESTDIR=%{?buildroot}
137 find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
138
139 %post
140 /sbin/ldconfig
141 %if 0%{?_systemd}
142 %systemd_post zfs.target
143 %else
144 [ -x /sbin/chkconfig ] && /sbin/chkconfig --add zfs
145 %endif
146 exit 0
147
148 %preun
149 %if 0%{?_systemd}
150 %systemd_preun zfs.target
151 %else
152 if [ $1 -eq 0 ] ; then
153 [ -x /sbin/chkconfig ] && /sbin/chkconfig --del zfs
154 fi
155 %endif
156 exit 0
157
158 %postun
159 /sbin/ldconfig
160 %if 0%{?_systemd}
161 %systemd_postun zfs.target
162 %endif
163
164 %files
165 %doc AUTHORS COPYRIGHT DISCLAIMER
166 %doc OPENSOLARIS.LICENSE README.markdown
167 %{_sbindir}/*
168 %{_bindir}/*
169 %{_libdir}/*.so.*
170 %{_libexecdir}/%{name}
171 %{_mandir}/man1/*
172 %{_mandir}/man5/*
173 %{_mandir}/man8/*
174 %{_udevdir}/vdev_id
175 %{_udevdir}/zvol_id
176 %{_udevdir}/rules.d/*
177 %config(noreplace) %{_sysconfdir}/%{name}
178 %if 0%{?_systemd}
179 /usr/lib/modules-load.d/*
180 %{_unitdir}/*
181 %{_presetdir}/*
182 %else
183 %{_sysconfdir}/init.d/*
184 %endif
185
186 %files devel
187 %{_libdir}/*.so
188 %{_includedir}/*
189
190 %files test
191 %{_datadir}/%{name}
192
193 %files dracut
194 %doc dracut/README.dracut.markdown
195 %{_dracutdir}/modules.d/*
196
197 %changelog
198 * Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
199 - Released 0.6.2-1
200 * Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
201 - First official stable release.