<commit_before>#!/bin/bash -x

# install fpm
yum check-update 
yum install -y ruby-devel gcc curl libyaml-devel which tar rpm-build rubygems

gem install fpm

# install prerequisites
yum install -y git python-setuptools
easy_install virtualenv

# install build dependencies
{% if build_deps %}
yum install -y {{build_deps|join(' ')}}
{% endif %}

cd /dist

git clone {{git_url}}

cd {{app}}

rm -rf .git

virtualenv .

source bin/activate

if [ -f "requirements.txt" ]; then
    pip install -r requirements.txt
fi

if [ -f "setup.py" ]; then
    python setup.py install
fi

cd ..

fpm -s dir -t rpm -n {{app}} -p /dist -v {{version}} {% for dep in runtime_deps %} --depends {{dep}} {% endfor %} {{fpm_args}} {{app}}<commit_msg>compile Python interpreter for CentOS<commit_after>#!/bin/bash -x
PYTHON_VERSION="2.7.9"

# install general prerequisites
yum check-update 
yum install -y ruby-devel curl libyaml-devel which tar rpm-build rubygems git python-setuptools zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

yum groupinstall -y "Development Tools"

# install build dependencies needed for this specific build
{% if build_deps %}
yum install -y {{build_deps|join(' ')}}
{% endif %}

gem install fpm

# install prerequisites
easy_install virtualenv

# compile and install python
cd /var/tmp
curl -O https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz
tar xzvf Python-$PYTHON_VERSION.tgz
cd Python-$PYTHON_VERSION
./configure --prefix=/opt/vdist-python
make && make install

cd /opt

git clone {{git_url}}

cd {{app}}

rm -rf .git

virtualenv -p /opt/vdist-python/bin/python .

source bin/activate

if [ -f "requirements.txt" ]; then
    pip install -r requirements.txt
fi

if [ -f "setup.py" ]; then
    python setup.py install
fi

cd ..

fpm -s dir -t rpm -n {{app}} -v {{version}} {% for dep in runtime_deps %} --depends {{dep}} {% endfor %} {{fpm_args}} /opt
{'fraction_non_alphanumeric': 0.13133874239350912, 'fraction_numerical': 0.002535496957403651, 'mean_word_length': 3.7657004830917873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7217138', 'n_tokens_mistral': 744, 'n_tokens_neox': 680, 'n_words': 221}