xref: /spdk/doc/rpm.md (revision 0791d4ae5c82b2c7bb4c16c9c92bc602068e1818)
1# RPMs {#rpms}
2
3## In this document {#rpms_toc}
4
5* @ref building_rpms
6* @ref dpdk_devel
7
8## Building SPDK RPMs {#building_rpms}
9
10To build basic set of RPM packages out of the SPDK repo simply run:
11
12~~~{.sh}
13# rpmbuild/rpm.sh
14~~~
15
16Additional configuration options can be passed directly as arguments:
17
18~~~{.sh}
19# rpmbuild/rpm.sh --with-shared --with-dpdk=/path/to/dpdk/build
20~~~
21
22There are several options that may be passed via environment as well:
23
24- DEPS          - Install all needed dependencies for building RPM packages.
25                Default: "yes"
26- MAKEFLAGS     - Flags passed to make
27- RPM_RELEASE   - Target release version of the RPM packages. Default: 1
28- REQUIREMENTS  - Extra set of RPM dependencies if deemed as needed
29- SPDK_VERSION  - SPDK version. Default: currently checked out tag
30- GEN_SPEC      - Orders rpm.sh to only generate a valid .spec and print
31                it on stdout. The content of the .spec is determined based
32                mainly on the ./configure cmdline passed to rpm.sh.
33- USE_DEFAULT_DIRS - Normally, rpm.sh will order rpmbuild to build under
34                   customizable set of directories. Since this may be not
35                   desired, especially when used together with GEN_SPEC,
36                   this option will preserve the default set of directories.
37
38~~~{.sh}
39# DEPS=no MAKEFLAGS="-d -j1" rpmbuild/rpm.sh --with-shared
40~~~
41
42By default, all RPM packages should be created under $HOME directory of the
43target user:
44
45~~~{.sh}
46# printf '%s\n' /root/rpmbuild/RPMS/x86_64/*
47/root/rpmbuild/RPMS/x86_64/spdk-devel-v21.01-1.x86_64.rpm
48/root/rpmbuild/RPMS/x86_64/spdk-dpdk-libs-v21.01-1.x86_64.rpm
49/root/rpmbuild/RPMS/x86_64/spdk-libs-v21.01-1.x86_64.rpm
50/root/rpmbuild/RPMS/x86_64/spdk-v21.01-1.x86_64.rpm
51#
52~~~
53
54- spdk            - provides all the binaries, common tooling, etc.
55- spdk-devel      - provides development files
56- spdk-libs       - provides target lib, .pc files (--with-shared)
57- spdk-dpdk-libs  - provides dpdk lib files (--with-shared|--with-dpdk)
58
59## Special case for dpdk-devel {#dpdk_devel}
60
61When rpm.sh finds a bare --with-dpdk argument on the cmdline it will try to
62adjust the behavior of the rpmbuild to make sure only SPDK RPMs are built.
63Since this argument requests SPDK to be built against installed DPDK (e.g.
64dpdk-devel package) the spdk-dpdk-libs RPM won't be included.  Moreover, the
65.spec will be armed with a build requirement to make sure dpdk-devel is
66present on the building system. The minimum required version of dpdk-devel
67is set to 19.11.
68