Procedures to build the unixODBC Driver Manager on Redhat.
This RPM was built on a Redhat 6.6 for forward compatibility.
Note that you may run into a lot of compatibility/dependency issues if you choose to build on an old VM. It may be easier to build on a newer Redhat.
If you are building on an old Redhat you will need to modify the SPEC file and add a -lrt flag for it to build without erroring out.
s
1.) Grab the unixODBC source from http://www.unixodbc.org/
2.) sudo yum install rpmdevtools
3.) rpmdev-setuptree (sets up the rpmbuild build tree in the home directory)
4.) Copy the unixODBC tar.gz to ~/rpmbuild/SOURCES
5.) Extract and copy the unixODBC source to ~/rpmbuild/BUILD
6.) Grab the unixODBC.spec from the latest source rpm package (e.g. unixODBC-2.3.11-2.fc38.src.rpm from https://src.fedoraproject.org/rpms/unixODBC)
7.) Change directory to ~/rpmbuild/SPECS, copy the spec file here
8.) rpmbuild -ba unixODBC.spec
9.) You may need to install the following packages and repeat step 8 again if they haven’t been installed.
automake
autoconf
libtool
libtool-ltdl-devel