Page 1 of 1

Helper script to build MakeMKV

Posted: Fri Feb 11, 2011 2:17 am
by mechevar
Wanted to put this out there to see if this helps ease the building of MakeMKV. Any improvements would be greatly appreciated. The only change you will have to make over time is to update the curr_version variable to something other than 1.6.4 in the future.

This script downloads the gz files, unpacks them, builds makemkv, installs makemkv, deletes the zips and build folders, downloads an icon to /usr/share/pixmaps and then creates a gnome menu entry for makemkv

Code: Select all

gedit buildMakeMkv.sh
Copy all of this into the new file

Code: Select all

#!/bin/sh
export curr_version=1.6.4
export bin_zip=makemkv_v${curr_version}_bin.tar.gz
export oss_zip=makemkv_v${curr_version}_oss.tar.gz
export oss_folder=makemkv_v${curr_version}_bin
export bin_folder=makemkv_v${curr_version}_oss

sudo apt-get install build-essential libc6-dev libssl-dev libgl1-mesa-dev libqt4-dev

wget http://www.makemkv.com/download/$bin_zip
wget http://www.makemkv.com/download/$oss_zip

tar -xzvf $bin_zip
tar -xzvf $oss_zip

cd $oss_folder
make -f makefile.linux
sudo make -f makefile.linux install

cd ../$bin_folder
make -f makefile.linux
sudo make -f makefile.linux install

cd ..
echo removing zips and folders
rm $bin_zip
rm $oss_zip
rm -rf $oss_folder
rm -rf $bin_folder

echo making gnome menu entry
pushd /usr/share/pixmaps
sudo wget http://www.softicons.com/download/system-icons/lozengue-filetype-icons-by-gurato/png/256/MKV.png
sudo rm -f MKV.png.*
popd

file="[Desktop Entry]"
file=${file}'\n'"Type=Application"
file=${file}'\n'"Encoding=UTF-8"
file=${file}'\n'"Name=Make MKV"
file=${file}'\n'"Comment=Decrypt Blu-Ray to mkv"
file=${file}'\n'"Icon=/usr/share/pixmaps/MKV.png"
file=${file}'\n'"TryExec=makemkv"
file=${file}'\n'"Exec=makemkv"
file=${file}'\n'"Terminal=false"
file=${file}'\n'"Categories=GTK;AudioVideo;Audio;Video;"

echo -e ${file} > ~/.local/share/applications/makemkv.desktop
change the permissions to make it executable

Code: Select all

chmod a+x  buildMakeMkv.sh
now run it!

Code: Select all

./buildMakeMkv.sh

Re: Helper script to build MakeMKV

Posted: Fri Feb 11, 2011 11:32 am
by jdbower
I created a similar script using BASH and posted it here. About the only real difference is that I included the version as a parameter (useful for when I update makemkv, rather than touching the script I just do makemkv-install 1.6.5) and I stop the script if any of the builds go wrong. I did include text for a workaround apparently required under Lucid and a few other systems, but since I'm too lazy to spin up a Lucid VM and test it myself I wasn't comfortable actually implementing the change automatically (a pretty simple sed command).

I do like how you've created a GNOME menu entry, I may have to update my own script to do something similar. If you're running a reasonable version of Ubuntu or otherwise can get PPAs to work, the document I linked shows how to install from a PPA so it will get updated automatically (if you'd like to create a PPA yourself you can check this out).

A more trivial comment, I chose my name intentionally because I'm forgetful. I have a recipe manager (Gourmet) and I wrote a script to process the recipe filenames after I export them to HTML. I called it something like process-recipe, but when I use it once every few months I could never remember what I called it so I had to check ~/bin. I renamed it recipe-process and now I know to type "recipe" and let tab completion figure out if it's really recipe-process, recipe-rename, etc. Similarly since I designed my script to be used on MakeMKV updates, I used makemkv-install so I can tab complete it after typing makemkv (in case I forget if it's -install or -update or -download, etc.).

Re: Helper script to build MakeMKV

Posted: Fri Nov 25, 2011 10:26 am
by swan11
I am so glad that you have taken an initiative to come up with a script here using BASH. The script from what I can see seems to be very much useful and could serve as a replacement to the above script to build MakeMKV. I think this works since the only difference exists in the latter included as a parameter.