export PREFIX=/opt/mjpegtools/
sudo mkdir $PREFIX && chmod 777 $PREFIX
export PREFIX=/opt/mjpegtools/
cd $PREFIX
wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar -zxf jpegsrc.v8d.tar.gz
cd jpeg-8d/
./configure --prefix=/opt/mjpegtools
make -j2
sudo make install
export PREFIX=/opt/mjpegtools/
cd $PREFIX
wget http://downloads.sourceforge.net/project/mjpeg/mjpegtools/2.0.1rc1/mjpegtools-2.0.1RC1.tar.gz
tar -zxf mjpegtools-2.0.1RC1.tar.gz
cd mjpegtools-2.0.1RC1/
CPPFLAGS="-I$PREFIX/include" \
LDFLAGS="-L$PREFIX/lib" \
./configure \
--prefix=$PREFIX
make -j2
sudo make install