Red Hat: Difference between revisions

From IoWiki
Jump to navigation Jump to search
m (→‎Install development tools: Remove -y from dnf example)
Line 15: Line 15:
...and the RPM tools.
...and the RPM tools.


{{code|inline=y|lang=bash|dnf install -y rpmdevtools rpmlint}}
{{code|inline=y|lang=bash|dnf install rpmdevtools rpmlint}}


===Initialize an RPM build environment===
===Initialize an RPM build environment===

Revision as of 21:28, 5 June 2023

Personal notes on the use of Red Hat's Linux distributions and their derivatives (RHEL, Fedora, CentOS, Alma, etc.).

Package Development

Preparing a development environment, getting upstream sources to modify, and building.

Environment preparation

Install development tools

Red Hat's term for the usual...

dnf groupinstall "Development Tools" "Development Libraries"

...and the RPM tools.

dnf install rpmdevtools rpmlint

Initialize an RPM build environment

Creates the directory tree under ~/rpmbuild.

rpmdev-setuptree

Install a package's build dependencies

dnf builddep $PACKAGE

Retrieving upstream sources

Using the package manager

dnf can fetch SRPMs from the repository.

dnf download --source $PACKAGE

Extracting the SRPMs will give you a SPEC, a source tarball, and any distribution patches.

rpm2cpio $PACKAGE.src.rpm | cpio -idmv

Using git

Individual git repositories for packages are accessible from Fedora Package Sources.

External links