Building RPM Packages from Spec Files

Software Installation for Linux

Platform
Intel® PAC
Napatech SmartNIC
Content Type
Software Installation Guide
Capture Software Version
Link™ Capture Software 12.11

Use this procedure to build Napatech driver and tools RPM packages if you have modified the spec files.

About this task

The package installer dnf is used in this example. You can of course use your distributions preferred RPM package installer.

Before you begin

rpm-build is required for building RPM packages from SRPM packages.

Kernel headers for the running kernel, gcc and make are required for building the nt-driver-3gd-modules RPM from nt-driver-3gd-x.y.z.build-short-sha1.src.rpm

Steps

To build RPM packages from the spec files:

Procedure

  1. Edit ~/rpmbuild/SPECS/nt-driver-3gd.spec and ~/rpmbuild/SPECS/nt-tools-3gd.spec to your liking.
  2. Ensure that kernel headers for the running kernel and other prerequisites are installed:
    $ sudo dnf install kernel-devel-$(uname -r) gcc make rpm-build
  3. If the Napatech driver has previously been installed on this host, install log files owned by root may be left in TMPDIR, by default /tmp. Remove these log files before building the Napatech driver as non-root user:
    $ sudo rm -v /tmp/nt_driver_* /tmp/nt_tools_*
  4. Build the RPM packages:
    $ rpmbuild -bb ~/rpmbuild/SPECS/nt-driver-3gd.spec
    $ rpmbuild -bb ~/rpmbuild/SPECS/nt-tools-3gd.spec

Results

By default, the resulting RPM packages are located in ~/rpmbuild/RPMS. For example:
rpmbuild/
├── BUILD
├── BUILDROOT
├── RPMS
│   ├── noarch
│   │   ├── nt-driver-3gd-devel-3.8.0.302-f4d297.el7.centos.noarch.rpm
│   │   ├── nt-driver-3gd-docs-3.8.0.302-f4d297.el7.centos.noarch.rpm
│   │   ├── nt-driver-3gd-examples-3.8.0.302-f4d297.el7.centos.noarch.rpm
│   │   └── nt-tools-3gd-docs-3.8.0.302-f4d297.el7.centos.noarch.rpm
│   └── x86_64
│       ├── nt-driver-3gd-3.8.0.302-f4d297.el7.centos.x86_64.rpm
│       ├── nt-driver-3gd-modules-3.8.0.302-f4d297.el7.centos.x86_64.rpm
│       └── nt-tools-3gd-3.8.0.302-f4d297.el7.centos.x86_64.rpm
├── SOURCES
├── SPECS
└── SRPMS
In addition, the build process leaves some log files in TMPDIR, by default /tmp:
/tmp
├── nt_driver_3gd.log
├── nt_driver_3gd.log.clip
└── nt_tools_3gd.log