Ver código fonte

first commit

medaved 10 anos atrás
pai
commit
0daad9cc9c

+ 91
- 0
multimedia/minidlna/Makefile Ver arquivo

@@ -0,0 +1,91 @@
1
+#
2
+# Copyright (C) 2010-2013 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=minidlna
11
+PKG_VERSION:=1.1.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=@SF/minidlna
16
+PKG_MD5SUM:=879027192C89E5376CDD2AE2D1AA33B4
17
+
18
+PKG_BUILD_PARALLEL:=0
19
+PKG_BUILD_DEPENDS:=util-linux
20
+
21
+include $(INCLUDE_DIR)/kernel.mk
22
+include $(INCLUDE_DIR)/package.mk
23
+include $(INCLUDE_DIR)/nls.mk
24
+
25
+define Package/minidlna
26
+  SECTION:=multimedia
27
+  CATEGORY:=Multimedia
28
+  TITLE:=UPnP A/V & DLNA Media Server
29
+  URL:=http://minidlna.sourceforge.net/
30
+  DEPENDS:= +libpthread +libexif +libjpeg +libsqlite3 +libffmpeg \
31
+  	+libid3tag +libflac +libvorbis +libuuid \
32
+  	$(ICONV_DEPENDS) $(INTL_DEPENDS)
33
+endef
34
+
35
+define Package/minidlna/description
36
+  MiniDLNA (aka ReadyDLNA) is server software with the aim of
37
+  being fully compliant with DLNA/UPnP-AV clients.
38
+endef
39
+
40
+define Package/minidlna/conffiles
41
+/etc/minidlna.conf
42
+endef
43
+
44
+TARGET_CPPFLAGS += \
45
+	-I$(STAGING_DIR)/usr/include \
46
+	-I$(STAGING_DIR)/usr/include/FLAC \
47
+	-I$(STAGING_DIR)/usr/include/libavcodec \
48
+	-I$(STAGING_DIR)/usr/include/libavformat \
49
+	-I$(STAGING_DIR)/usr/include/libavutil \
50
+	-I$(STAGING_DIR)/usr/include/libexif \
51
+	-I$(STAGING_DIR)/usr/include/uuid \
52
+	-I$(STAGING_DIR)/usr/include/vorbis \
53
+	-I$(ICONV_PREFIX)/include \
54
+	-I$(INTL_PREFIX)/include \
55
+	-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
56
+
57
+TARGET_LDFLAGS += \
58
+	-L$(ICONV_PREFIX)/lib \
59
+	-L$(INTL_PREFIX)/lib \
60
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
61
+
62
+MAKE_FLAGS +=\
63
+	CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
64
+	LDFLAGS="$(TARGET_LDFLAGS)" \
65
+	ICONV_LIBS="-liconv $(if $(INTL_FULL),-lintl)" \
66
+
67
+MAKE_VARS +=\
68
+	PREFIX="$(STAGING_DIR)/usr" \
69
+	ICONV_PREFIX="$(ICONV_PREFIX)" \
70
+	INTL_PREFIX="$(INTL_PREFIX)" \
71
+	OS_NAME="OpenWrt Linux" \
72
+	OS_VERSION="$(LINUX_VERSION)" \
73
+	OS_URL="http://openwrt.org/" \
74
+	DB_PATH="/var/run/minidlna" \
75
+	LOG_PATH="/var/log" \
76
+
77
+
78
+define Package/minidlna/install
79
+	$(INSTALL_DIR) $(1)/usr/bin
80
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlna $(1)/usr/bin/
81
+	$(INSTALL_DIR) $(1)/etc/init.d
82
+	$(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
83
+	$(INSTALL_DIR) $(1)/etc/config
84
+	$(INSTALL_CONF) ./files/minidlna.config $(1)/etc/config/minidlna
85
+endef
86
+
87
+define Package/minidlna/conffiles
88
+/etc/config/minidlna
89
+endef
90
+
91
+$(eval $(call BuildPackage,minidlna))

+ 17
- 0
multimedia/minidlna/files/minidlna.config Ver arquivo

@@ -0,0 +1,17 @@
1
+config minidlna config
2
+	option 'enabled' '0'
3
+	option port '8200'
4
+	option interface 'br-lan'
5
+	option friendly_name 'OpenWrt DLNA Server'
6
+	option db_dir '/var/run/minidlna'
7
+	option log_dir '/var/log'
8
+	option inotify '1'
9
+	option enable_tivo '0'
10
+	option strict_dlna '0'
11
+	option presentation_url ''
12
+	option notify_interval '900'
13
+	option serial '12345678'
14
+	option model_number '1'
15
+	option root_container '.'
16
+	list media_dir '/mnt'
17
+	option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'

+ 96
- 0
multimedia/minidlna/files/minidlna.init Ver arquivo

@@ -0,0 +1,96 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2010 OpenWrt.org
3
+
4
+START=50
5
+
6
+SERVICE_USE_PID=1
7
+
8
+MINIDLNA_CONFIG_FILE="/tmp/minidlna.conf"
9
+
10
+minidlna_cfg_append() {
11
+	echo "$1" >> "$MINIDLNA_CONFIG_FILE"
12
+}
13
+
14
+minidlna_cfg_addbool() {
15
+	local cfg="$1"
16
+	local key="$2"
17
+	local def="$3"
18
+	local val
19
+
20
+	config_get_bool val "$cfg" "$key" "$def"
21
+	[ "$val" -gt 0 ] && val="yes" || val="no"
22
+	minidlna_cfg_append "$key=$val"
23
+}
24
+
25
+minidlna_cfg_addstr() {
26
+	local cfg="$1"
27
+	local key="$2"
28
+	local def="$3"
29
+	local val
30
+
31
+	config_get val "$cfg" "$key" "$def"
32
+	[ -n "$val" ] && minidlna_cfg_append "$key=$val"
33
+}
34
+
35
+minidlna_cfg_add_media_dir() {
36
+	local val=$1
37
+
38
+	minidlna_cfg_append "media_dir=$val"
39
+}
40
+
41
+minidlna_create_config() {
42
+	local cfg=$1
43
+	local port
44
+	local interface
45
+
46
+	config_get port $cfg port
47
+	config_get interface $cfg interface
48
+
49
+	[ -z "$interface" -o -t "$port" ] && return 1
50
+
51
+	echo "# this file is generated automatically, don't edit" > "$MINIDLNA_CONFIG_FILE"
52
+
53
+	minidlna_cfg_append "port=$port"
54
+	minidlna_cfg_append "network_interface=$interface"
55
+
56
+	minidlna_cfg_addstr $cfg friendly_name
57
+	minidlna_cfg_addstr $cfg db_dir
58
+	minidlna_cfg_addstr $cfg log_dir
59
+	minidlna_cfg_addbool $cfg inotify '1'
60
+	minidlna_cfg_addbool $cfg enable_tivo '0'
61
+	minidlna_cfg_addbool $cfg strict_dlna '0'
62
+	minidlna_cfg_addstr $cfg album_art_names
63
+	minidlna_cfg_addstr $cfg presentation_url
64
+	minidlna_cfg_addstr $cfg notify_interval '900'
65
+	minidlna_cfg_addstr $cfg serial '12345678'
66
+	minidlna_cfg_addstr $cfg model_number '1'
67
+	minidlna_cfg_addstr $cfg minissdpsocket
68
+	minidlna_cfg_addstr $cfg root_container '.'
69
+	config_list_foreach "$cfg" "media_dir" minidlna_cfg_add_media_dir
70
+
71
+	return 0
72
+}
73
+
74
+start() {
75
+	local enabled
76
+	local db_dir
77
+	local log_dir
78
+
79
+	config_load 'minidlna'
80
+	config_get_bool enabled config 'enabled' '0'
81
+
82
+	[ "$enabled" -gt 0 ] || return 1
83
+
84
+	minidlna_create_config config || return 1
85
+	
86
+	config_get db_dir config 'db_dir' '/var/run/minidlna'
87
+	config_get log_dir config 'log_dir' '/var/log'
88
+
89
+	mkdir -m 0755 -p $db_dir
90
+	mkdir -m 0755 -p $log_dir
91
+	service_start /usr/bin/minidlna -f "$MINIDLNA_CONFIG_FILE"
92
+}
93
+
94
+stop() {
95
+	service_stop /usr/bin/minidlna
96
+}

+ 19
- 0
multimedia/minidlna/patches/010-libav-fix.patch Ver arquivo

@@ -0,0 +1,19 @@
1
+--- a/libav.h
2
++++ b/libav.h
3
+@@ -167,7 +167,7 @@
4
+ static inline int
5
+ lav_is_thumbnail_stream(AVStream *s, uint8_t **data, int *size)
6
+ {
7
+-#if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
8
++/*if LIBAVFORMAT_VERSION_INT >= ((54<<16)+(6<<8))
9
+ 	if (s->disposition & AV_DISPOSITION_ATTACHED_PIC &&
10
+ 	    s->codec->codec_id == AV_CODEC_ID_MJPEG)
11
+ 	{
12
+@@ -177,6 +177,6 @@
13
+ 			*size = s->attached_pic.size;
14
+ 		return 1;
15
+ 	}
16
+-#endif
17
++endif*/
18
+ 	return 0;
19
+ }

+ 32
- 0
multimedia/minidlna/patches/020-makefileam-tweaks.patch Ver arquivo

@@ -0,0 +1,32 @@
1
+--- a/Makefile.am
2
++++ b/Makefile.am
3
+@@ -19,9 +19,9 @@
4
+ 
5
+ SUBDIRS=po
6
+ 
7
+-sbin_PROGRAMS = minidlnad
8
++sbin_PROGRAMS = minidlna
9
+ check_PROGRAMS = testupnpdescgen
10
+-minidlnad_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
11
++minidlna_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
12
+ 			upnpreplyparse.c minixml.c clients.c \
13
+ 			getifaddr.c process.c upnpglobalvars.c \
14
+ 			options.c minissdp.c uuid.c upnpevents.c \
15
+@@ -38,7 +38,7 @@
16
+ flacoggflag = -logg
17
+ #endif
18
+ 
19
+-minidlnad_LDADD = \
20
++minidlna_LDADD = \
21
+ 	@LIBJPEG_LIBS@ \
22
+ 	@LIBID3TAG_LIBS@ \
23
+ 	@LIBSQLITE3_LIBS@ \
24
+@@ -49,7 +49,7 @@
25
+ 	@LIBICONV@ \
26
+ 	-lFLAC  $(flacoggflag) $(vorbisflag)
27
+ 
28
+-minidlnad_LDFLAGS = @STATIC_LDFLAGS@
29
++minidlna_LDFLAGS = @STATIC_LDFLAGS@
30
+ 
31
+ testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
32
+ testupnpdescgen_LDADD = \