Initial version committed to portage.
authorJeremy Huddleston <eradicator@gentoo.org>
Wed, 31 Mar 2004 02:20:20 +0000 (02:20 +0000)
committerJeremy Huddleston <eradicator@gentoo.org>
Wed, 31 Mar 2004 02:20:20 +0000 (02:20 +0000)
media-sound/daapd/ChangeLog [new file with mode: 0644]
media-sound/daapd/Manifest [new file with mode: 0644]
media-sound/daapd/daapd-0.2.1d.ebuild [new file with mode: 0644]
media-sound/daapd/files/0.2.1d-makefile-gentoo.patch [new file with mode: 0644]
media-sound/daapd/files/0.2.1d-zeroconf-gentoo.patch [new file with mode: 0644]
media-sound/daapd/files/daapd.conf.d [new file with mode: 0644]
media-sound/daapd/files/daapd.init.d [new file with mode: 0644]
media-sound/daapd/files/digest-daapd-0.2.1d [new file with mode: 0644]
media-sound/daapd/metadata.xml [new file with mode: 0644]

diff --git a/media-sound/daapd/ChangeLog b/media-sound/daapd/ChangeLog
new file mode 100644 (file)
index 0000000..4bb9349
--- /dev/null
@@ -0,0 +1,20 @@
+# ChangeLog for net-misc/daapd
+# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/daapd/ChangeLog,v 1.1 2004/03/31 02:20:20 eradicator Exp $
+
+*daapd-0.2.1d (30 Mar 2004)
+
+  30 Mar 2004; Jeremy Huddleston <eradicator@gentoo.org> daapd-0.2.1d.ebuild,
+  metadata.xml, files/0.2.1d-makefile-gentoo.patch,
+  files/0.2.1d-zeroconf-gentoo.patch, files/daapd.conf.d, files/daapd.init.d:
+  Initial version committed to portage.
+
+  20 Dec 2003; Sandy McArthur <sandymac@gentoo.org> 0.2.1d-zeroconf-gentoo.patch :
+  Improved DNS-SD support so that the TXT records are also published.
+
+  19 Dec 2003; Sandy McArthur <sandymac@gentoo.org> :
+  Initial import.  Ebuild submitted by Sandy McArthur <sandymac@gentoo.org>.
+  New upstream relase: "Added support for comments / the ID3 comment field"
+  Reworked ebuild to use patches and support the Howl zeroconf implementation
+  when 'zeroconf' is in your USE flags.
+
diff --git a/media-sound/daapd/Manifest b/media-sound/daapd/Manifest
new file mode 100644 (file)
index 0000000..449b96d
--- /dev/null
@@ -0,0 +1,8 @@
+MD5 9f26af5846d13e4e8ed22808af4099a6 daapd-0.2.1d.ebuild 1288
+MD5 1be9946c20b864575e94711122d33a8b ChangeLog 975
+MD5 67fa7232a65762eb47d8773c5fb33811 metadata.xml 592
+MD5 7a3db9af72f07dd5df2a9a903567fc0c files/daapd.conf.d 684
+MD5 2e484ccb2683810b8ff7da709ede8c12 files/daapd.init.d 1057
+MD5 71d5acf0144c38a510d37e388e6f4b4d files/0.2.1d-zeroconf-gentoo.patch 5182
+MD5 6a94f39460d57008cfec35d65b784951 files/0.2.1d-makefile-gentoo.patch 343
+MD5 d288598cd3334e91bb0822932d8cdd96 files/digest-daapd-0.2.1d 60
diff --git a/media-sound/daapd/daapd-0.2.1d.ebuild b/media-sound/daapd/daapd-0.2.1d.ebuild
new file mode 100644 (file)
index 0000000..47d33c4
--- /dev/null
@@ -0,0 +1,48 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-sound/daapd/daapd-0.2.1d.ebuild,v 1.1 2004/03/31 02:20:20 eradicator Exp $
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="daapd scans a directory for mp3 files and makes them available via the Apple proprietary protocol DAAP"
+HOMEPAGE="http://www.deleet.de/projekte/daap/daapd/"
+SRC_URI="http://www.deleet.de/projekte/daap/daapd/${P}.tgz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+DEPEND="sys-libs/zlib
+       >=media-libs/libid3tag-0.15.0b
+       >=net-libs/libhttpd-persistent-1.3p-r6
+       media-libs/daaplib
+       >=net-misc/howl-0.9"
+
+src_unpack() {
+       unpack ${A}
+       epatch ${FILESDIR}/${PV}-makefile-gentoo.patch
+       epatch ${FILESDIR}/${PV}-zeroconf-gentoo.patch
+}
+
+src_compile() {
+       if eval [ -d "/usr/include/howl-*" ]; then
+               INCPATH="-I "`echo /usr/include/howl-*` || die "Can't find howl includes."
+       fi
+
+       emake INCPATH="${INCPATH}" || die
+}
+
+src_install() {
+       # Not an automake build :(
+       dobin daapd
+
+       dodoc COPYING INSTALL.irix README daapd-example.conf
+
+       insinto /etc
+       newins daapd-example.conf daapd.conf
+
+       insinto /etc/conf.d
+       newins ${FILESDIR}/daapd.conf.d daapd || die
+
+       exeinto /etc/init.d
+       newexe ${FILESDIR}/daapd.init.d daapd || die
+}
diff --git a/media-sound/daapd/files/0.2.1d-makefile-gentoo.patch b/media-sound/daapd/files/0.2.1d-makefile-gentoo.patch
new file mode 100644 (file)
index 0000000..67945ea
--- /dev/null
@@ -0,0 +1,9 @@
+diff -u daapd-0.2.1d.orig/makefile daapd-0.2.1d/makefile
+--- daapd-0.2.1d.orig/makefile 2003-12-02 16:43:14.000000000 -0500
++++ daapd-0.2.1d/makefile      2003-12-19 15:38:10.000000000 -0500
+@@ -1,4 +1,4 @@
+-CC = c++
++CC = g++
+ TARGET = daapd
+ OBJS = daapd.o db.o dboutput.o songcache.o parsemp3.o
+ LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz
diff --git a/media-sound/daapd/files/0.2.1d-zeroconf-gentoo.patch b/media-sound/daapd/files/0.2.1d-zeroconf-gentoo.patch
new file mode 100644 (file)
index 0000000..f2a5c19
--- /dev/null
@@ -0,0 +1,199 @@
+diff -u daapd-0.2.1d.makefile/daapd.cc daapd-0.2.1d/daapd.cc
+--- daapd-0.2.1d.makefile/daapd.cc     2003-12-02 16:43:55.000000000 -0500
++++ daapd-0.2.1d/daapd.cc      2003-12-20 17:22:08.000000000 -0500
+@@ -38,6 +38,12 @@
+ #include <daap/tagoutput.h>
+ #include <daap/registry.h>
++#ifdef HOWL_DNSREGISTRATION
++#include <rendezvous/rendezvous.h>
++#include <rendezvous/text_record.h>
++#include <salt/salt.h>
++#endif
++
+ const int   DAAP_OK     = 200;
+ const char* DAAPD_VERSION = "daapd 0.2.1b";
+@@ -775,6 +781,39 @@
+       return &initParams;
+ }
++#ifdef HOWL_DNSREGISTRATION
++static sw_result
++my_service_reply(
++              sw_rendezvous_publish_handler   handler,
++              sw_rendezvous                   rendezvous,
++              sw_rendezvous_publish_status    status,
++              sw_rendezvous_publish_id        id,
++              sw_opaque                       extra)
++{
++      static sw_string
++              status_text[] =
++              {
++                      "Started",
++                      "Stopped",
++                      "Name Collision",
++                      "Invalid"
++              };
++
++      fprintf(stderr, "publish reply: %s\n", status_text[status]);
++      return SW_OKAY;
++}
++
++int addTextRecord( sw_text_record text_record, sw_const_string key, sw_const_string val )
++{
++      sw_result       result;
++      if ((result = sw_text_record_add_key_and_string_value(text_record, key, val)) != SW_OKAY)
++      {
++              fprintf(stderr, "sw_text_record_add_string(%s, %s) failed with: %lu\n", key, val, result);
++              return result;
++      }
++      return 0;
++}
++#endif
+ ////////////
+ // main
+@@ -786,6 +825,14 @@
+       int buflen = 255;
+       char buffer[buflen];
++#ifdef HOWL_DNSREGISTRATION
++      sw_rendezvous                   session;
++      sw_salt                         salt;
++      sw_text_record                  text_record;
++      sw_result                       result;
++      sw_rendezvous_publish_id        id;
++#endif
++
+       if( gethostname( buffer, buflen ) == 0 ) {
+               initParams.serverName = (char *)buffer;
+               initParams.dbName = (char *)buffer;
+@@ -800,6 +847,25 @@
+               initParams.dirs->push_back( dir );
+       }
++#ifdef HOWL_DNSREGISTRATION
++      if (sw_rendezvous_init(&session) != SW_OKAY)
++      {
++              fprintf(stderr, "sw_rendezvous_init() failed\n");
++              return -1;
++      }
++      if (sw_rendezvous_salt(session, &salt) != SW_OKAY)
++      {
++              fprintf(stderr, "sw_rendezvous_salt() failed\n");
++              return -1;
++      }
++
++      if (sw_text_record_init(&text_record) != SW_OKAY)
++      {
++              fprintf(stderr, "sw_text_record_init() failed\n");
++              return -1;
++      }
++#endif
++
+       cout << "scanning " << initParams.dirs << " for mp3s... " << flush;
+       Database db( initParams );
+       cout << "done. " << endl;
+@@ -818,12 +884,67 @@
+       httpdAddCSiteContent( server, parseRequest, (void*)&db );
+       httpdSetContentType( server, "application/x-dmap-tagged" );
++#ifdef HOWL_DNSREGISTRATION
++      // Set up the DNS-SD TXT records
++      if ((result = addTextRecord(text_record, "txtvers", "1")) != SW_OKAY)
++      {
++              return result;
++      }
++
++      if ((result = addTextRecord(text_record, "Version", "131072")) != SW_OKAY)
++      {
++              return result;
++      }
++
++      char tmpstr[16];
++      sprintf(tmpstr, "%i", db.id);
++      if ((result = addTextRecord(text_record, "Database ID", tmpstr)) != SW_OKAY)
++      {
++              return result;
++      }
++
++      // TODO Add 'Machine ID' record like iTunes does.
++
++      if ((result = addTextRecord(text_record, "Machine Name", initParams.serverName.c_str())) != SW_OKAY)
++      {
++              return result;
++      }
++
++      if ((result = addTextRecord(text_record, "Password", (initParams.password.length() > 0) ? "true" : "false")) != SW_OKAY)
++      {
++              return result;
++      }
++
++      if ((result = sw_rendezvous_publish(session,
++                                      initParams.serverName.c_str(),
++                                      "_daap._tcp",
++                                      NULL,
++                                      NULL,
++                                      initParams.port,
++                                      sw_text_record_bytes(text_record),
++                                      sw_text_record_len(text_record),
++                                      NULL,
++                                      my_service_reply,
++                                      NULL,
++                                      &id)) != SW_OKAY)
++      {
++              fprintf(stderr, "sw_rendezvous_publish() failed: %ld\n", result);
++              return -1;
++      }
++#endif
++
++
+       struct timeval timeout;
+       timeout.tv_sec  = 10;
+       timeout.tv_usec = 0;
+       while( true ) {
++#ifdef HOWL_DNSREGISTRATION
++              sw_ulong msecs = 0; // Tells sw_salt_step to simply poll
++              sw_salt_step(salt, &msecs);
++#endif
++
+               httpdSelectLoop( server, timeout );
+               // stuff like regular db updates could be added here
+       }
+diff -u daapd-0.2.1d.makefile/makefile daapd-0.2.1d/makefile
+--- daapd-0.2.1d.makefile/makefile     2003-12-19 15:38:10.000000000 -0500
++++ daapd-0.2.1d/makefile      2003-12-20 17:26:20.000000000 -0500
+@@ -1,22 +1,24 @@
+ CC = g++
+ TARGET = daapd
+ OBJS = daapd.o db.o dboutput.o songcache.o parsemp3.o
+-LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz
+-LIBPATH = -L. -L/usr/local/lib
+-INCPATH = -I. -I/usr/local/include
++OBJS2 = /usr/lib/libsalt.so /usr/lib/libcorby.so /usr/lib/librendezvous.so
++LIBS = -ldaaplib -lhttpd-persistent -lid3tag -lz -lcorby -lsalt -lrendezvous -lpthread
++LIBPATH = -L. -L/usr/lib -L/usr/local/lib
++INCPATH = -I. -I/usr/local/include -I/usr/include/howl-0.9
+ DEPLOY = /usr/local/bin
+ CFLAGS = -Wall -Wno-multichar
++DEFS = -DHOWL_DNSREGISTRATION # Comment this out to disable Howl DNS-SD Registration
+ .cc.o:
+-      $(CC) $(CFLAGS) $(INCPATH) -c $<
++      $(CC) $(CFLAGS) $(DEFS) $(INCPATH) -c $<
+ $(TARGET): $(OBJS)
+-      $(CC) $(CFLAGS) $(LIBPATH) -o $(TARGET) $(OBJS) $(LIBS)
++      $(CC) $(CFLAGS) $(DEFS) $(LIBPATH) -o $(TARGET) $(OBJS) $(OBJS2) $(LIBS)
+ $(OBJS): types.h dboutput.h songcache.h parsemp3.h
+ clean:
+-      rm $(OBJS) $(TARGET)
++      rm -f $(OBJS) $(TARGET)
+ install: $(TARGET)
+       cp $(TARGET) $(DEPLOY)
diff --git a/media-sound/daapd/files/daapd.conf.d b/media-sound/daapd/files/daapd.conf.d
new file mode 100644 (file)
index 0000000..8ddb1f0
--- /dev/null
@@ -0,0 +1,14 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2         
+# $Header: /var/cvsroot/gentoo-x86/media-sound/daapd/files/daapd.conf.d,v 1.1 2004/03/31 02:20:20 eradicator Exp $
+
+# Options to pass to the daapd process that will *always*
+# be run. Most people should not change this line ...
+# however, if you know what you're doing, feel free to tweak
+# See the README in /usr/share/daapd*/ for more info.
+DAAPD_OPTS=""
+
+# By default daapd will run as root but it seems there is nothing
+# which requires that. Uncommenting the line below will start the
+# daapd daemon as the user you specify.
+#DAAPD_RUNAS="nobody:nobody"
diff --git a/media-sound/daapd/files/daapd.init.d b/media-sound/daapd/files/daapd.init.d
new file mode 100644 (file)
index 0000000..c208f6f
--- /dev/null
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2         
+# $Header: /var/cvsroot/gentoo-x86/media-sound/daapd/files/daapd.init.d,v 1.1 2004/03/31 02:20:20 eradicator Exp $
+
+depend() {
+       need net
+}
+
+checkconfig() {
+       grep '^Root             \.$' /etc/daapd.conf &>/dev/null && \
+               ewarn "The Root in /etc/daapd.conf has not been updated. You probably" && \
+               ewarn "want to point this to your music archive instead of" `pwd`
+}
+
+start() {
+       ebegin "Starting daapd"
+       checkconfig
+
+       local SSD_OPTS
+       SSD_OPTS=""
+       [ "${DAAPD_RUNAS}"x != ""x ] && SSD_OPTS="${SSD_OPTS} --chuid '${DAAPD_RUNAS}'"
+
+       start-stop-daemon --start --quiet --pidfile /var/run/daapd.pid \
+               --background --make-pidfile \
+               ${SSD_OPTS} --startas /usr/bin/daapd ${DAAPD_OPTS}
+       eend $? "Failed to start daapd"
+}
+
+stop() {
+       ebegin "Stopping daapd"
+       start-stop-daemon --stop --quiet --pidfile /var/run/daapd.pid
+       eend $? "Failed to stop daapd"
+
+       # clean stale pidfile
+       [ -f /var/run/daapd.pid ] && rm -f /var/run/daapd.pid
+}
diff --git a/media-sound/daapd/files/digest-daapd-0.2.1d b/media-sound/daapd/files/digest-daapd-0.2.1d
new file mode 100644 (file)
index 0000000..baaec52
--- /dev/null
@@ -0,0 +1 @@
+MD5 2f69299a099920694d7ddf78a1dcea49 daapd-0.2.1d.tgz 30023
diff --git a/media-sound/daapd/metadata.xml b/media-sound/daapd/metadata.xml
new file mode 100644 (file)
index 0000000..510c093
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>net-misc</herd>
+ <maintainer>
+  <email>sandymac@gentoo.org</email>
+  <name>Sandy McArthur</name>
+  <description>initial package creator</description>
+ </maintainer>
+ <longdescription>
+  daapd scans a directory for mp3 files and makes them available via
+  the Apple proprietary protocol DAAP. DAAP clients, such as iTunes,
+  can browse the directory and retrieve individual files, either by
+  streaming or by downloading them.
+ </longdescription>
+</pkgmetadata>