Note that packages created with this method may not contain the drivers, so you will need to install them (such as mysql-connector-odbc) separately. Note that the separate packages may use a different names for the drivers (check /etc/odbcinst.ini).
You'll probably need to do everything on a respective RHEL/CentOS 6.x or 7.x server to be sure the results are correct. These instructions assume you have terminal open in a suitable working directory.
Execute the following commands to install the rpmbuild command and to create the initial directories:
yum install rpm-build
mkdir -p rpmbuild/SOURCES
-
Download unixODBC-el6.spec or unixODBC-el7.spec from this repository
-
Download unixODBC source package from http://www.unixodbc.org/, e.g.
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
-
Put the package into rpmbuild/SOURCES:
mv unixODBC-*.tar.gz rpmbuild/SOURCES/
-
Build the RPMs:
rpmbuild -bb ./unixODBC-el*.spec
-
The finished RPMs can be found in rpmbuild/RPMS/x86_64 directory. Enjoy!
Precompiled RPMs are available in the RPMS directory. As usual, use at your own risk!