[suggest] mediatomb spec file for CentOS 5.2
Jollyroger
rpmforge at crawford.homeunix.net
Mon Jul 14 19:55:39 CEST 2008
Note that I'm not on the suggest mailing list, so please make sure I'm
in the send to list if replying. Please bare with me as this is the
first time I'm doing this if I do something wrong.
WARNING: This package creates a group and user "mediatomb" with the
uid/gid of 62. I don't know if that uid/gid is used anywhere else. If
someone has a better suggestion please let me know and I'll change it
and repost
I don't mind being contacted if a new version of mediatomb comes out and
I haven't seen it yet and you want the new version. I'll try to stay up
to date but I haven't found a mediatomb announce list to subscribe to.
Jeffrey
-------------- next part --------------
Summary: an open source (GPL) UPnP MediaServer with a nice web user interface
# I'm hopping that the uid/gid 62 is not used anywhere else, please report if
# that is not the case!
%define version 0.11.0
%define usr mediatomb
%define uid 62
%define grp mediatomb
%define gid 62
# Put path locations in variables to ease changes
%define config_dir %{_sysconfdir}/mediatomb
%define init_dir %{_sysconfdir}/rc.d/init.d
%define pid_dir %{_var}/run/mediatomb
%define log_dir %{_var}/log/mediatomb
Requires: bash >= 3.2-21
Requires: ffmpeg >= 0.4.9-0.9.20070530
Requires: libexif >= 0.6.13-4.0.2
Requires: expat >= 1.95.8-8.2.1
Requires: libgcc >= 4.1.2-42
Requires: js >= 1.60
Requires: file >= 4.17-13
Requires: sqlite >= 3.3.6-2
Requires: taglib >= 1.5
Requires: libstdc++ >= 4.1.2-42
Requires: zlib >= 1.2.3-3
BuildRequires: ffmpeg-devel >= 0.4.9-0.9.20070530
BuildRequires: libexif-devel >= 0.6.13-4.0.2
BuildRequires: expat-devel >= 1.95.8-8.2.1
BuildRequires: js-devel >= 1.60
BuildRequires: sqlite-devel >= 3.3.6-2
BuildRequires: taglib-devel >= 1.5
BuildRequires: libstdc++-devel >= 4.1.2-42
BuildRequires: zlib-devel >= 1.2.3-3
Release: 1.el5
Source1: mediatomb-etc-init.d
Source2: mediatomb-etc-logrotate.d
Source3: mediatomb-etc-mediatomb-config.xml
Group: System Environment/Daemons
Name: mediatomb
Prefix: %{_prefix}
Provides: mediaserver
Source: http://downloads.sourceforge.net/mediatomb/mediatomb-%{version}.tar.gz
Patch1: mediatomb_centos.patch
Buildroot: /tmp/mediatomb-%{version}
URL: http://mediatomb.cc/
Version: %{version}
License: MediaTomb is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. MediaTomb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License version 2 along with MediaTomb; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
%description
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.
To contact us via email, write to: contact at mediatomb dot cc
We have an IRC support channel on the freenode network: chat.freenode.net, #mediatomb. Feel free to join if you have questions or need help with MediaTomb, but be patient since we may be idle (btw. we are in C.E.T.). Also, make sure to visit our support forums since the answer may already be there.
%pre
%{_sbindir}/groupadd -g %{gid} -r %{grp} 2> /dev/null
%{_sbindir}/useradd -d %{config_dir} -s /sbin/nologin -g %{grp} -M -r -u %{uid} %{usr} 2> /dev/null
exit 0
%post
/sbin/chkconfig --add mediatomb
/sbin/chkconfig mediatomb on
%preun
/sbin/service mediatomb stop > /dev/null 2>&1
if [ "$1" = 0 ]; then
# Package is being removed so stop mediatomb
# and remove it from the init system.
/sbin/chkconfig --del mediatomb > /dev/null 2>&1
fi
exit 0
%postun
if [ "$1" = 1 ]; then
# We are upgrading so we need to restart mediatomb
/sbin/service mediatomb restart > /dev/null 2>&1
fi
if [ "$1" = 0 ]; then
# Do some package cleanup since this is a stright uninstall
%{_sbindir}/userdel -f %{usr} > /dev/null 2>&1
%{_sbindir}groupdel -f %{grp} > /dev/null 2>&1
fi
exit 0
%prep
%setup -q
%patch1 -p1 -b .centos5
%build
./configure --prefix=%{buildroot}/%{_prefix}
%{__make}
%install
%{__rm} -rf %{buildroot}
%{__make} install
%{__mkdir_p} %{buildroot}/%{init_dir}
%{__install} -c -m 755 %{SOURCE1} %{buildroot}/%{init_dir}/mediatomb
%{__mkdir_p} %{buildroot}/etc/logrotate.d
%{__install} -c -m 644 %{SOURCE2} %{buildroot}/etc/logrotate.d/mediatomb
%{__mkdir_p} %{buildroot}/etc/mediatomb
%{__install} -c -m 644 %{SOURCE3} %{buildroot}/etc/mediatomb/config.xml
%{__mkdir_p} %{buildroot}/%{pid_dir}
%{__mkdir_p} %{buildroot}/%{log_dir}
%files
%defattr(-,root,root)
# Start with the directories and configuration files.
%dir %{_datadir}/mediatomb
%dir %{_datadir}/mediatomb/js
%dir %{_datadir}/mediatomb/web
%dir %{_datadir}/mediatomb/web/icons
%dir %{_datadir}/mediatomb/web/icons/nanotree
%dir %{_datadir}/mediatomb/web/icons/nanotree/images
%dir %{_datadir}/mediatomb/web/js
%dir %attr(0755,%{usr},%{grp}) %{log_dir}
%dir %attr(0755,%{usr},%{grp}) %{pid_dir}
%dir %attr(0755,%{usr},%{grp}) %{config_dir}
%config(noreplace) %attr(0644,%{usr},%{grp}) %{config_dir}/config.xml
# List of files included in this package
%{_sysconfdir}/rc.d/init.d/mediatomb
%{_sysconfdir}/logrotate.d/mediatomb
%{_bindir}/mediatomb
%{_datadir}/mediatomb/mappings.xml
%{_datadir}/mediatomb/mysql.sql
%{_datadir}/mediatomb/js/import.js
%{_datadir}/mediatomb/js/playlists.js
%{_datadir}/mediatomb/js/common.js
%{_datadir}/mediatomb/web/cds.xml
%{_datadir}/mediatomb/web/disabled.html
%{_datadir}/mediatomb/web/mr_reg.xml
%{_datadir}/mediatomb/web/std_treelook.css
%{_datadir}/mediatomb/web/icons/autoscan_inotify_folder_open.png
%{_datadir}/mediatomb/web/icons/blank.png
%{_datadir}/mediatomb/web/icons/mt-icon120.png
%{_datadir}/mediatomb/web/icons/remove_autoscan.png
%{_datadir}/mediatomb/web/icons/remove_this.png
%{_datadir}/mediatomb/web/icons/status_loading.png
%{_datadir}/mediatomb/web/icons/status_updates_pending.png
%{_datadir}/mediatomb/web/icons/mediatomb.png
%{_datadir}/mediatomb/web/icons/film.png
%{_datadir}/mediatomb/web/icons/document-new.png
%{_datadir}/mediatomb/web/icons/mt-icon48.png
%{_datadir}/mediatomb/web/icons/mt-icon32.bmp
%{_datadir}/mediatomb/web/icons/go-previous.png
%{_datadir}/mediatomb/web/icons/stock-add.png
%{_datadir}/mediatomb/web/icons/folder_new.png
%{_datadir}/mediatomb/web/icons/mt-icon48.jpg
%{_datadir}/mediatomb/web/icons/go-next.png
%{_datadir}/mediatomb/web/icons/autoscan_timed_folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_inotify_folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/plus_last_no_root.png
%{_datadir}/mediatomb/web/icons/nanotree/images/plus_last.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_timed_folder_closed.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_inotify_folder_closed.png
%{_datadir}/mediatomb/web/icons/nanotree/images/minus_last_no_root.png
%{_datadir}/mediatomb/web/icons/nanotree/images/t_no_root.png
%{_datadir}/mediatomb/web/icons/nanotree/images/plus_no_root.png
%{_datadir}/mediatomb/web/icons/nanotree/images/minus.png
%{_datadir}/mediatomb/web/icons/nanotree/images/t.png
%{_datadir}/mediatomb/web/icons/nanotree/images/lastnode.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_timed_folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/plus.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_timed_config_folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/minus_last.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_inotify_config_folder_closed.png
%{_datadir}/mediatomb/web/icons/nanotree/images/line.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_inotify_config_folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/folder_open.png
%{_datadir}/mediatomb/web/icons/nanotree/images/autoscan_timed_config_folder_closed.png
%{_datadir}/mediatomb/web/icons/nanotree/images/folder_closed.png
%{_datadir}/mediatomb/web/icons/nanotree/images/minus_no_root.png
%{_datadir}/mediatomb/web/icons/nanotree/images/white.png
%{_datadir}/mediatomb/web/icons/autoscan_timed_config_folder_open.png
%{_datadir}/mediatomb/web/icons/mt-icon32.png
%{_datadir}/mediatomb/web/icons/status.png
%{_datadir}/mediatomb/web/icons/stock_edit.png
%{_datadir}/mediatomb/web/icons/stock_exit.png
%{_datadir}/mediatomb/web/icons/autoscan_inotify_config_folder_open.png
%{_datadir}/mediatomb/web/icons/mt-icon48.bmp
%{_datadir}/mediatomb/web/icons/go-last.png
%{_datadir}/mediatomb/web/icons/mt-icon32.jpg
%{_datadir}/mediatomb/web/icons/add_as_autoscan.png
%{_datadir}/mediatomb/web/icons/mt-icon120.bmp
%{_datadir}/mediatomb/web/icons/mt-icon120.jpg
%{_datadir}/mediatomb/web/icons/go-first.png
%{_datadir}/mediatomb/web/icons/remove_all.png
%{_datadir}/mediatomb/web/icons/folder_open.png
%{_datadir}/mediatomb/web/icons/blank.gif
%{_datadir}/mediatomb/web/right.html
%{_datadir}/mediatomb/web/left.html
%{_datadir}/mediatomb/web/index.html
%{_datadir}/mediatomb/web/cm.xml
%{_datadir}/mediatomb/web/js/iepngfix.htc
%{_datadir}/mediatomb/web/js/nanotree.js
%{_datadir}/mediatomb/web/js/items.js
%{_datadir}/mediatomb/web/js/autoscan.js
%{_datadir}/mediatomb/web/js/tree.js
%{_datadir}/mediatomb/web/js/md5.js
%{_datadir}/mediatomb/web/js/tasks.js
%{_datadir}/mediatomb/web/js/tools.js
%{_datadir}/mediatomb/web/js/prototype.js
%{_datadir}/mediatomb/web/js/auth.js
%{_datadir}/mediatomb/web/js/icons.js
%{_datadir}/mediatomb/web/main.css
%{_datadir}/mediatomb/web/top.html
%{_datadir}/mediatomb/web/topright.html
%{_datadir}/mediatomb/web/topleft.html
%{_datadir}/mediatomb/web/favicon.ico
%{_datadir}/mediatomb/sqlite3.sql
%doc %{_mandir}/man1/mediatomb.1.gz
%doc README INSTALL README.centos
%clean
rm -rf %{buildroot}
%changelog
* Mon Jun 30 2008 Jeffrey Crawford
<rpmforge at crawford.homeunix.net> 0.11.0-1.el5
- Inital mediatomb packaging for CentOS
-------------- next part --------------
diff -Naur mediatomb-0.11.0.orig/README.centos mediatomb-0.11.0/README.centos
--- mediatomb-0.11.0.orig/README.centos 1969-12-31 16:00:00.000000000 -0800
+++ mediatomb-0.11.0/README.centos 2008-07-01 16:12:59.000000000 -0700
@@ -0,0 +1,17 @@
+IMPORTANT NOTES:
+Assuming that CentOS is used for production servers. I felt it prudent to make
+sure that mediatomb is run as an unprivilaged user. The default user is set up
+to be "mediatomb". If you want to be able to share your media files, make sure
+that the "mediatomb" user or "mediatomb" group can read your content.
+
+QUICK START:
+Point your browser to http://<yourservername>:49152/ to start adding files that
+you want to share with a media device on your network
+
+The configuration file can be found in /etc/mediatomb/config.xml. There are
+comments in the file to set up the server to interact with some media devices.
+Playstation 3 for example can be found by searching for "PS3". Some options are
+set or changed depending on what devices you are integrating with.
+
+Note the comment as well to remove the "PC Directory" folder that is listed in
+your media device.
-------------- next part --------------
#! /bin/bash
#
# mediatomb Start/Stop the media server.
#
# chkconfig: 2345 95 55
# description: MediaTomb is a UPnP compatable media player.
# processname: mediatomb
# config: /etc/mediatomb
# pidfile: /var/run/mediatomb/mediatomb.pid
# Source function library.
. /etc/init.d/functions
prog="mediatomb"
pidfile="/var/run/mediatomb/mediatomb.pid"
config="/etc/mediatomb"
logfile="/var/log/mediatomb/mediatomb.log"
user="mediatomb"
group="mediatomb"
start() {
echo -n $"Starting $prog: "
if [ -e $pidfile ] && [ -e /proc/`cat $pidfile` ]; then
echo -n $"cannot start $prog: $prog is already running.";
failure $"cannot start $prog: $prog already running.";
echo
return 1
fi
daemon $prog -c $config/config.xml -d -P $pidfile -l $logfile \
-u $user -g $user
RETVAL=$?
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ ! -e $pidfile ] && [ ! -e /proc`cat $pidfile 2> /dev/null` ]; then
echo -n $"cannot stop $prog: $prog is not running."
failure $"cannot stop $prog: $prog is not running."
echo
return 1;
fi
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f $pidfile;
return $RETVAL
}
rhstatus() {
status $prog
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $prog daemon configuration: "
killproc $prog -HUP
RETVAL=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart}"
exit 1
esac
-------------- next part --------------
/var/log/mediatomb/*.log {
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/mediatomb/mediatomb.pid 2> /dev/null` 2> /dev/null || true
endscript
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mediatomb-etc-mediatomb-config.xml
Type: text/xml
Size: 5015 bytes
Desc: not available
Url : http://lists.rpmforge.net/pipermail/suggest/attachments/20080714/8601e44c/mediatomb-etc-mediatomb-config.xml
More information about the suggest
mailing list