Makefile: refactor detection and use of tools
[nbdkit-plugin-vddk.git] / nbdkit-plugin-vddk.spec
1 # You must set this to the directory where you downloaded VDDK.
2 # NB. DO NOT PUT A TRAILING ‘/’ or you will get the error
3 # ‘canonicalization unexpectedly shrank by one character’ on RHEL 7.
4 %global vddkdir /home/rjones/tmp/vddk/vmware-vix-disklib-distrib
5
6 # The minimum version of nbdkit that we can build/install with.
7 %global minimum_version 1.1.2
8
9
10 Name:           nbdkit-plugin-vddk
11 # NB: The Version field is parsed out of this file by Makefile, so it
12 # can only be a simple number.  Also it must correspond to an nbdkit
13 # released version (ideally the latest version).
14 Version:        1.1.19
15 Release:        1%{?dist}
16
17 Summary:        VDDK plugin for nbdkit
18 License:        BSD
19
20 Source0:        nbdkit-%{version}.tar.gz
21
22 BuildRequires:  nbdkit-devel >= %{minimum_version}
23 BuildRequires:  perl-podlators
24 BuildRequires:  gnutls-devel
25
26 Requires:       nbdkit >= %{minimum_version}
27
28 # Make sure the final package doesn't actually depend on the
29 # VDDK library.
30 %global __requires_exclude .*libvixDiskLib\\.so.*
31
32
33 %description
34 This package contains the VDDK plugin for nbdkit.
35 NB: it does not contain VDDK itself.  You have to download that
36 separately yourself.
37
38
39 %prep
40 %setup -q -n nbdkit-%{version}
41 %configure \
42     --disable-perl \
43     --disable-python \
44     --disable-ocaml \
45     --disable-ruby \
46     --without-curl \
47     --without-libvirt \
48     --without-zlib \
49     --without-liblzma \
50     --without-libguestfs \
51     --with-vddk=%{vddkdir}
52
53
54 %build
55 # Note we're only building the plugin, and we want to build it
56 # against the installed nbdkit.
57 pushd plugins/vddk
58 make %{_smp_mflags}
59 popd
60
61
62 %install
63 mkdir -p $RPM_BUILD_ROOT%{_libdir}/nbdkit/plugins
64 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
65 pushd plugins/vddk
66 %make_install
67 popd
68
69 # Kill libtool files with fire.
70 find $RPM_BUILD_ROOT -name '*.la' -delete
71
72
73 %files
74 %{_libdir}/nbdkit/plugins/nbdkit-vddk-plugin.so
75 %{_mandir}/man1/nbdkit-vddk-plugin.1*
76
77
78 %changelog