The rpmdevtools package contains the rpmdev-setuptree command which will create the necessary directories.
sudo yum install -y rpmdevtools
rpmdev-setuptree
Alternatively, to create the tree by hand:
1. Go to your home directory; you don't need to be root
2. mkdir rpmbuild
3. cd rpmbuild
4. mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
Below is the list of prerequisite packages. (These are also specified in the "pbspro.spec" file):
yum install -y gcc make rpm-build libtool hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel ncurses-devel perl postgresql-devel python3-devel tcl-devel tk-devel swig expat-devel openssl-devel libXext libXft
zypper install gcc make rpm-build libtool hwloc-devel libX11-devel libXt-devel libedit-devel libical-devel ncurses-devel perl postgresql-devel python3-devel tcl-devel tk-devel swig libexpat-devel libopenssl-devel libXext-devel libXft-devel fontconfig
In addition to the commands below, you should also install a text editor of your choosing (vim, emacs, gedit, etc.).
yum install -y expat libedit postgresql-server python3 sendmail sudo tcl tk libical
zypper install expat libedit postgresql-server python3 sendmail sudo tcl tk libical1
Make sure you have the following on your local system:
the pip command
the sudo command
the which command
the net-tools package
You can either build from source cloned from GitHub, or build from source rpm (srpm).
Note: <pbs_version> specified at pbspro/src/pbspro.spec
1. Go to pbspro directory which you have cloned (git clone https://github.com/PBSPro/pbspro)
2. Run the autogen.sh script to generate the configure script and Makefile.in files
./autogen.sh
(generates configure script and Makefile.in templates)
3. Run ./configure
4. Generate the source tar that will use to build the rpm
make dist
make dist generates .tar.gz (pbspro-<pbs_version>.tar.gz) file in the same directory.
5. Move the pbspro-<pbs_version>.tar.gz file to ~/rpmbuild/SOURCES
6. Copy pbspro/pbspro.spec file to ~/rpmbuild/SPECS
7. Change directory to ~/rpmbuild/SPECS
8. Run the below command
rpmbuild -ba pbspro.spec (This command will generate the below rpm packages in ~/rpmbuild/RPMS dirctory)
a) pbspro-client-<pbs_version>-0.x86_64.rpm
b) pbspro-debuginfo-<pbs_version>-0.x86_64.rpm
c) pbspro-execution-<pbs_version>-0.x86_64.rpm
d) pbspro-server-<pbs_version>-0.x86_64.rpm
2. You can either use the –rebuild option, or you can build the rpm yourself.
Do an rpmbuild –rebuild pbspro-<pbs_version>.src.rpm
Install the pbspro-<pbs_version>.src.rpm
rpm -i pbspro-<pbs_version>.src.rpm
This installs pbspro-<pbs_version>.tar.gz and pbspro.spec in their respective directories under the rpmbuild dev tree.
Change directory to ~/rpmbuild/SPECS and run the below command
rpmbuild -ba pbspro.spec (This command generates the below rpm packages in ~/rpmbuild/RPMS dirctory)
a) pbspro-client-<pbs_version>-0.x86_64.rpm
b) pbspro-debuginfo-<pbs_version>-0.x86_64.rpm
c) pbspro-execution-<pbs_version>-0.x86_64.rpm
d) pbspro-server-<pbs_version>-0.x86_64.rpm