<commit_before>#!/usr/bin/env bash
# Script to install the openresty from source and to tidy up after...

set -e

OPEN_RESTY_URL=http://openresty.org/download
OPEN_RESTY_VER=1.9.15.1
LUAROCKS_VER=2.2.1
NAXSI_VER=0.54
STATSD_VER=0.0.1

# Install all dependacies to build from source
yum -y install \
    gcc-c++ \
    gcc \
    geoip \
    geoip-devel \
    make \
    openssl-devel \
    openssl \
    perl \
    pcre-devel \
    pcre \
    readline-devel \
    tar \
    unzip \
    wget

# Prepare
wget -O ngx_openresty-${OPEN_RESTY_VER}.tar.gz ${OPEN_RESTY_URL}/openresty-${OPEN_RESTY_VER}.tar.gz
tar xzvf ngx_openresty-${OPEN_RESTY_VER}.tar.gz
rm ngx_openresty-${OPEN_RESTY_VER}.tar.gz

wget -O luarocks-${LUAROCKS_VER}.tar.gz http://luarocks.org/releases/luarocks-${LUAROCKS_VER}.tar.gz
tar xzvf luarocks-${LUAROCKS_VER}.tar.gz
rm luarocks-${LUAROCKS_VER}.tar.gz
<commit_msg>Add C support before installing GEOIP libraries<commit_after>#!/usr/bin/env bash
# Script to install the openresty from source and to tidy up after...

set -e

OPEN_RESTY_URL=http://openresty.org/download
OPEN_RESTY_VER=1.9.15.1
LUAROCKS_VER=2.2.1
NAXSI_VER=0.54
STATSD_VER=0.0.1
GEOIP_API_C_VER=1.6.11

# Install dependencies to build from source
yum -y install \
    gcc-c++ \
    gcc \
    make \
    openssl-devel \
    openssl \
    perl \
    pcre-devel \
    pcre \
    readline-devel \
    tar \
    unzip \
    wget

# build and install the missing geoip stuff
wget -O geoip-api-c.tar.gz "https://github.com/maxmind/geoip-api-c/releases/download/v${GEOIP_API_C_VER}/GeoIP-${GEOIP_API_C_VER}.tar.gz"
tar -xzvf geoip-api-c.tar.gz
rm geoip-api-c.tar.gz
cd "GeoIP-${GEOIP_API_C_VER}"
./configure
make
make check
make install

# Prepare
wget -O ngx_openresty-${OPEN_RESTY_VER}.tar.gz ${OPEN_RESTY_URL}/openresty-${OPEN_RESTY_VER}.tar.gz
tar xzvf ngx_openresty-${OPEN_RESTY_VER}.tar.gz
rm ngx_openresty-${OPEN_RESTY_VER}.tar.gz

wget -O luarocks-${LUAROCKS_VER}.tar.gz http://luarocks.org/releases/luarocks-${LUAROCKS_VER}.tar.gz
tar xzvf luarocks-${LUAROCKS_VER}.tar.gz
rm luarocks-${LUAROCKS_VER}.tar.gz

{'fraction_non_alphanumeric': 0.13212063188128292, 'fraction_numerical': 0.015318334131163236, 'mean_word_length': 3.3815513626834384, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '269173', 'n_tokens_mistral': 969, 'n_tokens_neox': 892, 'n_words': 156}