diff --git a/README.md b/README.md index 0c046d1..b25cef7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,41 @@ # Building RPMs for Pmodules -With the spec files in this repository you can build RPMs for Pmodules. \ No newline at end of file +## The spec files +With the spec files in this repository can be used to build RPMs for Pmodules. + +**Pmodules.spec** +The spec file to build the Pmodules RPM. + +**Pmodules_modules.spec** +Pmodules is a wrapper around the C implementation of Environment Modules 3.2.10 with some patches (e.g.: except `%#Pmodules` as shebang). This RPM is set as 'required' in the Pmodules RPM. + +**Pmodules_bash.spec** +The Pmodules wrapper is written in Bash and uses feature only available in Bash version 5 and newer. On most current Linux distributions only Bash 4 is available. This RPM is set as 'required' in the Pmodules RPM. + +## Building the RPMs + +**Requirements (on RHEL8/9)**\ +The RPMs `rpm-build` and `rpmdevtools` must be installed. + +**Setup the directories for `rpmbuild` (if not already done)** +``` +mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} +echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros +``` + +**Download the required sources** +``` +cd ~/rpmbuild/SPECS +for f in Pmodules.spec Pmodules_bash.spec Pmodules_modules.spec; do + spectool "$f" +fone +``` + +**Build the RPMs** +``` +for f in Pmodules.spec Pmodules_bash.spec Pmodules_modules.spec; do + rpmbuild -bb "$f" +fone +``` + +