pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/multimedia/minidlna import the FreeBSD port of minidln...
details: https://anonhg.NetBSD.org/pkgsrc/rev/7e57a34214e5
branches: trunk
changeset: 610015:7e57a34214e5
user: drochner <drochner%pkgsrc.org@localhost>
date: Mon Oct 15 22:48:01 2012 +0000
description:
import the FreeBSD port of minidlna, with minor adaptions to make it
build and start up on NetBSD
not tested with a real media renderer yet
diffstat:
multimedia/minidlna/DESCR | 2 +
multimedia/minidlna/Makefile | 42 +
multimedia/minidlna/PLIST | 3 +
multimedia/minidlna/distinfo | 22 +
multimedia/minidlna/files/BSDmakefile | 34 +
multimedia/minidlna/files/config.h | 36 +
multimedia/minidlna/files/getifaddr.c | 246 ++++
multimedia/minidlna/files/minidlna.in | 34 +
multimedia/minidlna/patches/patch-aa | 79 +
multimedia/minidlna/patches/patch-ab | 11 +
multimedia/minidlna/patches/patch-conf | 17 +
multimedia/minidlna/patches/patch-icons | 1035 ++++++++++++++++++++
multimedia/minidlna/patches/patch-image_utils.c | 30 +
multimedia/minidlna/patches/patch-inline | 25 +
multimedia/minidlna/patches/patch-lg | 21 +
multimedia/minidlna/patches/patch-minidlna.c | 133 ++
multimedia/minidlna/patches/patch-other-subnets | 37 +
multimedia/minidlna/patches/patch-replace-glob3 | 34 +
multimedia/minidlna/patches/patch-scanner.c | 12 +
multimedia/minidlna/patches/patch-tagutils.c | 12 +
multimedia/minidlna/patches/patch-tagutils_asf.h | 35 +
multimedia/minidlna/patches/patch-tagutils_misc.c | 87 +
multimedia/minidlna/patches/patch-upnpglobalvars.c | 13 +
multimedia/minidlna/patches/patch-upnphttp | 105 ++
multimedia/minidlna/patches/patch-utils-mpo | 41 +
25 files changed, 2146 insertions(+), 0 deletions(-)
diffs (truncated from 2246 to 300 lines):
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/DESCR Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,2 @@
+The MiniDLNA daemon is an UPnP-A/V and DLNA service which
+serves multimedia content to compatible clients on the network.
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/Makefile Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,42 @@
+# $NetBSD: Makefile,v 1.1 2012/10/15 22:48:01 drochner Exp $
+#
+
+DISTNAME= minidlna_1.0.25_src
+PKGNAME= minidlna-1.0.25
+CATEGORIES= multimedia
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=minidlna/1.0.25/}
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= http://minidlna.sourceforge.net/
+COMMENT= DLNA server
+LICENSE= gnu-gpl-v2
+
+WRKSRC= ${WRKDIR}/minidlna-1.0.25
+MAKE_FILE= BSDmakefile
+EGDIR= ${PREFIX}/share/examples/minidlna
+
+CONF_FILES= ${EGDIR}/minidlna.conf \
+ ${PKG_SYSCONFDIR}/minidlna.conf
+
+INSTALLATION_DIRS= sbin share/examples/minidlna
+
+post-patch:
+ ${CP} \
+ ${FILESDIR}/BSDmakefile \
+ ${FILESDIR}/config.h \
+ ${FILESDIR}/getifaddr.c \
+ ${WRKSRC}
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/minidlna ${DESTDIR}${PREFIX}/sbin
+ ${INSTALL_DATA} ${WRKSRC}/minidlna.conf ${DESTDIR}${EGDIR}
+
+.include "../../multimedia/ffmpeg/buildlink3.mk"
+.include "../../audio/flac/buildlink3.mk"
+.include "../../audio/libvorbis/buildlink3.mk"
+.include "../../multimedia/libogg/buildlink3.mk"
+.include "../../audio/libid3tag/buildlink3.mk"
+.include "../../graphics/libexif/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/PLIST Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2012/10/15 22:48:01 drochner Exp $
+sbin/minidlna
+share/examples/minidlna/minidlna.conf
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/distinfo Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,22 @@
+$NetBSD: distinfo,v 1.1 2012/10/15 22:48:01 drochner Exp $
+
+SHA1 (minidlna_1.0.25_src.tar.gz) = 33742f02367006c6e4af7128b91c830026e59b9f
+RMD160 (minidlna_1.0.25_src.tar.gz) = 7008ef98c03f820d9200c1b1db2ec2f7995ece6d
+Size (minidlna_1.0.25_src.tar.gz) = 211756 bytes
+SHA1 (patch-aa) = 7eade704068ea67e8ced43453976aa2ef24b3ef8
+SHA1 (patch-ab) = 7e62ef89c7bf2029cacda3e43cfe41800b90201f
+SHA1 (patch-conf) = f02d87c245efd80ca43158b172c13e10c2130610
+SHA1 (patch-icons) = f9bdf47cd8cd6ee67a3e011655fd0ce7d8a1dcc2
+SHA1 (patch-image_utils.c) = 1f8a5d31aef9fa7182ac5ee40f9b9ad374a2772c
+SHA1 (patch-inline) = 3bab5f706124d96492f6fd017b671e34c3f2bd59
+SHA1 (patch-lg) = 3889c03ca8118a7769266bb25687945701f3d29e
+SHA1 (patch-minidlna.c) = 056a60ed2a5973939bcaf7aca27ed9b0f56920db
+SHA1 (patch-other-subnets) = 3739394543005a658c73a62bd150a161d43253e1
+SHA1 (patch-replace-glob3) = 599bda0d6c2532956111b8d605b6227dd83040c5
+SHA1 (patch-scanner.c) = d07998a31ec8b890baa7cccc58d211af69953625
+SHA1 (patch-tagutils.c) = 0010283c8a538024abf1dddd64e9b5446ec7ee02
+SHA1 (patch-tagutils_asf.h) = 855b7e59b657f1e6ea8d07b48c0ca261cd9ddacd
+SHA1 (patch-tagutils_misc.c) = b49931d9a3d338576a8fb9911da1664085475aa6
+SHA1 (patch-upnpglobalvars.c) = fbe22ff08d1462bf6a3cc36c456cf41624bcbd4e
+SHA1 (patch-upnphttp) = deeda56b30f06bbacdf9190ca18d65b2ae93e863
+SHA1 (patch-utils-mpo) = 8f94873331d2d87f2b2652d131f506a12cf171b8
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/files/BSDmakefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/files/BSDmakefile Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,34 @@
+# $NetBSD: BSDmakefile,v 1.1 2012/10/15 22:48:01 drochner Exp $
+# from FreeBSD ports/net/minidlna
+
+PROG= minidlna
+NOMAN= Ha-ha...
+
+OS!= uname
+VERS!= uname -r
+
+CFLAGS+=-I${FILESDIR} -I${.CURDIR} -I${LOCALBASE}/include -I${LOCALBASE}/include/libavcodec
+CFLAGS+=-I${LOCALBASE}/include/libavutil -I${LOCALBASE}/include/libavformat
+CFLAGS+=-DPREFIX='"${PREFIX}"' -DOS='"${OS}"' -DOSVERSION='"${VERS}"'
+CFLAGS+=-Wformat -Wunused -Wall
+CFLAGS+=-Wno-deprecated-declarations
+
+LDADD+= -L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib
+LDADD+= -lsqlite3 -ljpeg -lexif -lid3tag -logg -lvorbis -lFLAC -lavformat
+
+SRCS= albumart.c daemonize.c getifaddr.c image_utils.c log.c \
+ metadata.c minidlna.c minissdp.c minixml.c options.c playlist.c \
+ scanner.c sql.c upnpdescgen.c upnpevents.c upnpglobalvars.c \
+ upnphttp.c upnpreplyparse.c upnpsoap.c utils.c uuid.c
+
+# TiVo-related sources still need massaging to compile on BSD:
+# SRCS+= tivo_beacon.c tivo_commands.c tivo_utils.c
+
+.PATH: ${FILESDIR} ${.CURDIR}/tagutils
+
+SRCS+= misc.c tagutils.c textutils.c
+
+WARNS= 3
+NOGCCERROR= yes
+
+.include <bsd.prog.mk>
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/files/config.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/files/config.h Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,36 @@
+/* $NetBSD: config.h,v 1.1 2012/10/15 22:48:01 drochner Exp $ */
+
+/* MiniDLNA Project
+ * http://sourceforge.net/projects/minidlna/
+ * (c) 2008-2009 Justin Maggard
+ * generated by ./genconfig.sh on ÎÄ 13 ÞÅÒ 2010 00:06:49 EDT */
+#ifndef __CONFIG_H__
+#define __CONFIG_H__
+
+#define PFRULE_INOUT_COUNTS
+#define OS_NAME OS
+#define OS_VERSION OS "/" OSVERSION
+#define OS_URL "http://www." OS ".org/"
+
+/* full path of the file database */
+#define DEFAULT_DB_PATH "/var/db/minidlna"
+#define DEFAULT_LOG_PATH "/var/log"
+
+/* Comment the following line to use home made daemonize() func instead
+ * of BSD daemon() */
+#define USE_DAEMON
+
+/* Enable if the system inotify.h exists. Otherwise our own inotify.h will be used. */
+/*#define HAVE_INOTIFY_H*/
+
+/* Enable if the system iconv.h exists. ID3 tag reading in various character sets will not work properly otherwise. */
+#define HAVE_ICONV_H
+
+/* Enable NETGEAR-specific tweaks. */
+/*#define NETGEAR*/
+/* Enable ReadyNAS-specific tweaks. */
+/*#define READYNAS*/
+/* Compile in TiVo support. */
+/* #define TIVO_SUPPORT -- not yet ported to FreeBSD */
+
+#endif
diff -r 10e8835641ce -r 7e57a34214e5 multimedia/minidlna/files/getifaddr.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/minidlna/files/getifaddr.c Mon Oct 15 22:48:01 2012 +0000
@@ -0,0 +1,246 @@
+/* $NetBSD: getifaddr.c,v 1.1 2012/10/15 22:48:01 drochner Exp $ */
+
+/* $Id: getifaddr.c,v 1.1 2012/10/15 22:48:01 drochner Exp $ */
+/* MiniUPnP project
+ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
+ *
+ * Copyright (c) 2006, Thomas Bernard
+ * All rights reserved.
+ *
+ * Adapted to BSD by jayp and Mikhail T. -- 2010
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <errno.h>
+
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <arpa/inet.h>
+#include <net/route.h>
+#include <err.h>
+#include <netinet/if_ether.h>
+
+#include <ifaddrs.h>
+#include <sys/param.h>
+#include <net/if_dl.h>
+
+#include "getifaddr.h"
+#include "log.h"
+
+int
+getifaddr(const char * ifname, char * buf, int len)
+{
+ /* SIOCGIFADDR struct ifreq * */
+ int s;
+ struct ifreq ifr;
+ int ifrlen;
+ struct sockaddr_in * addr;
+ ifrlen = sizeof(ifr);
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if(s < 0)
+ {
+ DPRINTF(E_ERROR, L_GENERAL, "socket(PF_INET, SOCK_DGRAM): %s\n", strerror(errno));
+ return -1;
+ }
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ if(ioctl(s, SIOCGIFADDR, &ifr, &ifrlen) < 0)
+ {
+ DPRINTF(E_ERROR, L_GENERAL, "ioctl(s, SIOCGIFADDR, ...): %s\n", strerror(errno));
+ close(s);
+ return -1;
+ }
+ addr = (struct sockaddr_in *)&ifr.ifr_addr;
+ if(!inet_ntop(AF_INET, &addr->sin_addr, buf, len))
+ {
+ DPRINTF(E_ERROR, L_GENERAL, "inet_ntop(): %s\n", strerror(errno));
+ close(s);
+ return -1;
+ }
+ close(s);
+ return 0;
+}
+
+int
+getsysaddr(char * buf, int len)
+{
+ int rv=-1;
+ struct ifaddrs *ifap = NULL;
+ struct ifaddrs *ifnr;
+
+ if (getifaddrs(&ifap) != 0)
+ err(1, "getifaddrs");
+
+ for (ifnr = ifap; ifnr != NULL; ifnr = ifnr->ifa_next) {
+ if (ifnr->ifa_addr->sa_family == AF_INET) {
+ struct sockaddr_in *addr_in =
+ (struct sockaddr_in *)ifnr->ifa_addr;
+
+ unsigned a =
+ (htonl(addr_in->sin_addr.s_addr) >> 0x18) & 0xFF;
+
+ if (a==127)
+ continue;
+
+ if(!inet_ntop(AF_INET, &addr_in->sin_addr, buf, len)) {
+ warn("inet_ntop()");
+ break;
+ }
+ rv=0;
+ break;
+ }
+ rv=0;
+ }
+ freeifaddrs(ifap);
+ return rv;
+}
+
+static int
+getsysifname(char * buf, size_t len)
+{
+ int rv=-1;
Home |
Main Index |
Thread Index |
Old Index