summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurélien DESBRIÈRES <aurelien@hackers.camp>2014-06-04 07:40:19 +0200
committerAurélien DESBRIÈRES <aurelien@hackers.camp>2014-06-04 07:40:19 +0200
commit9947a5c08c19ac6c6096aa9942805b686566b411 (patch)
treeb64123613081db2cc816496e2ba1700b7323d6d8
parentb3c5fd72f793725b6e90ab8a3b78d73bb81599ee (diff)
mediatomb
-rw-r--r--pcr/mediatomb/PKGBUILD43
-rw-r--r--pcr/mediatomb/mediatomb-mariadb.service13
-rw-r--r--pcr/mediatomb/mediatomb.conf4
-rw-r--r--pcr/mediatomb/mediatomb.install15
-rw-r--r--pcr/mediatomb/mediatomb.service13
-rw-r--r--pcr/mediatomb/symlinks.patch42
6 files changed, 102 insertions, 28 deletions
diff --git a/pcr/mediatomb/PKGBUILD b/pcr/mediatomb/PKGBUILD
index ee2f996e0..562f7fc19 100644
--- a/pcr/mediatomb/PKGBUILD
+++ b/pcr/mediatomb/PKGBUILD
@@ -1,30 +1,33 @@
-# Contributor (Arch): Peter Richard Lewis <plewis@aur.archlinux.org>
-# Contributor (Arch): William Rea <sillywilly@gmail.com>
-# Contributor (Arch): Nikhil Bysani <nikron@gmail.com>
-# Contributor (Arch): Mika Hynnä <igheax@gmail.com>
-# Contributor (Arch): Jonathan Conder <jonno.conder@gmail.com>
-# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.io>
+# Contributor: Martin Villagra <mvillagra0@gmail.com>
+# Contributor: William Rea <sillywilly@gmail.com>
+# Contributor: Nikhil Bysani <nikron@gmail.com>
+# Contributor: Mika Hynnä <igheax@gmail.com>
+# Contributor: Jonathan Conder <jonno.conder@gmail.com>
+# Contributor: Peter Richard Lewis <plewis@aur.archlinux.org>
+# Maintainer : Parabola GNU / Linux-libre Aurélien DESBRIÈRES <aurelien@hackers.camp>
pkgname=mediatomb
pkgver=0.12.1
-pkgrel=11
+pkgrel=12
pkgdesc="Free UPnP/DLNA media server"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'armv6h')
url="http://mediatomb.cc/"
license=('GPL')
-depends=('file' 'curl' 'ffmpegthumbnailer' 'js' 'libexif' 'libmp4v2' 'sqlite3' 'taglib' 'libmysqlclient')
-optdepends=('mysql: to store your music database in mysql')
+depends=('file' 'curl' 'ffmpegthumbnailer' 'libexif' 'libmp4v2' 'sqlite3' 'taglib' 'libmariadbclient' 'js185')
+optdepends=('mariadb: to store your music database in mariadb')
backup=('etc/conf.d/mediatomb')
install=mediatomb.install
source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"
- 'mediatomb.rc'
+ 'mediatomb.service'
+ 'mediatomb-mariadb.service'
'mediatomb.conf'
'gcc46.patch'
'tonewjs.patch'
'jsparse.patch'
'libav_0.7_support.patch'
'libmp4v2_191_p497.patch'
- 'libavformat.patch')
+ 'libavformat.patch'
+ 'symlinks.patch')
build() {
cd "$srcdir/$pkgname-$pkgver"
@@ -34,6 +37,7 @@ build() {
patch -Np1 -i "$srcdir/libav_0.7_support.patch"
patch -Np1 -i "$srcdir/libmp4v2_191_p497.patch"
patch -Np1 -i "$srcdir/libavformat.patch"
+ patch -Np1 -i "$srcdir/symlinks.patch"
./configure --prefix=/usr \
--enable-mysql \
@@ -48,16 +52,7 @@ package() {
make DESTDIR="$pkgdir/" install
- install -D -m0755 "$srcdir/mediatomb.rc" "$pkgdir/etc/rc.d/mediatomb"
- install -D -m0755 "$srcdir/mediatomb.conf" "$pkgdir/etc/conf.d/mediatomb"
- install -d "$pkgdir/var/lib/mediatomb"
+ install -D -m0644 "$srcdir/mediatomb.service" "$pkgdir/usr/lib/systemd/system/mediatomb.service"
+ install -D -m0644 "$srcdir/mediatomb-mariadb.service" "$pkgdir/usr/lib/systemd/system/mediatomb-mariadb.service"
+ install -D -m0644 "$srcdir/mediatomb.conf" "$pkgdir/etc/conf.d/mediatomb"
}
-sha256sums=('31163c34a7b9d1c9735181737cb31306f29f1f2a0335fb4f53ecccf8f62f11cd'
- '1a67a1deb8a41467fe9bbf66358a255f0df97b0170a5fc3d48c1f768c8d328b9'
- 'ba9753a4a380d4c717c987efec03a3c6d401d3ff93a6fced28098adbd3a44cc9'
- '0c02a20032f0c296800b1bb9644638970c2dedbc5ab7141d66a637235e9da6ce'
- '2cd8f5628c3a38b290526f008bae351b90211825f86e5959bf95f140748de574'
- 'd9a3062858900d32b977f0d50d168fd7d36785b6ecc038c019e661e27f7b1c17'
- 'c6523e8bf5e2da89b7475d6777ef9bffe7d089752ef2f7b27b5e39a4130fb0ff'
- 'd39c2f9aab051c5447461718fd0ec72cf5982f6c920a4a985a50831f34babe84'
- '76b11706d70ed8f5e157d96ca441c90c46c42176102fcb651b4ab1102b61bfee')
diff --git a/pcr/mediatomb/mediatomb-mariadb.service b/pcr/mediatomb/mediatomb-mariadb.service
new file mode 100644
index 000000000..5b83f1d78
--- /dev/null
+++ b/pcr/mediatomb/mediatomb-mariadb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=MediaTomb Daemon using MariaDB
+After=mysql.target network.target
+
+[Service]
+EnvironmentFile=/etc/conf.d/mediatomb
+ExecStart=/usr/bin/mediatomb -p $MT_PORT -u $MT_USER -g $MT_GROUP \
+ -P $MT_PIDFILE -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR $MT_OPTIONS
+Restart=on-failure
+RestartSec=5
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/mediatomb/mediatomb.conf b/pcr/mediatomb/mediatomb.conf
index 798018d2a..c2b435f92 100644
--- a/pcr/mediatomb/mediatomb.conf
+++ b/pcr/mediatomb/mediatomb.conf
@@ -6,8 +6,8 @@
MT_PORT='50500'
# User and group to run as
-MT_USER='nobody'
-MT_GROUP='nobody'
+MT_USER='mediatomb'
+MT_GROUP='mediatomb'
# Location of the PID file
MT_PIDFILE='/var/run/mediatomb.pid'
diff --git a/pcr/mediatomb/mediatomb.install b/pcr/mediatomb/mediatomb.install
index 56f6ef92c..27f71d5a4 100644
--- a/pcr/mediatomb/mediatomb.install
+++ b/pcr/mediatomb/mediatomb.install
@@ -1,9 +1,20 @@
post_install() {
+ post_upgrade
+ passwd -l mediatomb &>/dev/null
echo 'Warning: the MediaTomb web interface exposes your filesystem to the network'
echo 'For maximum security, set <ui enabled="no"> in your MediaTomb config file'
}
post_upgrade() {
- # TODO: disable next update
- post_install
+ # create user/group that the daemon will run as by default, do not delete this on uninstall, as it will own files
+ getent group mediatomb >/dev/null || groupadd -g 241 mediatomb &>/dev/null
+ getent passwd mediatomb >/dev/null || useradd -c 'Mediatomb DLNA Server' -u 241 -g mediatomb -b '/var/lib' -m -s /bin/false mediatomb &>/dev/null
+
+ echo 'Attention: By default, MediaTomb now runs as its own user: mediatomb.'
+ echo 'Ensuring ownership of /var/lib/mediatomb is mediatomb:mediatomb...'
+ chown -R mediatomb:mediatomb /var/lib/mediatomb &>/dev/null
+ echo
+ echo 'Please note that the old rc script has been replaced with systemd service files.'
+ echo
}
+
diff --git a/pcr/mediatomb/mediatomb.service b/pcr/mediatomb/mediatomb.service
new file mode 100644
index 000000000..e9869cfb5
--- /dev/null
+++ b/pcr/mediatomb/mediatomb.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=MediaTomb Daemon
+After=network.target
+
+[Service]
+EnvironmentFile=/etc/conf.d/mediatomb
+ExecStart=/usr/bin/mediatomb -p $MT_PORT -u $MT_USER -g $MT_GROUP \
+ -P $MT_PIDFILE -l $MT_LOGFILE -m $MT_HOME -f $MT_CFGDIR $MT_OPTIONS
+Restart=on-failure
+RestartSec=5
+
+[Install]
+WantedBy=multi-user.target
diff --git a/pcr/mediatomb/symlinks.patch b/pcr/mediatomb/symlinks.patch
new file mode 100644
index 000000000..8028f2201
--- /dev/null
+++ b/pcr/mediatomb/symlinks.patch
@@ -0,0 +1,42 @@
+--- mediatomb-0.12.1.orig/src/autoscan_inotify.cc 2010-03-25 10:58:11.000000000 -0400
++++ mediatomb-0.12.1/src/autoscan_inotify.cc 2012-06-18 02:40:11.000000000 -0400
+@@ -281,7 +281,7 @@
+ }
+ }
+
+- if (adir != nil && mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF | IN_CLOSE_WRITE | IN_MOVED_FROM | IN_MOVED_TO | IN_UNMOUNT))
++ if (adir != nil && mask & (IN_DELETE | IN_DELETE_SELF | IN_MOVE_SELF | IN_CLOSE_WRITE | IN_MOVED_FROM | IN_MOVED_TO | IN_UNMOUNT | IN_CREATE))
+ {
+ String fullPath;
+ if (mask & IN_ISDIR)
+@@ -312,16 +312,17 @@
+ if (objectID != INVALID_OBJECT_ID)
+ cm->removeObject(objectID);
+ }
+- if (mask & (IN_CLOSE_WRITE | IN_MOVED_TO))
++ if (mask & (IN_CLOSE_WRITE | IN_MOVED_TO | IN_CREATE))
+ {
+ log_debug("adding %s\n", path.c_str());
+ // path, recursive, async, hidden, low priority, cancellable
+ cm->addFile(fullPath, adir->getRecursive(), true, adir->getHidden(), true, false);
+
+- if (mask & IN_ISDIR)
++ if (mask & IN_ISDIR && !(mask & IN_CREATE))
+ monitorUnmonitorRecursive(path, false, adir, watchAs->getNormalizedAutoscanPath(), false);
+ }
+ }
++
+ if (mask & IN_IGNORED)
+ {
+ removeWatchMoves(wd);
+--- mediatomb-0.12.1.orig/src/content_manager.cc 2010-03-25 10:58:11.000000000 -0400
++++ mediatomb-0.12.1/src/content_manager.cc 2012-06-18 02:03:55.000000000 -0400
+@@ -202,7 +202,7 @@
+ #ifdef HAVE_MAGIC
+ if (! ignore_unknown_extensions)
+ {
+- ms = magic_open(MAGIC_MIME);
++ ms = magic_open(MAGIC_MIME|MAGIC_SYMLINK);
+ if (ms == NULL)
+ {
+ log_error("magic_open failed\n");