New revision, patched to allow launching more than one instance of mt-daapd. Also...
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 21 Oct 2005 10:10:27 +0000 (10:10 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Fri, 21 Oct 2005 10:10:27 +0000 (10:10 +0000)
Package-Manager: portage-2.0.53_rc6

media-sound/mt-daapd/ChangeLog
media-sound/mt-daapd/Manifest
media-sound/mt-daapd/files/digest-mt-daapd-0.2.3-r1 [new file with mode: 0644]
media-sound/mt-daapd/files/mt-daapd-0.2.3-pidfile.patch [new file with mode: 0644]
media-sound/mt-daapd/files/mt-daapd.init.2 [new file with mode: 0755]
media-sound/mt-daapd/mt-daapd-0.2.3-r1.ebuild [new file with mode: 0644]

index ca321af09ef5c6f4dba144834f79523e20f69510..386e68c5e0307f388c3f1157327a45650d74d4f6 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for media-sound/mt-daapd
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/mt-daapd/ChangeLog,v 1.6 2005/10/04 11:21:26 matsuu Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mt-daapd/ChangeLog,v 1.7 2005/10/21 10:10:27 flameeyes Exp $
+
+*mt-daapd-0.2.3-r1 (21 Oct 2005)
+
+  21 Oct 2005; Diego Pettenò <flameeyes@gentoo.org>
+  +files/mt-daapd-0.2.3-pidfile.patch, +files/mt-daapd.init.2,
+  +mt-daapd-0.2.3-r1.ebuild:
+  New revision, patched to allow launching more than one instance of mt-daapd.
+  Also new init.d file that allows symlinked-launches.
 
   04 Oct 2005; MATSUU Takuto <matsuu@gentoo.org> mt-daapd-0.2.3.ebuild:
   Added ~sh.
index cd7bb761c7cddba4307e89a4d8d732a5b6d2220b..efd608b1fdc0a54d540cf52e93cd29ab9cf6859d 100644 (file)
@@ -1,7 +1,21 @@
-MD5 880127a188cf908b0ad84221e48eeebf mt-daapd-0.2.1.1.ebuild 1936
-MD5 14f69e3681187656efa996600cdf20d9 mt-daapd-0.2.3.ebuild 1959
-MD5 1d61529bf228b9567cfbdb265ceef287 ChangeLog 1068
-MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158
-MD5 a83c2c2bb548a45b8b1294e009aff64d files/digest-mt-daapd-0.2.3 66
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 49008576d49eb28b9d32f876c94ba34e ChangeLog 1385
 MD5 804311ec22b1fba76a61411d0c752a15 files/digest-mt-daapd-0.2.1.1 68
+MD5 a83c2c2bb548a45b8b1294e009aff64d files/digest-mt-daapd-0.2.3 66
+MD5 a83c2c2bb548a45b8b1294e009aff64d files/digest-mt-daapd-0.2.3-r1 66
+MD5 b6ec66b0ccfd69869025f1bba1421dd6 files/mt-daapd-0.2.3-pidfile.patch 1918
 MD5 d14aca83cf21b8c519b42962ba276e42 files/mt-daapd.init 540
+MD5 8b57129d12087d53a45cbe6371ad4752 files/mt-daapd.init.2 1214
+MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158
+MD5 880127a188cf908b0ad84221e48eeebf mt-daapd-0.2.1.1.ebuild 1936
+MD5 d0c63660504430046e9346fd83773454 mt-daapd-0.2.3-r1.ebuild 2509
+MD5 14f69e3681187656efa996600cdf20d9 mt-daapd-0.2.3.ebuild 1959
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDWL6xj5H05b2HAEkRAoxZAJ0VgSqEx6+Jmdatic9fZlBj38KnQACfc1Rh
+vdq7xv+YSbzF7OOPCmB+Lhk=
+=Sl37
+-----END PGP SIGNATURE-----
diff --git a/media-sound/mt-daapd/files/digest-mt-daapd-0.2.3-r1 b/media-sound/mt-daapd/files/digest-mt-daapd-0.2.3-r1
new file mode 100644 (file)
index 0000000..b3d3908
--- /dev/null
@@ -0,0 +1 @@
+MD5 17aa3fa0601cbe172d18f53489141e5a mt-daapd-0.2.3.tar.gz 406035
diff --git a/media-sound/mt-daapd/files/mt-daapd-0.2.3-pidfile.patch b/media-sound/mt-daapd/files/mt-daapd-0.2.3-pidfile.patch
new file mode 100644 (file)
index 0000000..50ad82c
--- /dev/null
@@ -0,0 +1,51 @@
+Index: mt-daapd-0.2.3/src/main.c
+===================================================================
+--- mt-daapd-0.2.3.orig/src/main.c
++++ mt-daapd-0.2.3/src/main.c
+@@ -551,6 +551,7 @@ void usage(char *program) {
+     printf("  -m             Disable mDNS\n");
+     printf("  -c <file>      Use configfile specified\n");
+     printf("  -p             Parse playlist file\n");
++    printf("  -P <file>      Write the PID to specified file\n");
+     printf("  -f             Run in foreground\n");
+     printf("  -y             Yes, go ahead and run as non-root user\n");
+     printf("\n\n");
+@@ -708,6 +709,7 @@ int start_signal_handler(pthread_t *hand
+ int main(int argc, char *argv[]) {
+     int option;
+     char *configfile=DEFAULT_CONFIGFILE;
++    char *pidfile=PIDFILE;
+     WSCONFIG ws_config;
+     WSHANDLE server;
+     int parseonly=0;
+@@ -726,7 +728,7 @@ int main(int argc, char *argv[]) {
+     config.use_mdns=1;
+     err_debuglevel=1;
+ 
+-    while((option=getopt(argc,argv,"D:d:c:mpfry")) != -1) {
++    while((option=getopt(argc,argv,"D:d:c:mpP:fry")) != -1) {
+       switch(option) {
+       case 'd':
+           err_debuglevel=atoi(optarg);
+@@ -754,6 +756,10 @@ int main(int argc, char *argv[]) {
+           foreground=1;
+           break;
+ 
++      case 'P':
++          pidfile=optarg;
++          break;
++
+       case 'r':
+           reload=1;
+           break;
+@@ -803,8 +809,8 @@ int main(int argc, char *argv[]) {
+ 
+     /* open the pidfile, so it can be written once we detach */
+     if((!foreground) && (!force_non_root)) {
+-      if(-1 == (pid_fd = open(PIDFILE,O_CREAT | O_WRONLY | O_TRUNC, 0644)))
+-          DPRINTF(E_FATAL,L_MAIN,"Error opening pidfile (%s): %s\n",PIDFILE,strerror(errno));
++      if(-1 == (pid_fd = open(pidfile,O_CREAT | O_WRONLY | O_TRUNC, 0644)))
++          DPRINTF(E_FATAL,L_MAIN,"Error opening pidfile (%s): %s\n",pidfile,strerror(errno));
+ 
+       if(0 == (pid_fp = fdopen(pid_fd, "w")))
+           DPRINTF(E_FATAL,L_MAIN,"fdopen: %s\n",strerror(errno));
diff --git a/media-sound/mt-daapd/files/mt-daapd.init.2 b/media-sound/mt-daapd/files/mt-daapd.init.2
new file mode 100755 (executable)
index 0000000..05c7265
--- /dev/null
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mt-daapd/files/mt-daapd.init.2,v 1.1 2005/10/21 10:10:27 flameeyes Exp $
+# Somehow based on init.d file shipped with mt-daapd itself.
+#
+# You can run multiple copies of this service just symlinking them to
+# mt-daapd.<name>, then it will load /etc/mt-daapd.d/<name>.conf as config
+# file.
+# Remember to give them different logs and cache directories.
+#
+# The main instance (with no <name>) uses /etc/mt-daapd.conf
+
+CONF="${myservice##*.}"
+if [[ -n ${CONF} && ${myservice} != "mt-daapd" ]]; then
+       PIDFILE="/var/run/mt-daapd.${CONF}.pid"
+       CONFFILE="/etc/mt-daapd.d/${CONF}.conf"
+else
+       PIDFILE="/var/run/mt-daapd.pid"
+       CONFFILE="/etc/mt-daapd.conf"
+fi
+
+depend() {
+       need net
+       #USEHOWL need mDNSResponder
+       provide daap
+}
+
+start() {
+       ebegin "Starting mt-daapd DAAP server"
+       start-stop-daemon --start --quiet --pidfile ${PIDFILE} \
+               --exec /usr/sbin/mt-daapd -- -P ${PIDFILE} -c ${CONFFILE}
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping mt-daapd DAAP server"
+       start-stop-daemon --stop --quiet --pidfile ${PIDFILE} --signal 2
+       eend $?
+
+       rm -f ${PIDFILE}
+}
diff --git a/media-sound/mt-daapd/mt-daapd-0.2.3-r1.ebuild b/media-sound/mt-daapd/mt-daapd-0.2.3-r1.ebuild
new file mode 100644 (file)
index 0000000..f3e80f7
--- /dev/null
@@ -0,0 +1,101 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/mt-daapd/mt-daapd-0.2.3-r1.ebuild,v 1.1 2005/10/21 10:10:27 flameeyes Exp $
+
+inherit flag-o-matic eutils
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="A multi-threaded implementation of Apple's DAAP server"
+HOMEPAGE="http://www.mt-daapd.org/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sh ~x86"
+IUSE="debug howl vorbis"
+
+DEPEND="sys-libs/zlib
+       media-libs/libid3tag
+       sys-libs/gdbm
+       debug? ( dev-util/efence )
+       howl? ( >=net-misc/howl-0.9.2 )
+       vorbis? ( media-libs/libvorbis )"
+
+src_unpack() {
+       unpack ${A}
+       cd ${S}
+       epatch ${FILESDIR}/${P}-pidfile.patch
+}
+
+src_compile() {
+       local myconf=""
+
+       # debugging support?
+       if use debug; then
+               myconf="${myconf} --enable-debug --enable-debug-memory --enable-efence"
+       fi
+
+       # howl support?
+       if use howl; then
+               myconf="${myconf} --enable-howl"
+               myconf="${myconf} --with-howl-libs=/usr/$(get_libdir)"
+               myconf="${myconf} --with-howl-includes=/usr/include/howl"
+       fi
+
+       # Bug 65723
+       if use vorbis; then
+               myconf="${myconf} --enable-oggvorbis"
+       fi
+
+       econf ${myconf} || die "configure failed"
+       emake || die "make failed"
+
+       cp ${FILESDIR}/${PN}.init.2 ${WORKDIR}/initd
+       use howl && \
+               sed -i -e 's:#USEHOWL ::' ${WORKDIR}/initd || \
+               sed -i -e '/#USEHOWL/d' ${WORKDIR}/initd
+}
+
+src_install() {
+       make DESTDIR=${D} install || die "make install failed"
+
+       insinto /etc
+       newins contrib/mt-daapd.conf mt-daapd.conf.example
+       doins contrib/mt-daapd.playlist
+
+       newinitd ${WORKDIR}/initd ${PN}
+
+       keepdir /var/cache/mt-daapd /etc/mt-daapd.d
+
+       dodoc AUTHORS CREDITS ChangeLog NEWS README TODO
+}
+
+pkg_postinst() {
+       einfo
+       einfo "You have to configure your mt-daapd.conf following"
+       einfo "/etc/mt-daapd.conf.example file."
+       einfo
+
+       if use howl; then
+               einfo
+               einfo "Since you want to use howl instead of the internal mdnsd"
+               einfo "you need to make sure that you have mDNSResponder configured"
+               einfo "and running to use mt-daapd."
+               einfo
+       fi
+
+       if use vorbis; then
+               einfo
+               einfo "You need to edit you extensions list in /etc/mt-daapd.conf"
+               einfo "if you want your mt-daapd to serve ogg files."
+               einfo
+       fi
+
+       einfo
+       einfo "If you want to start more than one ${PN} service, symlink"
+       einfo "/etc/init.d/${PN} to /etc/init.d/${PN}.<name>, and it will"
+       einfo "load the data from /etc/${PN}.d/<name>.conf."
+       einfo "Make sure that you have different cache directories for them."
+       einfo
+}