#!/bin/bash

source debian/vars.sh

# Package consuming this src ball will need:
# %if 0 >= 10
# export LIBEV_CONFIGURE_HOST=x86_64-redhat-linux-gnu
# %endif
mkdir -p build/support/vendor/cxxcodebuilder/
tar xzf $SOURCE1 \
    --strip-components=1 \
    -C build/support/vendor/cxxcodebuilder/
# Find files with a hash-bang that do not have executable permissions
for script in `find . -type f ! -perm /a+x -name "*.rb"`; do
    [ ! -z "`head -n 1 $script | grep \"^#!/\"`" ] && chmod -v 755 $script
    /bin/true
done
# C8 barfs without this but do it for everyone for consisteny, C6 might not get it but everything else should
perl -pi -e 's{#!/usr/bin/env python}{#!/usr/bin/python3}' \
    src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py
# since we rely on the system ruby there is no need to run
#   update_ruby_shebang.pl in $buildroot/opt/cpanel/ea-passenger-src
