Showing posts with label mediatomb. Show all posts
Showing posts with label mediatomb. Show all posts

Tuesday, June 12, 2012

New gadget: Synology DS412+

I'm finally giving up running my Ubuntu server. I used the server as file server and and media server running MediaTomb with JavaScript support. In addition I hosted my sitebar and a local wiki. The server is now replaced with a new shiny gadget from Synology: DS412+ a NAS with all the features I need and low energy consumption. I can even host my wiki and the sitebar on it. I'm running it with 4x2TB disks in a RAID configuration with a total of 6TB available storage.

This means there will probably be no updates to the 'MediaTomb with JS support on Ubuntu' topic from my side. Sorry for that ;-)

When I have play with the new gadget a little more I will probably let you know more details. For now I can already say that the media server of the DS412+ is a lot more cooperative when used with the DLNA client of my Samsung BD player than MediaTombe ever was.

Friday, December 9, 2011

HowTo: Compile MediaTomb with JavaScript support on Ubuntu 11.10 Oneiric Ocelot

This is a follow-up post to my original article on compiling MediaTomb with enabled JavaScript support for Ubuntu 10.04. Since Ubuntu 11.10 (Oneiric Ocelot) is now available, it was time for an update.

Since some time in Ubuntu MediaTomb is compiled without JavaScript support. JavaScript support is needed for example to handle/import playlists. This HowTo gives you a walk-through to compiling and installing MediaTomb with JScript support under Ubuntu 11.10. For this HowTo, I assume you start from a freshly installed Ubuntu.

You might ask why the version of MediaTomb provided with Ubuntu is compiled without JS support. To make long stories short: The problem is with SpiderMonkey, the Mozzila JavaScript engine. MediaTomb needs a header called jsapi.h to compile. As Ubuntu comes with packages providing these headers (libmozjs185-1.0, libmozjs185-dev) I gave it a try, but didn't manage to get is running this way.


But I managed to build MediaTomb on my Ubuntu Oneiric Ocelot from source with enabled JS support. Here is a step-by-step walk-trough of what worked for me:
  1. change to root or use sudo (I will assume you use sudo)
  2. sudo apt-get build-dep mediatomb
  3. sudo apt-get source mediatomb
  4. sudo vim mediatomb-0.12.1/debian/rules
  5. change --disable-libjs to --enable-libjs
  6. Now you should update the changelog file in the same directory
  7. get libmozjs2d and libmozjs-dev from the debian squeeze distibution: libmozjs2d_1.9.1.16-10_i386.deb and libmozjs-dev_1.9.1.16-10_i386.deb
  8. If you are running 64-bit Ubuntu (amd64), you should get the corresponding amd64 libraries instead: libmozjs2d_1.9.1.16-10_amd64.deb and libmozjs-dev_1.9.1.16-10_amd64.deb
  9. sudo dpkg -i libmozjs2d_1.9.1.16-10_i386
  10. If you have missing dependencies:  sudo apt-get install -f
  11. sudo dpkg -i libmozjs-dev_1.9.1.16-10_i386
  12. If you have missing dependenciessudo apt-get install -f
  13. Now you can cd to mediatomb-0.12.1 and try a sudo ./configure. You should see a line in the configuration summary that reads
    libjs                 : yes
  14. Now its time to install additional libs you might what to have for the build. Check the configuration summary. When you are done let's go!
  15. If you are not already there: cd mediatomb-0.12.1
  16. sudo dpkg-buildpackage -rfakeroot -us -uc (omit the -rfakeroot if you are working as root)
That's it! If all went well you should now have three new .deb files in the directory you did the apt-get in. You can install them all in one go by dpkg -i mediatomb*.deb. Again, if you have missing dependenciessudo apt-get install -f

Monday, July 18, 2011

HowTo: Compile MediaTomb with JavaScript support on Ubuntu 11.04

--- UPDATE ---
Since Ubuntu 11.10 (Oneiric Ocelot) is now available, it was time for an update:
HowTo: Compile MediaTomb with JavaScript support on Ubuntu 11.10 Oneiric Ocelot
--- UPDATE END ---

Since some time in Ubuntu MediaTomb is compiled without JavaScript support. JavaScript support is needed for example to handle/import playlists. So I spent some time on the net looking for a howto. The best I found was this one targeted to Ubuntu 10.04.

To make long stories short: The problem is with SpiderMonkey, the Mozzila JavaScrip engine. MediaTomb needs a header called jsapi.h to compile. As Natty comes with packages providing these headers (libmozjs185-1.0, libmozjs185-dev, xulrunner-2.0-mozjs) I gave it a try, but I didn't manage. I also followed Gabriel's hints on how to build and install SpiderMonkey from source, but did still not succeed. 


After a little more of research I finally managed to build MediaTomb on my Ubuntu Natty. Here is a step-by-step walk trough of what worked for me:
  1. change to root or use sudo
  2. apt-get build-dep mediatomb
  3. apt-get source mediatomb
  4. vim mediatomb-0.12.1/debian/rules
  5. change --disable-libjs to --enable-libjs
  6. Now you should update the changelog file in the same directory
  7. get libmozjs2d and libmozjs-dev from the debian sid distibution: libmozjs2d_1.9.1.16-6_i386.deb and libmozjs-dev_1.9.1.16-6_i386.deb
  8. Now you can cd to mediatomb-0.12.1 and try a ./configure. You should see a line in the configuration summary that reads
    libjs                 : yes
  9. Now its time to install additional libs you might what to have for the build. Check the configuration summary. When you are done let's go!
  10. If you are not already there: cd mediatomb-0.12.1
  11. dpkg-buildpackage -rfakeroot -us -uc
That's it! If all went well you should now have three new .deb files in the directory you did the apt-get in. You can install them all in one go by dpkg -i mediatomb*.deb

My thanks go to Gabriel Burca for his solution for Ubuntu 10.04 that was the basis for my Natty solution.

--- UPDATE ---
Triggered by Viv's comment, I tried this also on a 64-bit Ubuntu 11.04 (amd64). 
The only difference is in step 7. Here you will have to use the amd64 libraries: libmozjs2d_1.9.1.16-6_amd64.deb and libmozjs-dev_1.9.1.16-6_amd64.deb
After  that there is one additional step:
7.1. apt-get install libjs-prototype
--- UPDATE END ---