How To Install rpkg-macros on CentOS 7

In this tutorial we learn how to install rpkg-macros on CentOS 7. rpkg-macros is Set of preproc macros for rpkg utility

Introduction

In this tutorial we learn how to install rpkg-macros on CentOS 7.

What is rpkg-macros

Set of preproc macros to be used by rpkg utility. They are designed to dynamically generate certain parts of rpm spec files. You can use those macros also without rpkg by $ cat <file_with_the_macros> | preproc -s /usr/lib/rpkg.macros.d/all.bash -e INPUT_PATH=<file_with_the_macros> INPUT_PATH env variable is passed to preproc to inform macros about the input file location. The variable is used to derive INPUT_DIR_PATH variable which rpkg macros use. If neither INPUT_PATH nor INPUT_DIR_PATH are specified, INPUT_PATH will stay empty and INPUT_DIR_PATH will default to ‘.’ (the current working directory). Another option to experiment with the macros is to source /usr/lib/rpkg.macros.d/all.bash into your bash environment Then you can directly invoke the macros on your command-line as bash functions. See content in /usr/lib/rpkg.macros.d to discover available macros. Please, see man rpkg-macros for more information.

We can use yum or dnf to install rpkg-macros on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install rpkg-macros.

Install rpkg-macros on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install rpkg-macros using yum by running the following command:

sudo yum -y install rpkg-macros

Install rpkg-macros on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install rpkg-macros using dnf by running the following command:

sudo dnf -y install rpkg-macros

How To Uninstall rpkg-macros on CentOS 7

To uninstall only the rpkg-macros package we can use the following command:

sudo dnf remove rpkg-macros

References

Summary

In this tutorial we learn how to install rpkg-macros on CentOS 7 using yum and dnf.