Fix issue with CentOS 7

This commit is contained in:
Pavel Odintsov 2015-01-29 05:41:26 -05:00
parent 07bd15ad36
commit 300e3b2039

@ -20,8 +20,16 @@ if (-e "/etc/debian_version") {
if (-e "/etc/redhat-release") {
$distro_type = 'centos';
$distro_version = `cat /etc/redhat-release | awk '{print \$3}'`;
chomp $distro_version;
my $distro_version_raw = `cat /etc/redhat-release`;
chomp $distro_version_raw;
# CentOS 6:
# CentOS release 6.6 (Final)
# CentOS 7:
# CentOS Linux release 7.0.1406 (Core)
if ($distro_version_raw =~ /(\d+)/) {
$distro_version = $1;
}
}
unless ($distro_type) {
@ -116,6 +124,16 @@ sub install {
`yum install -y $fastnetmon_deps_as_string`;
}
if ($distro_type eq 'centos' && $distro_version >= 7) {
# CentOS 7 has not log4cpp in repo and we should build it manually
`wget 'http://sourceforge.net/projects/log4cpp/files/latest/download?source=files' -O/usr/src/log4cpp-1.1.1.tar.gz`;
chdir "/usr/src";
`tar -xf log4cpp-1.1.1.tar.gz`;
chdir "/usr/src/log4cpp";
`./configure --prefix=/opt/log4cpp1.1.1`;
`make install`;
}
print "Clone FastNetMon repo\n";
chdir "/usr/src";
`git clone $fastnetmon_git_path`;
@ -123,7 +141,12 @@ sub install {
`mkdir /usr/src/fastnetmon/build`;
chdir "/usr/src/fastnetmon/build";
`cmake ..`;
if ($distro_type eq 'centos' && $distro_version >= 7) {
`cmake .. -DWE_USE_CUSTOM_LOG4CPP=on`;
} else {
`cmake ..`;
}
`make`;
my $fastnetmon_dir = "/opt/fastnetmon";