Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172799 - Proposed ebuild for mediatomb (uPNP server)
Summary: Proposed ebuild for mediatomb (uPNP server)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High enhancement (vote)
Assignee: Diego Elio Pettenò (RETIRED)
URL: http://mediatomb.cc
Whiteboard:
Keywords: EBUILD
: 215412 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-30 15:35 UTC by KaZeR
Modified: 2008-04-22 11:34 UTC (History)
14 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed ebuild for mediatomb-0.9.0_pre (mediatomb-0.9.0_pre.ebuild,1.63 KB, text/plain)
2007-03-30 15:37 UTC, KaZeR
Details
files/config.xml (Default config file.) (config.xml,1.53 KB, text/plain)
2007-03-30 15:40 UTC, KaZeR
Details
files/mediatomb-0.9.0.rc (init script) (mediatomb-0.9.0.rc,765 bytes, text/plain)
2007-03-30 15:41 UTC, KaZeR
Details
Proposed ebuild for mediatomb-0.9.1 (mediatomb-0.9.1.ebuild,1.78 KB, text/plain)
2007-06-02 09:41 UTC, Art Wallace
Details
files/config.xml (updated default config file.) (config.xml,1.88 KB, text/plain)
2007-06-02 09:44 UTC, Art Wallace
Details
Updated mediatomb-0.9.1 ebuild (mediatomb-0.9.1.ebuild,2.13 KB, text/plain)
2007-07-01 16:47 UTC, BT
Details
Updated mediatomb-0.9.1 init script (mediatomb.initd,356 bytes, text/plain)
2007-07-01 16:48 UTC, BT
Details
mediatomb-0.9.1 confd file (mediatomb.confd,315 bytes, text/plain)
2007-07-01 16:48 UTC, BT
Details
Updates mediatomb-0.9.1 config.xml file (config.xml,1.88 KB, text/plain)
2007-07-01 16:49 UTC, BT
Details
Updated mediatomb-0.9.1 ebuild (mediatomb-0.9.1.ebuild,2.27 KB, text/plain)
2007-07-02 05:01 UTC, BT
Details
Updated mediatomb-0.9.1 init script (mediatomb.initd,445 bytes, text/plain)
2007-07-02 05:02 UTC, BT
Details
Updated mediatomb-0.9.1 confd file (mediatomb.confd,477 bytes, text/plain)
2007-07-02 05:02 UTC, BT
Details
Updated mediatomb-0.9.1 ebuild (mediatomb-0.9.1.ebuild,2.60 KB, text/plain)
2007-07-03 14:23 UTC, BT
Details
Updated mediatomb-0.9.1 init script (mediatomb.initd,476 bytes, text/plain)
2007-07-03 14:24 UTC, BT
Details
Updated mediatomb-0.9.1 confd file (mediatomb.confd,407 bytes, text/plain)
2007-07-03 14:25 UTC, BT
Details
Updated mediatomb-0.9.1 ebuild (mediatomb-0.9.1.ebuild,2.62 KB, text/plain)
2007-07-05 09:58 UTC, BT
Details
Updated mediatomb-0.9.1 init script (mediatomb.initd,497 bytes, text/plain)
2007-07-05 09:58 UTC, BT
Details
Updated mediatomb-0.9.1 confd file (mediatomb.confd,526 bytes, text/plain)
2007-07-05 09:59 UTC, BT
Details
Updated mediatomb-0.9.1 ebuild (mediatomb-0.9.1.ebuild,2.63 KB, text/plain)
2007-07-11 03:03 UTC, BT
Details
mediatomb-0.10.0 ebuild (mediatomb-0.10.0.ebuild,2.63 KB, text/plain)
2007-07-13 07:47 UTC, BT
Details
mediatomb-0.10.0 config.xml file (config.xml,2.26 KB, text/plain)
2007-07-13 11:31 UTC, BT
Details
mediatomb-0.11.0 ebuild (mediatomb-0.11.0.ebuild,3.94 KB, text/plain)
2008-03-02 02:57 UTC, BT
Details
mediatomb-0.11.0 config.xml file (mediatomb-0.11.0.config,2.67 KB, text/plain)
2008-03-02 02:58 UTC, BT
Details
mediatomb confd file (mediatomb.confd,857 bytes, text/plain)
2008-03-02 02:59 UTC, BT
Details
mediatomb init script (mediatomb.initd,568 bytes, text/plain)
2008-03-02 03:00 UTC, BT
Details
updated mediatomb-0.11.0 ebuild (mediatomb-0.11.0.ebuild,3.78 KB, text/plain)
2008-03-03 11:17 UTC, BT
Details

Note You need to log in before you can comment on or make changes to this bug.
Description KaZeR 2007-03-30 15:35:57 UTC
MediaTomb is an open source (GPL) UPnP MediaServer with a nice web user interface, it allows you to stream your digital media through your home network and listen to/watch it on a variety of UPnP compatible devices.

MediaTomb implements the UPnP MediaServer V 1.0 specification that can be found on http://www.upnp.org/. The current implementation focuses on parts that are required by the specification, however we look into extending the functionality to cover the optional parts of the spec as well.

MediaTomb should work with any UPnP compliant MediaRenderer, please tell us if you experience difficulties with particular models, also take a look at the Supported Devices list for more information.

Reproducible: Always
Comment 1 KaZeR 2007-03-30 15:37:27 UTC
Created attachment 114966 [details]
Proposed ebuild for mediatomb-0.9.0_pre

See also two attached files : config.xml and mediatomb-0.9.0.rc
Comment 2 KaZeR 2007-03-30 15:40:29 UTC
Created attachment 114968 [details]
files/config.xml (Default config file.)
Comment 3 KaZeR 2007-03-30 15:41:16 UTC
Created attachment 114970 [details]
files/mediatomb-0.9.0.rc (init script)
Comment 4 Art Wallace 2007-06-02 09:41:18 UTC
Created attachment 120926 [details]
Proposed ebuild for mediatomb-0.9.1

Version bumped. Added some depends that probably should be optional.

config.xml might have the wrong permissions with this ebuild. It should be owned by mediatomb for first run so that the uuid can be set from the daemon. After that it seems to work as readonly.
Comment 5 Art Wallace 2007-06-02 09:44:51 UTC
Created attachment 120928 [details]
files/config.xml (updated default config file.)

Version bump. Added section for PS3 compatibility though it is disabled by default.
Comment 6 Alan Jones 2007-06-04 19:07:55 UTC
Just testing this on amd64 - all appears fine and have run it from source before.

You can remove libextractor from the dependencies as it stands because it's disabled by default (due to being really slow). Alternatively you could add another use flag for it.
Comment 7 Art Wallace 2007-06-04 20:53:05 UTC
I think we should add optional use flags for all of the dependencies that I added. I was going to but did not know if there were standard flags for those. I searched but couldn't find any.

It works on ppc as well.
Comment 8 Tobias Reese 2007-06-14 20:09:18 UTC
When is this going to be released as masked package? If you need testing in x86 based pc just give me a shout.
Comment 9 BT 2007-07-01 16:47:27 UTC
Created attachment 123544 [details]
Updated mediatomb-0.9.1 ebuild
Comment 10 BT 2007-07-01 16:48:08 UTC
Created attachment 123545 [details]
Updated mediatomb-0.9.1 init script
Comment 11 BT 2007-07-01 16:48:38 UTC
Created attachment 123547 [details]
mediatomb-0.9.1 confd file
Comment 12 BT 2007-07-01 16:49:53 UTC
Created attachment 123549 [details]
Updates mediatomb-0.9.1 config.xml file
Comment 13 BT 2007-07-01 17:12:50 UTC
I have posted an updated MediaTomb 0.9.1 ebuild, init script, confd file and config.xml. If you have installed one of the previous ebuilds, you can remove the mediatomb user as it is no longer required.

Main changes are:

1. Added libextractor and taglib use flags.
2. Made id3lib and taglib support mutually exclusive as MediaTomb only uses one of them even if both are available.
3. Removed the need to create a mediatomb user. This also avoids setting the mediatomb users home dir to /etc/mediatomb as in previous ebuilds.
5. Set the MediaTomb home dir to /var/lib/mediatomb. This is inline with Debian systems and more appropriate than /etc/mediatomb.
4. Ebuild checks if either sqlite or mysql use flags are set before compiling.
6. Added a confd file to allow options to be passed to MediaTomb at start.
7. Various other changes such as ebuild formating fixes, shortened ebuild description, etc.

I have not tested it on amd64 yet as the ebuild requires more testing before installing it on my stable amd64 system. The only problem I know of is that the ebuild will not recreate the /var/lib/mediatomb dir when re-emerging. This dir is removed by the ebuild when unmerging. Please test and post your feedback. Thanks.
Comment 14 BT 2007-07-02 01:21:22 UTC
I believe the ebuild should not automatically remove the /var/lib/mediatomb dir as it contains the sqlite database and bookmark file. This directory will also be deleted when re-emerging which I now realise is not desirable, as the user might just be building with different use flags, but will loose all data as a result. I will update the ebuild to instead print out a warning that the /var/lib/mediatomb dir needs to be deleted if MediaTomb is being uninstalled. This will also solve the problem of the /var/lib/mediatomb dir not being recreated when re-emerging. I recommend removing or commenting the entire pkg_prerm() function (line 80-83).
Comment 15 BT 2007-07-02 05:01:18 UTC
Created attachment 123586 [details]
Updated mediatomb-0.9.1 ebuild
Comment 16 BT 2007-07-02 05:02:02 UTC
Created attachment 123588 [details]
Updated mediatomb-0.9.1 init script
Comment 17 BT 2007-07-02 05:02:40 UTC
Created attachment 123590 [details]
Updated mediatomb-0.9.1 confd file
Comment 18 BT 2007-07-02 05:17:37 UTC
Updated the mediatomb-0.9.1 ebuild,init script and confd file.

Main updates:

1. confd file has more vars to pass to the init script.
2. Installed a .keep file to stop portage from removing the /var/lib/mediatomb dir on unmerge or re-emerge.
3. ebuild prints out a warning on unmerge to notify that the /var/lib/mediatomb dir might need to be deleted manually when wanting to uninstall MediaTomb.
4. Set the perms on config.xml to 0600. This is necessary as the config.xml might contain the MediaTomb MySQL db username and password. It seems that portage only sets these perms on a clean install. Portage doesn't set the perms when the config.xml file exists. In this case set the perms manually to 0600 or delete config.xml and re-emerge. This is not necessary on clean installs.
5. ebuild now installs the AUTHORS, ChangeLog, NEWS and README files.
Comment 19 Art Wallace 2007-07-02 05:36:40 UTC
I think it is safe to add ~ppc to the ebuild.
Comment 20 BT 2007-07-02 06:19:08 UTC
(In reply to comment #19)
> I think it is safe to add ~ppc to the ebuild.
> 
Ok. For the next update I will add ~amd64 and ~ppc. I believe MediaTomb also supports alpha, arm, mips and sparc. I didn't see ppc listed as a supported arch on the MediaTomb web page, but I will add it if it worked for you. I only have access to x86 and amd64. Thanks.
Comment 21 BT 2007-07-03 14:23:37 UTC
Created attachment 123773 [details]
Updated mediatomb-0.9.1 ebuild

Looks like running MediaTomb as root is not recommended by the MediaTomb devs. I have changed the ebuild to create a MediaTomb user and group. The home dir is set to /var/lib/mediatomb and owned by mediatomb:mediatomb.

The config.xml file ownership is now root:mediatomb with 0660 perms. The init script has also been updated to start MediaTomb as mediatomb:mediatomb.

This setup is similar to the previous ebuilds posted by KaZeR and Art. The only difference is the creation of a MediaTomb group and setting the home dir to /var/lib/mediatomb.

If upgrading from the previous ebuild, then unmerge MediaTomb and remove /var/lib/mediatomb and /etc/mediatomb directories. Also remove any MediaTomb users or groups before emerging this ebuild.
Comment 22 BT 2007-07-03 14:24:34 UTC
Created attachment 123775 [details]
Updated mediatomb-0.9.1 init script
Comment 23 BT 2007-07-03 14:25:03 UTC
Created attachment 123777 [details]
Updated mediatomb-0.9.1 confd file
Comment 24 Art Wallace 2007-07-03 23:19:33 UTC
BT, do you think the DEPEND and RDEPEND sections are correct? Shouldn't some of the items in DEPEND be moved into runtime dependencies?
Comment 25 BT 2007-07-04 02:12:30 UTC
(In reply to comment #24)
> BT, do you think the DEPEND and RDEPEND sections are correct? Shouldn't some of
> the items in DEPEND be moved into runtime dependencies?
> 

I'm not entirely sure. The Gentoo Development Guide states that DEPEND lists the "dependencies required to unpack, patch, compile or install the package". While RDEPEND lists the "dependencies which are required at runtime".

From the ebuilds that I have taken a look at, most specify all their dependencies in RDEPEND. I would leave as is until a Gentoo developer takes a look at it.
Comment 26 Art Wallace 2007-07-04 09:27:58 UTC
Exactly, they specify dependencies in RDEPEND and we are not. It makes sense that we need stuff like taglib at runtime in addition to compile time.
Comment 27 BT 2007-07-04 12:41:06 UTC
(In reply to comment #26)
> Exactly, they specify dependencies in RDEPEND and we are not. It makes sense
> that we need stuff like taglib at runtime in addition to compile time.
> 

Okay, looking at the dependencies, I think all of them would be added to RDEPEND and DEPEND will be set to RDEPEND. If you think thats the way to go I'll make the change in the next update.

The only other problem with the ebuild that I can see is when it's built with MySQL alone. MediaTomb will fail to start without error and no log file will be created, which might make it difficult for some users.

The reason is that the config.xml file doesn't have a MySQL section. The user needs to add it manually. I was thinking of adding a commented out MySQL section to the config.xml file and a message after emerging, stating the section needs to be uncommented and the correct values (username, paddword, db, host) added.

If both MySQL and SQLite is compiled in, then we need to assume one as the default. I think it's best to have SQLite as it doesn't need any config.

Do you think the ebuild needs anything else? Because I think thats about it.
Comment 28 BT 2007-07-05 09:58:28 UTC
Created attachment 123935 [details]
Updated mediatomb-0.9.1 ebuild

Main Changes:

1. Set all dependencies in RDEPEND and set DEPEND to RDEPEND.
2. Removed the sqlite use flag. If the mysql use flag is not set then MediaTomb is only built with SQLite support. If it is set then MediaTomb will only be built with MySQL support. In the case of MySQL, a message will be printed on post emerge informing the user how to setup up MediaTomb with MySQL.
3. Added user and group options to the confd file to allow the user to set the user and group to run MediaTomb as.
Comment 29 BT 2007-07-05 09:58:52 UTC
Created attachment 123936 [details]
Updated mediatomb-0.9.1 init script
Comment 30 BT 2007-07-05 09:59:12 UTC
Created attachment 123938 [details]
Updated mediatomb-0.9.1 confd file
Comment 31 Art Wallace 2007-07-06 00:12:19 UTC
The config.xml file has this entry <home>/etc/mediatomb</home>.

Does that conflict with the /var/lib/mediatomb directory?
Comment 32 Art Wallace 2007-07-06 00:35:36 UTC
I just tried the newest version of the ebuild and the /var/lib/mediatomb isn't created.

I deleted /var/lib/mediatomb and /etc/mediatomb, unmerged mediatomb and then reinstalled the newest ebuild and it will not start. It claims to start but when you try to stop it it says that it's not running. No mediatomb log file is present either.
Comment 33 Art Wallace 2007-07-06 00:36:17 UTC
Correction, the log file is there.
Comment 34 BT 2007-07-06 00:46:36 UTC
(In reply to comment #32)
> I just tried the newest version of the ebuild and the /var/lib/mediatomb isn't
> created.
> 
> I deleted /var/lib/mediatomb and /etc/mediatomb, unmerged mediatomb and then
> reinstalled the newest ebuild and it will not start. It claims to start but
> when you try to stop it it says that it's not running. No mediatomb log file is
> present either.
> 

You need to completely remove any previous installs of mediatomb. Delete the /etc/mediatomb dir and /var/lib/mediatomb dir if it exists. Also remove the mediatomb user and group if they exist. Make sure that the init script and confd file are also removed. Then try and emerge my version. Make sure you also you my confd, initd and config.xml files.
Comment 35 Art Wallace 2007-07-06 07:33:55 UTC
It was the config file that got me. I never noticed that you had uploaded a new one. It seems to be working now.
Comment 36 BT 2007-07-11 03:03:38 UTC
Created attachment 124504 [details]
Updated mediatomb-0.9.1 ebuild

Forgot to add !mysql? for the sqlite dependency. This will prevent the SQLite source from being fetched even if the mysql use flag is set. There are no other changes.
Comment 37 BT 2007-07-13 07:47:37 UTC
Created attachment 124738 [details]
mediatomb-0.10.0 ebuild

MediaTomb 0.10.0 released. Main features are inotify and playlist support. Full change log here: http://mediatomb.cc/changelog.txt

There are no changes from the previous ebuild.
Comment 38 BT 2007-07-13 11:31:57 UTC
Created attachment 124743 [details]
mediatomb-0.10.0 config.xml file

MediaTomb 0.10.0 generates a slightly different config.xml file.
Comment 39 BT 2007-07-13 12:12:20 UTC
I'm still not entirely satisfied with creating a customised config.xml file as it needs to be updated for every MedaiTomb release.

MediaTomb can automatically generate a config.xml on first startup. Normally it is created in the MediaTomb home dir which by default is ~/.mediatomb. However, since I have set the home dir to /var/lib/mediatomb and split the config.xml in /etc/mediatomb, MediaTomb can't generate a config.xml automatically.

This can be fixed if config.xml is set to /var/lib/mediatomb instead of /etc/mediatomb. This requires starting MediaTomb with -m /var/lib -f mediatomb options. One downside is that the MediaTomb configuration file will be kept in /var/lib/medaitomb instead of the Linux standard /etc. The other I think is that MediaTomb won't update the config.xml file when MediaTomb is upgraded.

The only things we add to the config.xml file is the modified home dir section and the Playstation 3 compatibility section. I would like some feedback on this issue before making any changes, so please post any thoughts you may have. Thanks.
Comment 40 BT 2007-07-21 06:40:10 UTC
After weighing up the advantages and disadvantages of each method of config.xml generation, it seems the best method is manual generation (i.e. the current method). Unless someone comes up with a better method, things will stay as they are.
Comment 41 Mike Lothian 2007-10-04 12:24:48 UTC
Would it be possible for someone to create a live svn ebuild?

They've added transcoding support which is v useful for playing Xvid on your PS3

I'll have a look at it tonight but I'm sure someone hear could produce a neater implementation.

Mike
Comment 42 BT 2007-10-05 02:44:12 UTC
(In reply to comment #41)
> Would it be possible for someone to create a live svn ebuild?
> 
> They've added transcoding support which is v useful for playing Xvid on your
> PS3
> 
> I'll have a look at it tonight but I'm sure someone hear could produce a neater
> implementation.
> 
> Mike
> 

Hi Mike,

I have an SVN ebuild which I have been using to test the new features in MediaTomb. I have also been working closely with the MediaTomb devs to sort out most of the issues. I wasn't planning on posting the SVN ebuild on Bugzilla, so if you want I will email the relevant files to you. You can also find me in the MediaTomb IRC channel.
Comment 43 Brent Baude (RETIRED) gentoo-dev 2008-01-06 03:05:44 UTC
I'm sorta, kind interested in this. May even be goated into putting it into portage when the next version is officially released.
Comment 44 BT 2008-01-06 03:36:57 UTC
(In reply to comment #43)
> I'm sorta, kind interested in this. May even be goated into putting it into
> portage when the next version is officially released.
> 
Hi Brent,

There are currently no UPnP servers that I'm aware of in portage and MediaTomb would be a much needed and requested addition. It is a great app with even greater devs who are very helpful and friendly. Maintaining the MediaTomb ebuild has been fairly easy even with my limited skills so it shouldn't be too much trouble for a Gentoo dev :) I have noticed you on the MediaTomb IRC but you are usually aaway so I haven't had the chance to chat.
Comment 45 Stuart Hickinbottom 2008-01-06 11:28:59 UTC
I'd be very pleased for it to get into the tree. I find it works well (I use it to feed a PS3), and this ebuild seems to be working pretty well now.
Comment 46 Mike Nerone 2008-01-07 23:09:55 UTC
I also use mediatomb to stream to my PS3. It works very well (I do use the 0.10.0 ebuild provided in this bug), and I think the development continues in a very good direction. I would love to have it in the tree.
Comment 47 BT 2008-03-02 02:57:20 UTC
Created attachment 145059 [details]
mediatomb-0.11.0 ebuild

MediaTomb 0.11.0 has been released. The main feature of this release is transcoding support. The full changelog is available here: http://mediatomb.cc/changelog.txt
Comment 48 BT 2008-03-02 02:58:40 UTC
Created attachment 145061 [details]
mediatomb-0.11.0 config.xml file
Comment 49 BT 2008-03-02 02:59:44 UTC
Created attachment 145063 [details]
mediatomb confd file
Comment 50 BT 2008-03-02 03:00:28 UTC
Created attachment 145064 [details]
mediatomb init script
Comment 51 BT 2008-03-03 11:17:32 UTC
Created attachment 145191 [details]
updated mediatomb-0.11.0 ebuild

Added a curl use flag for libcurl support and removed the transcode use flag. Transcoding support is now always enabled as it has no dependencies.
Comment 52 KaZeR 2008-03-04 13:54:10 UTC
Hi everyone. I have a little problem. I think that instead of mediatomb decide which db backend to use, the use flags should force it : in my case, i have mysql installed for another purpose. I don't want to use it for mediatomb. If i emerge mediatomb with mysql disabled, it still detects that mysql is present and wants to use it later, when running it. I'd rather be able to force it to use sqlite. 

I don't know if other people are in my case, i'm waiting for your comments.
Comment 53 BT 2008-03-04 23:14:30 UTC
(In reply to comment #52)
> Hi everyone. I have a little problem. I think that instead of mediatomb decide
> which db backend to use, the use flags should force it : in my case, i have
> mysql installed for another purpose. I don't want to use it for mediatomb. If i
> emerge mediatomb with mysql disabled, it still detects that mysql is present
> and wants to use it later, when running it. I'd rather be able to force it to
> use sqlite. 
> 
> I don't know if other people are in my case, i'm waiting for your comments.
> 

The ebuild uses sqlite by default unless you enable the mysql use flag. When you emerge MT a configuration summary will be printed right after configure finishes. Can you confirm that your configuration summary has sqlite3: yes, mysql: disabled. If somehow MT is being built with mysql support you would still need to enable it in config.xml as the default 0.11.0 config uses sqlite. I have tested with both mysql and -mysql use flags and it works as expected. Can you ensure that you have -mysql for MT in package.use.
Comment 54 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-03-25 21:27:13 UTC
Brent, if you don't mind, I'll look into adding this to portage after some test. I got a PS3 last week and... I have some time in my hands :)

Comment 55 Art Wallace 2008-03-25 21:33:36 UTC
Please add ~ppc to the ebuild before it gets into the tree.
Comment 56 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-03-25 21:39:17 UTC
Only keyword I can add is ~amd64. You'll have to request any other keyword once it gets into portage.

Comment 57 Brent Baude (RETIRED) gentoo-dev 2008-03-26 01:42:45 UTC
Diego,

That's cool.  And thanks.
Comment 58 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-03-27 19:24:28 UTC
Imported version 0.11.0 as net-misc/mediatomb, with a patch to build with current FFmpeg too.
Comment 59 Diego Elio Pettenò (RETIRED) gentoo-dev 2008-04-22 11:34:03 UTC
*** Bug 215412 has been marked as a duplicate of this bug. ***