#!/bin/bash
mkdir -p /var/log/no-portage-tmp
echo ls -l /var/log/no-portage-tmp
read FAKE; 
ls -l /var/log/no-portage-tmp
read FAKE; 
cd cinelerra5/cinelerra-5.1
pwd
read FAKE; 
echo "EXTRA_LIBS += -lva" >> global_config
echo "EXTRA_LIBS += -Wl,-z,noexecstack" >> global_config
# see if the lines were added
echo cat global_config;
read FAKE;
cat global_config;
read FAKE;
echo "cp -aiv guicast/bccmdl.py... then diff "
read FAKE;
cp -aiv guicast/bccmdl.py ../../
diff guicast/bccmdl.py ../../
read FAKE;
echo "sed on guicast/bccmdl.py... then diff "
read FAKE;
sed -e '1,1c#!/usr/bin/python2.7' -i guicast/bccmdl.py
diff guicast/bccmdl.py ../../
read FAKE;
echo "cp -iav guicast/Makefile... then diff "
read FAKE;
cp -iav guicast/Makefile ../../
diff  guicast/Makefile ../../Makefile 
read FAKE;
echo "cp -iav guicast/Makefile... then diff again "
read FAKE;
sed -e '/^bcxfer.C:/,+1s/python/python2.7/' -i guicast/Makefile
diff guicast/Makefile ../../Makefile 
read FAKE;
echo "configure..."
read FAKE;
./configure shared |& tee /var/log/no-portage-tmp/cinelerra-cv-gg_$(date +%y%m%d_%H%M)_configure_shared.log
touch log;
tailf log &
echo "make..."
read FAKE;
make >& log && \
cp -iav log /var/log/no-portage-tmp/cinelerra-cv-gg_$(date +%y%m%d_%H%M)_make.log 
echo "make install..."
read FAKE;
make install |& tee /var/log/no-portage-tmp/cinelerra-cv-gg_$(date +%y%m%d_%H%M)_make_install.log 
