#!/usr/bin/env python

from __future__ import with_statement
from fabric.api import local, run, sudo, put, get, prompt, reboot, abort, settings, env
from fabric.contrib.console import confirm
import sys
import fab_prompt


def main():
    """Deploy and (default) configure supervisord."""

    sudo("pip install supervisor")
    run("echo_supervisord_conf")
    sudo("echo_supervisord_conf > /etc/supervisord.conf")
    sys.exit()


if __name__ == "__main__":
    fab_prompt.prompt()
    main()
        run('./configure --prefix="$HOME/ffmpeg_build" --disable-examples')
        run('make')
        run('make install')

    # FFMPEG
    with cd('~/ffmpeg_sources/ffmpeg/'):
        run('git pull')
        run('PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"')
        run('export PKG_CONFIG_PATH')
        run('./configure --prefix="$HOME/ffmpeg_build" \
            --extra-cflags="-I$HOME/ffmpeg_build/include" \
            --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
            --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl \
            --enable-libass --enable-libfdk-aac --enable-libmp3lame \
            --enable-libtheora --enable-libvorbis \
            --enable-libvpx --enable-libx264 --enable-nonfree')
        # not enabling libopus
        # --enable-libopus
        run('make')
        run('make install')
        run('hash -r')


    sys.exit()



if __name__ == '__main__':
   fab_prompt.prompt()
   main()