But, there is a problem. If you tried to build Snort package with MySQL support like this:
rpmbuild --rebuild --with mysql snort-2.9.2.3-1.src.rpmthen you certainly got the following message:
<some unrelated configure script output>
checking for mysql...Well, the problem is that on 64-bit CentOS (and RHEL derivatives, including Fedora) 64-bit libraries are in /lib64 and /usr/lib64 directories. The easiest way to circumvent that problem is to do the following.
**********************************************
ERROR: unable to find mysqlclient library (libmysqlclient.*)
checked in the following places
/usr
/usr/lib
/usr/mysql
/usr/mysql/lib
/usr/lib/mysql
/usr/local
/usr/local/lib
/usr/local/mysql
/usr/local/mysql/lib
/usr/local/lib/mysql
**********************************************
error: Bad exit status from /var/tmp/rpm-tmp.R2KI5J (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.R2KI5J (%build)
First, install SRPMS file so that it is unpacked:
rpm -ivh snort-2.9.2.3-1.src.rpmThen, go to ~/rpmbuild/SPEC directory, and open file snort.spec in some text editor. Search for the following block:
if [ "$1" = "mysql" ]; thenIt's somewhere around line 231. Modify it to include line --with-mysql-libraries=/usr/lib64, i.e. it should now look like follows:
./configure $SNORT_BASE_CONFIG \
--with-mysql \
--without-postgresql \
--without-oracle \
--without-odbc \
%{?EnableFlexresp} %{?EnableFlexresp2} \
%{?EnableInline}
fi
if [ "$1" = "mysql" ]; thenSave and close file. Then, start snort build using the following command:
./configure $SNORT_BASE_CONFIG \
--with-mysql \
--with-mysql-libraries=/usr/lib64 \
--without-postgresql \
--without-oracle \
--without-odbc \
%{?EnableFlexresp} %{?EnableFlexresp2} \
%{?EnableInline}
fi
rpmbuild -bb --with mysql snort-2.9.2.3-1.src.rpmAnd that should be it...
2 comments:
Thanks for this. Helped me a ton :)
Thanks for this. Helped me a ton :)
Post a Comment