Index: /mediatomb/sources/lame-noexecstack.patch =================================================================== --- /mediatomb/sources/lame-noexecstack.patch (revision 4) +++ /mediatomb/sources/lame-noexecstack.patch (revision 4) @@ -0,0 +1,77 @@ +diff -ur lame-3.97.orig/libmp3lame/i386/choose_table.nas lame-3.97/libmp3lame/i386/choose_table.nas +--- lame-3.97.orig/libmp3lame/i386/choose_table.nas 2000-10-27 13:19:05.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/choose_table.nas 2007-02-15 09:14:07.000000000 +0100 +@@ -431,3 +431,7 @@ + ret + + end ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/cpu_feat.nas lame-3.97/libmp3lame/i386/cpu_feat.nas +--- lame-3.97.orig/libmp3lame/i386/cpu_feat.nas 2003-11-10 16:41:00.000000000 +0100 ++++ lame-3.97/libmp3lame/i386/cpu_feat.nas 2007-02-15 09:13:58.000000000 +0100 +@@ -105,3 +105,7 @@ + ret + + end ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/fft.nas lame-3.97/libmp3lame/i386/fft.nas +--- lame-3.97.orig/libmp3lame/i386/fft.nas 2000-10-04 14:13:26.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/fft.nas 2007-02-15 09:14:34.000000000 +0100 +@@ -265,3 +265,7 @@ + pop esi + pop ebx + ret ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/fft3dn.nas lame-3.97/libmp3lame/i386/fft3dn.nas +--- lame-3.97.orig/libmp3lame/i386/fft3dn.nas 2006-09-24 15:53:33.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/fft3dn.nas 2007-02-15 09:14:18.000000000 +0100 +@@ -275,3 +275,7 @@ + add esp,16 + popd ebp, ebx, esi, edi + endproc ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/fftfpu.nas lame-3.97/libmp3lame/i386/fftfpu.nas +--- lame-3.97.orig/libmp3lame/i386/fftfpu.nas 2000-10-04 14:13:26.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/fftfpu.nas 2007-02-15 09:14:35.000000000 +0100 +@@ -617,3 +617,7 @@ + endproc + + end ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/fftsse.nas lame-3.97/libmp3lame/i386/fftsse.nas +--- lame-3.97.orig/libmp3lame/i386/fftsse.nas 2000-10-04 14:13:26.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/fftsse.nas 2007-02-15 09:14:36.000000000 +0100 +@@ -536,3 +536,7 @@ + + + end ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif +diff -ur lame-3.97.orig/libmp3lame/i386/ffttbl.nas lame-3.97/libmp3lame/i386/ffttbl.nas +--- lame-3.97.orig/libmp3lame/i386/ffttbl.nas 2000-10-04 14:13:26.000000000 +0200 ++++ lame-3.97/libmp3lame/i386/ffttbl.nas 2007-02-15 09:14:38.000000000 +0100 +@@ -76,3 +76,7 @@ + segment_code + + end ++ ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif Index: /mediatomb/sources/lame-as-needed.patch =================================================================== --- /mediatomb/sources/lame-as-needed.patch (revision 4) +++ /mediatomb/sources/lame-as-needed.patch (revision 4) @@ -0,0 +1,24 @@ +--- lame-3.97/libmp3lame/Makefile.am.no_undefined 2005-08-21 12:32:09.000000000 -0500 ++++ lame-3.97/libmp3lame/Makefile.am 2006-10-20 12:06:51.000000000 -0500 +@@ -18,7 +18,7 @@ + decoder_ldadd = + endif + +-libmp3lame_la_LIBADD = $(nasm_ldadd) $(decoder_ldadd) ++libmp3lame_la_LIBADD = $(nasm_ldadd) $(decoder_ldadd) @CONFIG_MATH_LIB@ + libmp3lame_la_LDFLAGS = -version-info @LIB_MAJOR_VERSION@:@LIB_MINOR_VERSION@ \ + -no-undefined + +--- lame-3.97/configure.in.no_undefined 2006-09-24 08:53:31.000000000 -0500 ++++ lame-3.97/configure.in 2006-10-20 12:07:15.000000000 -0500 +@@ -1059,8 +1059,9 @@ + + CFLAGS="${OPTIMIZATION} ${CFLAGS}" + LDADD="${LDADD}" +-FRONTEND_LDADD="${FRONTEND_LDADD} ${CONFIG_MATH_LIB}" ++FRONTEND_LDADD="${FRONTEND_LDADD}" + ++AC_SUBST(CONFIG_MATH_LIB) + + AC_SUBST(INCLUDES) + Index: /mediatomb/sources/inotify.h =================================================================== --- /mediatomb/sources/inotify.h (revision 4) +++ /mediatomb/sources/inotify.h (revision 4) @@ -0,0 +1,108 @@ +/* + * Inode based directory notification for Linux + * + * Copyright (C) 2005 John McCutchan + */ + +#ifndef _LINUX_INOTIFY_H +#define _LINUX_INOTIFY_H + +#include + +/* + * struct inotify_event - structure read from the inotify device for each event + * + * When you are watching a directory, you will receive the filename for events + * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd. + */ +struct inotify_event { + __s32 wd; /* watch descriptor */ + __u32 mask; /* watch mask */ + __u32 cookie; /* cookie to synchronize two events */ + __u32 len; /* length (including nulls) of name */ + char name[0]; /* stub for possible name */ +}; + +/* the following are legal, implemented events that user-space can watch for */ +#define IN_ACCESS 0x00000001 /* File was accessed */ +#define IN_MODIFY 0x00000002 /* File was modified */ +#define IN_ATTRIB 0x00000004 /* Metadata changed */ +#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */ +#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ +#define IN_OPEN 0x00000020 /* File was opened */ +#define IN_MOVED_FROM 0x00000040 /* File was moved from X */ +#define IN_MOVED_TO 0x00000080 /* File was moved to Y */ +#define IN_CREATE 0x00000100 /* Subfile was created */ +#define IN_DELETE 0x00000200 /* Subfile was deleted */ +#define IN_DELETE_SELF 0x00000400 /* Self was deleted */ + +/* the following are legal events. they are sent as needed to any watch */ +#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ +#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ +#define IN_IGNORED 0x00008000 /* File was ignored */ + +/* helper events */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ + +/* special flags */ +#define IN_ISDIR 0x40000000 /* event occurred against dir */ +#define IN_ONESHOT 0x80000000 /* only send event once */ + +/* + * All of the events - we build the list by hand so that we can add flags in + * the future and not break backward compatibility. Apps will get only the + * events that they originally wanted. Be sure to add new events here! + */ +#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \ + IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \ + IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF) + +#ifdef __KERNEL__ + +#include +#include +#include + +#ifdef CONFIG_INOTIFY + +extern void inotify_inode_queue_event(struct inode *, __u32, __u32, + const char *); +extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32, + const char *); +extern void inotify_unmount_inodes(struct list_head *); +extern void inotify_inode_is_dead(struct inode *); +extern u32 inotify_get_cookie(void); + +#else + +static inline void inotify_inode_queue_event(struct inode *inode, + __u32 mask, __u32 cookie, + const char *filename) +{ +} + +static inline void inotify_dentry_parent_queue_event(struct dentry *dentry, + __u32 mask, __u32 cookie, + const char *filename) +{ +} + +static inline void inotify_unmount_inodes(struct list_head *list) +{ +} + +static inline void inotify_inode_is_dead(struct inode *inode) +{ +} + +static inline u32 inotify_get_cookie(void) +{ + return 0; +} + +#endif /* CONFIG_INOTIFY */ + +#endif /* __KERNEL __ */ + +#endif /* _LINUX_INOTIFY_H */ Index: /mediatomb/sources/libogg-1.0-m4.patch =================================================================== --- /mediatomb/sources/libogg-1.0-m4.patch (revision 4) +++ /mediatomb/sources/libogg-1.0-m4.patch (revision 4) @@ -0,0 +1,20 @@ +--- libogg-1.1/ogg.m4.orig 2003-03-07 21:44:29.000000000 -0500 ++++ libogg-1.1/ogg.m4 2003-12-11 15:08:01.000000000 -0500 +@@ -19,7 +19,7 @@ + elif test "x$ogg_prefix" != "x" ; then + OGG_LIBS="-L$ogg_prefix/lib" + elif test "x$prefix" != "xNONE" ; then +- OGG_LIBS="-L$prefix/lib" ++ OGG_LIBS="-L$libdir" + fi + + OGG_LIBS="$OGG_LIBS -logg" +@@ -29,7 +29,7 @@ + elif test "x$ogg_prefix" != "x" ; then + OGG_CFLAGS="-I$ogg_prefix/include" + elif test "x$prefix" != "xNONE"; then +- OGG_CFLAGS="-I$prefix/include" ++ OGG_CFLAGS="" + fi + + AC_MSG_CHECKING(for Ogg) Index: /mediatomb/sources/samsung_video_subtitles.patch =================================================================== --- /mediatomb/sources/samsung_video_subtitles.patch (revision 4) +++ /mediatomb/sources/samsung_video_subtitles.patch (revision 4) @@ -0,0 +1,186 @@ +Index: src/config_manager.cc +=================================================================== +--- src/config_manager.cc (revision 2102) ++++ src/config_manager.cc (working copy) +@@ -1433,6 +1433,14 @@ + NEW_BOOL_OPTION(temp == "yes" ? true : false); + SET_BOOL_OPTION(CFG_SERVER_EXTEND_PROTOCOLINFO_CL_HACK); + */ ++ temp = getOption(_("/server/protocolInfo/attribute::samsung-hack"), ++ _(DEFAULT_EXTEND_PROTOCOLINFO_SM_HACK)); ++ if (!validateYesNo(temp)) ++ throw _Exception(_("Error in config file: samsung-hack attribute of the " ++ "protocolInfo tag must be either \"yes\" or \"no\"")); ++ ++ NEW_BOOL_OPTION(temp == "yes" ? true : false); ++ SET_BOOL_OPTION(CFG_SERVER_EXTEND_PROTOCOLINFO_SM_HACK); + #endif + + temp = getOption(_("/server/pc-directory/attribute::upnp-hide"), +Index: src/common.h +=================================================================== +--- src/common.h (revision 2102) ++++ src/common.h (working copy) +@@ -196,6 +196,8 @@ + #define XML_DC_NAMESPACE "http://purl.org/dc/elements/1.1/" + #define XML_UPNP_NAMESPACE_ATTR "xmlns:upnp" + #define XML_UPNP_NAMESPACE "urn:schemas-upnp-org:metadata-1-0/upnp/" ++#define XML_SEC_NAMESPACE_ATTR "xmlns:sec" ++#define XML_SEC_NAMESPACE "http://www.sec.co.kr/" + + // default values + #define DEFAULT_INTERNAL_CHARSET "UTF-8" +@@ -243,6 +245,7 @@ + #define DEFAULT_LAYOUT_TYPE "builtin" + #define DEFAULT_EXTEND_PROTOCOLINFO NO + //#define DEFAULT_EXTEND_PROTOCOLINFO_CL_HACK NO ++#define DEFAULT_EXTEND_PROTOCOLINFO_SM_HACK NO + #define DEFAULT_HIDE_PC_DIRECTORY NO + #ifdef YOUTUBE + #define YOUTUBE_PAGESIZE 106496 +Index: src/config_manager.h +=================================================================== +--- src/config_manager.h (revision 2102) ++++ src/config_manager.h (working copy) +@@ -73,6 +73,7 @@ + CFG_SERVER_EXTEND_PROTOCOLINFO_CL_HACK, + #endif + #endif//EXTEND_PROTOCOLINFO ++ CFG_SERVER_EXTEND_PROTOCOLINFO_SM_HACK, + CFG_SERVER_HIDE_PC_DIRECTORY, + CFG_SERVER_BOOKMARK_FILE, + CFG_SERVER_CUSTOM_HTTP_HEADERS, +Index: src/cds_resource_manager.cc +=================================================================== +--- src/cds_resource_manager.cc (revision 2102) ++++ src/cds_resource_manager.cc (working copy) +@@ -482,6 +482,14 @@ + res_attrs->put(MetadataHandler::getResAttrName(R_PROTOCOLINFO), + protocolInfo); + ++ if (config->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO_SM_HACK)) ++ { ++ if (mimeType.startsWith(_("video"))) ++ { ++ element->appendElementChild(UpnpXML_DIDLRenderCaptionInfo(url)); ++ } ++ } ++ + log_debug("extended protocolInfo: %s\n", protocolInfo.c_str()); + } + #endif +Index: src/file_request_handler.cc +=================================================================== +--- src/file_request_handler.cc (revision 2102) ++++ src/file_request_handler.cc (working copy) +@@ -305,6 +305,53 @@ + /// header, since chunked encoding may be active and we do not + /// know that here + } ++ ++#ifdef EXTEND_PROTOCOLINFO ++ Ref cfg = ConfigManager::getInstance(); ++ if (cfg->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO_SM_HACK)) ++ { ++ if (item->getMimeType().startsWith(_("video"))) { ++ // Look for subtitle file and returns it's URL ++ // in CaptionInfo.sec response header. ++ // To be more compliant with original Samsung ++ // server we should check for getCaptionInfo.sec: 1 ++ // request header. ++ Ref > subexts(new Array()); ++ subexts->append(_(".srt")); ++ subexts->append(_(".ssa")); ++ subexts->append(_(".smi")); ++ subexts->append(_(".sub")); ++ ++ String bfilepath = path.substring(0, path.rindex('.')); ++ String validext; ++ for (int i=0; isize(); i++) { ++ String ext = subexts->get(i); ++ ++ String fpath = bfilepath + ext; ++ if (access(fpath.c_str(), R_OK) == 0) ++ { ++ validext = ext; ++ break; ++ } ++ } ++ ++ ++ if (validext.length() > 0) ++ { ++ String burlpath = _(filename); ++ burlpath = burlpath.substring(0, burlpath.rindex('.')); ++ Ref server = Server::getInstance(); ++ String url = _("http://") ++ + server->getIP() + ":" + server->getPort() ++ + burlpath + validext; ++ ++ if (string_ok(header)) ++ header = header + _("\r\n"); ++ header = header + "CaptionInfo.sec: " + url; ++ } ++ } ++#endif ++ } + } + + if (!string_ok(mimeType)) +Index: src/upnp_cds_actions.cc +=================================================================== +--- src/upnp_cds_actions.cc (revision 2102) ++++ src/upnp_cds_actions.cc (working copy) +@@ -106,6 +106,14 @@ + + Ref cfg = ConfigManager::getInstance(); + ++#ifdef EXTEND_PROTOCOLINFO ++ if (cfg->getBoolOption(CFG_SERVER_EXTEND_PROTOCOLINFO_SM_HACK)) ++ { ++ didl_lite->setAttribute(_(XML_SEC_NAMESPACE_ATTR), ++ _(XML_SEC_NAMESPACE)); ++ } ++#endif ++ + for(int i = 0; i < arr->size(); i++) + { + Ref obj = arr->get(i); +Index: src/upnp_xml.cc +=================================================================== +--- src/upnp_xml.cc (revision 2102) ++++ src/upnp_xml.cc (working copy) +@@ -381,3 +381,20 @@ + + return res; + } ++ ++Ref UpnpXML_DIDLRenderCaptionInfo(String URL) { ++ Ref cap(new Element(_("sec:CaptionInfoEx"))); ++ ++ // Samsung DLNA clients don't follow this URL and ++ // obtain subtitle location from video HTTP headers. ++ // We don't need to know here what the subtitle type ++ // is and even if there is a subtitle. ++ // This tag seems to be only a hint for Samsung devices, ++ // though it's necessary. ++ ++ int endp = URL.rindex('.'); ++ cap->setText(URL.substring(0, endp) + ".srt"); ++ cap->setAttribute(_("sec:type"), _("srt")); ++ ++ return cap; ++} +Index: src/upnp_xml.h +=================================================================== +--- src/upnp_xml.h (revision 2102) ++++ src/upnp_xml.h (working copy) +@@ -76,4 +76,8 @@ + /// \param URL download location of the item (will be child element of the tag) + /// \param attributes Dictionary containing the tag attributes (like resolution, etc.) + zmm::Ref UpnpXML_DIDLRenderResource(zmm::String URL, zmm::Ref attributes); ++ ++/// \brief Renders a subtitle resource tag (Samsung proprietary extension) ++/// \param URL download location of the video item ++zmm::Ref UpnpXML_DIDLRenderCaptionInfo(zmm::String URL); + #endif // __UPNP_XML_H__ Index: /mediatomb/sources/xvidcore-1.2.1-noexec-stack.patch =================================================================== --- /mediatomb/sources/xvidcore-1.2.1-noexec-stack.patch (revision 4) +++ /mediatomb/sources/xvidcore-1.2.1-noexec-stack.patch (revision 4) @@ -0,0 +1,457 @@ +diff -up xvidcore/src/bitstream/x86_asm/cbp_mmx.asm.noexec-stack xvidcore/src/bitstream/x86_asm/cbp_mmx.asm +--- xvidcore/src/bitstream/x86_asm/cbp_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/bitstream/x86_asm/cbp_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -126,8 +126,4 @@ calc_cbp_mmx: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/bitstream/x86_asm/cbp_sse2.asm.noexec-stack xvidcore/src/bitstream/x86_asm/cbp_sse2.asm +--- xvidcore/src/bitstream/x86_asm/cbp_sse2.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/bitstream/x86_asm/cbp_sse2.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -116,8 +116,4 @@ calc_cbp_sse2: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/fdct_mmx_ffmpeg.asm.noexec-stack xvidcore/src/dct/x86_asm/fdct_mmx_ffmpeg.asm +--- xvidcore/src/dct/x86_asm/fdct_mmx_ffmpeg.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/fdct_mmx_ffmpeg.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -401,7 +401,4 @@ MAKE_FDCT_FUNC fdct_mmx_ffmpeg, FDCT_ROW + + MAKE_FDCT_FUNC fdct_xmm_ffmpeg, FDCT_ROW_XMM + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/fdct_mmx_skal.asm.noexec-stack xvidcore/src/dct/x86_asm/fdct_mmx_skal.asm +--- xvidcore/src/dct/x86_asm/fdct_mmx_skal.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/fdct_mmx_skal.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -500,7 +500,4 @@ MAKE_FDCT_FUNC fdct_mmx_skal, fMTX_MULT_ + + MAKE_FDCT_FUNC fdct_xmm_skal, fMTX_MULT_XMM + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm.noexec-stack xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm +--- xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/fdct_sse2_skal.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -605,7 +605,4 @@ fdct_sse2_skal: + ENDFUNC + + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/idct_3dne.asm.noexec-stack xvidcore/src/dct/x86_asm/idct_3dne.asm +--- xvidcore/src/dct/x86_asm/idct_3dne.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/idct_3dne.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -698,8 +698,4 @@ idct_3dne: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/idct_mmx.asm.noexec-stack xvidcore/src/dct/x86_asm/idct_mmx.asm +--- xvidcore/src/dct/x86_asm/idct_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/idct_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -608,8 +608,4 @@ idct_xmm: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/dct/x86_asm/idct_sse2_dmitry.asm.noexec-stack xvidcore/src/dct/x86_asm/idct_sse2_dmitry.asm +--- xvidcore/src/dct/x86_asm/idct_sse2_dmitry.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/dct/x86_asm/idct_sse2_dmitry.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -325,8 +325,4 @@ idct_sse2_dmitry: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/colorspace_rgb_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/colorspace_rgb_mmx.asm +--- xvidcore/src/image/x86_asm/colorspace_rgb_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/colorspace_rgb_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -514,8 +514,4 @@ MAKE_COLORSPACE rgba_to_yv12_mmx,0, 4 + MAKE_COLORSPACE yv12_to_bgr_mmx,48, 3,8,2, YV12_TO_BGR, 3, -1 + MAKE_COLORSPACE yv12_to_bgra_mmx,48, 4,8,2, YV12_TO_BGR, 4, -1 + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/colorspace_yuv_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/colorspace_yuv_mmx.asm +--- xvidcore/src/image/x86_asm/colorspace_yuv_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/colorspace_yuv_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -474,7 +474,4 @@ MAKE_YV12_TO_YV12 yv12_to_yv12_mmx, 0 + + MAKE_YV12_TO_YV12 yv12_to_yv12_xmm, 1 + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/colorspace_yuyv_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/colorspace_yuyv_mmx.asm +--- xvidcore/src/image/x86_asm/colorspace_yuyv_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/colorspace_yuyv_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -341,7 +341,4 @@ MAKE_COLORSPACE yv12_to_uyvy_mmx,0, + MAKE_COLORSPACE yv12_to_yuyvi_mmx,0, 2,8,4, YV12_TO_YUYVI, 0, -1 + MAKE_COLORSPACE yv12_to_uyvyi_mmx,0, 2,8,4, YV12_TO_YUYVI, 1, -1 + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/deintl_sse.asm.noexec-stack xvidcore/src/image/x86_asm/deintl_sse.asm +--- xvidcore/src/image/x86_asm/deintl_sse.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/deintl_sse.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -131,7 +131,4 @@ xvid_deinterlace_sse: + ENDFUNC + + ;////////////////////////////////////////////////////////////////////// +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/gmc_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/gmc_mmx.asm +--- xvidcore/src/image/x86_asm/gmc_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/gmc_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -220,7 +220,4 @@ xvid_GMC_Core_Lin_8_sse41: + ENDFUNC + + ;////////////////////////////////////////////////////////////////////// +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/interpolate8x8_3dn.asm.noexec-stack xvidcore/src/image/x86_asm/interpolate8x8_3dn.asm +--- xvidcore/src/image/x86_asm/interpolate8x8_3dn.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/interpolate8x8_3dn.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -463,8 +463,4 @@ interpolate8x4_halfpel_hv_3dn: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/interpolate8x8_3dne.asm.noexec-stack xvidcore/src/image/x86_asm/interpolate8x8_3dne.asm +--- xvidcore/src/image/x86_asm/interpolate8x8_3dne.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/interpolate8x8_3dne.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -563,8 +563,4 @@ ALIGN SECTION_ALIGN + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/interpolate8x8_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/interpolate8x8_mmx.asm +--- xvidcore/src/image/x86_asm/interpolate8x8_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/interpolate8x8_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -1328,8 +1328,4 @@ interpolate8x8_halfpel_hv_add_mmx: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/interpolate8x8_xmm.asm.noexec-stack xvidcore/src/image/x86_asm/interpolate8x8_xmm.asm +--- xvidcore/src/image/x86_asm/interpolate8x8_xmm.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/interpolate8x8_xmm.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -819,8 +819,4 @@ interpolate8x8_halfpel_hv_add_xmm: + EPILOG + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/postprocessing_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/postprocessing_mmx.asm +--- xvidcore/src/image/x86_asm/postprocessing_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/postprocessing_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -114,7 +114,4 @@ image_brightness_mmx: + ENDFUNC + ;////////////////////////////////////////////////////////////////////// + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/postprocessing_sse2.asm.noexec-stack xvidcore/src/image/x86_asm/postprocessing_sse2.asm +--- xvidcore/src/image/x86_asm/postprocessing_sse2.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/postprocessing_sse2.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -130,7 +130,4 @@ image_brightness_sse2: + ENDFUNC + ;////////////////////////////////////////////////////////////////////// + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/qpel_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/qpel_mmx.asm +--- xvidcore/src/image/x86_asm/qpel_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/qpel_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -1149,7 +1149,4 @@ ENDFUNC + %undef SRC_PTR + %undef DST_PTR + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/image/x86_asm/reduced_mmx.asm.noexec-stack xvidcore/src/image/x86_asm/reduced_mmx.asm +--- xvidcore/src/image/x86_asm/reduced_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/image/x86_asm/reduced_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -985,8 +985,4 @@ ENDFUNC + + ; pfeewwww... Never Do That On Stage Again. :) + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/motion/x86_asm/sad_3dn.asm.noexec-stack xvidcore/src/motion/x86_asm/sad_3dn.asm +--- xvidcore/src/motion/x86_asm/sad_3dn.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/motion/x86_asm/sad_3dn.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -216,8 +216,4 @@ sad8bi_3dn: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/motion/x86_asm/sad_3dne.asm.noexec-stack xvidcore/src/motion/x86_asm/sad_3dne.asm +--- xvidcore/src/motion/x86_asm/sad_3dne.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/motion/x86_asm/sad_3dne.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -490,8 +490,4 @@ ALIGN SECTION_ALIGN + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/motion/x86_asm/sad_mmx.asm.noexec-stack xvidcore/src/motion/x86_asm/sad_mmx.asm +--- xvidcore/src/motion/x86_asm/sad_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/motion/x86_asm/sad_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -731,8 +731,4 @@ sse8_8bit_mmx: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/motion/x86_asm/sad_sse2.asm.noexec-stack xvidcore/src/motion/x86_asm/sad_sse2.asm +--- xvidcore/src/motion/x86_asm/sad_sse2.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/motion/x86_asm/sad_sse2.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -176,8 +176,4 @@ dev16_sse3: + MEAN16_SSE2_SSE3 lddqu + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/motion/x86_asm/sad_xmm.asm.noexec-stack xvidcore/src/motion/x86_asm/sad_xmm.asm +--- xvidcore/src/motion/x86_asm/sad_xmm.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/motion/x86_asm/sad_xmm.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -436,8 +436,4 @@ sad16v_xmm: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/nasm.inc.noexec-stack xvidcore/src/nasm.inc +--- xvidcore/src/nasm.inc.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/nasm.inc 2009-09-21 10:39:24.000000000 +0200 +@@ -189,3 +189,12 @@ BITS 32 + %endif + %endif + %endmacro ++ ++%macro NON_EXEC_STACK 0 ++%ifidn __OUTPUT_FORMAT__,elf ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif ++%ifidn __OUTPUT_FORMAT__,elf64 ++section .note.GNU-stack noalloc noexec nowrite progbits ++%endif ++%endmacro +diff -up xvidcore/src/plugins/x86_asm/plugin_ssim-a.asm.noexec-stack xvidcore/src/plugins/x86_asm/plugin_ssim-a.asm +--- xvidcore/src/plugins/x86_asm/plugin_ssim-a.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/plugins/x86_asm/plugin_ssim-a.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -273,6 +273,4 @@ consim_mmx: + ret + ENDFUNC + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif ++NON_EXEC_STACK +diff -up xvidcore/src/quant/x86_asm/quantize_h263_3dne.asm.noexec-stack xvidcore/src/quant/x86_asm/quantize_h263_3dne.asm +--- xvidcore/src/quant/x86_asm/quantize_h263_3dne.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/quant/x86_asm/quantize_h263_3dne.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -931,7 +931,4 @@ ALIGN SECTION_ALIGN + ret + ENDFUNC + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/quant/x86_asm/quantize_h263_mmx.asm.noexec-stack xvidcore/src/quant/x86_asm/quantize_h263_mmx.asm +--- xvidcore/src/quant/x86_asm/quantize_h263_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/quant/x86_asm/quantize_h263_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -1070,8 +1070,4 @@ dequant_h263_inter_sse2: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/quant/x86_asm/quantize_mpeg_mmx.asm.noexec-stack xvidcore/src/quant/x86_asm/quantize_mpeg_mmx.asm +--- xvidcore/src/quant/x86_asm/quantize_mpeg_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/quant/x86_asm/quantize_mpeg_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -657,8 +657,4 @@ ALIGN SECTION_ALIGN + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm.noexec-stack xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm +--- xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/quant/x86_asm/quantize_mpeg_xmm.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -618,8 +618,4 @@ ALIGN SECTION_ALIGN + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/utils/x86_asm/cpuid.asm.noexec-stack xvidcore/src/utils/x86_asm/cpuid.asm +--- xvidcore/src/utils/x86_asm/cpuid.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/utils/x86_asm/cpuid.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -240,7 +240,4 @@ ENDFUNC + %endif + + +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/utils/x86_asm/interlacing_mmx.asm.noexec-stack xvidcore/src/utils/x86_asm/interlacing_mmx.asm +--- xvidcore/src/utils/x86_asm/interlacing_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/utils/x86_asm/interlacing_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -198,8 +198,4 @@ MBFieldTest_mmx: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/utils/x86_asm/mem_transfer_3dne.asm.noexec-stack xvidcore/src/utils/x86_asm/mem_transfer_3dne.asm +--- xvidcore/src/utils/x86_asm/mem_transfer_3dne.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/utils/x86_asm/mem_transfer_3dne.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -465,8 +465,4 @@ transfer8x4_copy_3dne: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK +diff -up xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm.noexec-stack xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm +--- xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm.noexec-stack 2009-09-21 10:39:07.000000000 +0200 ++++ xvidcore/src/utils/x86_asm/mem_transfer_mmx.asm 2009-09-21 10:39:24.000000000 +0200 +@@ -588,8 +588,4 @@ transfer8x4_copy_mmx: + ret + ENDFUNC + +- +-%ifidn __OUTPUT_FORMAT__,elf +-section ".note.GNU-stack" noalloc noexec nowrite progbits +-%endif +- ++NON_EXEC_STACK Index: /mediatomb/sources/faad2-cve-2008-4201.patch =================================================================== --- /mediatomb/sources/faad2-cve-2008-4201.patch (revision 4) +++ /mediatomb/sources/faad2-cve-2008-4201.patch (revision 4) @@ -0,0 +1,12 @@ +diff -up faad2/frontend/main.c.cve faad2/frontend/main.c +--- faad2/frontend/main.c.cve 2007-11-01 13:33:29.000000000 +0100 ++++ faad2/frontend/main.c 2008-11-10 22:43:49.000000000 +0100 +@@ -914,6 +914,8 @@ int decodeMP4file(char *mp4file, char *s + sample_count = frameInfo.samples; + } else { + sample_count = (unsigned int)(dur * frameInfo.channels); ++ if (sample_count > frameInfo.samples) ++ sample_count = frameInfo.samples; + + if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples)) + { Index: /mediatomb/module/Configure/install.rdf =================================================================== --- /mediatomb/module/Configure/install.rdf (revision 4) +++ /mediatomb/module/Configure/install.rdf (revision 4) @@ -0,0 +1,26 @@ + + + + Install + MEDIATOMB + 0.12.1-4 + Mediatomb mediaserver + Andreas Thienemann + + http://blog.vodkamelone.de/ + + No + + Admin + http://blog.vodkamelone.de/ + Thecus + + + Thecus + n5200 + 1.00.07 + + + Index: /mediatomb/module/Configure/license.txt =================================================================== --- /mediatomb/module/Configure/license.txt (revision 4) +++ /mediatomb/module/Configure/license.txt (revision 4) @@ -0,0 +1,1 @@ +To be done. Most likely GPL. Index: /mediatomb/module/system/configtool =================================================================== --- /mediatomb/module/system/configtool (revision 4) +++ /mediatomb/module/system/configtool (revision 4) @@ -0,0 +1,142 @@ +#!/bin/sh +######################################################################################### +## +## configtool +## +## Commands: +## +## backup +## restore +## getconfig +## putconfig +## +## 2007-01-16 Andreas Vogel (omega) +## +######################################################################################### + +PreBackup () { + if [ -x $modDir/system/configprepare ] ; then + $modDir/system/configprepare backup $modName + ret=$? + else + ret=0 + fi + + return $ret +} + +PostRestore () { + if [ -x $modDir/system/configprepare ] ; then + $modDir/system/configprepare restore $modName + ret=$? + else + ret=0 + fi + + return $ret +} + +######################################################################################### +## +## Main +## +######################################################################################### + +cmd=$1 +modName=$2 +filename=$3 +warn=${4:-warn} + +## +## Use standard backup file if command is "backup" or "restore" +## +if [ "$cmd" == backup -o "$cmd" == restore ] ; then + filename="/raid/data/module/backup/$modName/backup-$modName.tar.gz" + + if [ "$cmd" == backup ] ; then + cmd=getconfig + elif [ "$cmd" == restore ] ; then + cmd=putconfig + warn=nowarn + fi +fi + +if [ -z "$filename" -o -z "$modName" ] ; then + echo "ERROR: illegal commandline: $0 $*" + exit 1 +fi + +MAGIC="CONFIG-$modName" +modDir=/raid/data/module/$modName +modVersion=$(awk '{print $2}' < "$modDir/VERSION") + +case "$cmd" in + getconfig|get) + dstFile=$filename + + if ! PreBackup ; then + echo "ERROR: PreBackup script failed!" + exit 1 + fi + + echo "$MAGIC $modVersion $(date '+%Y-%m-%d_%H:%M:%S')" > "$modDir/system/etc/MAGIC" + tar czpf "$dstFile" -C "$modDir/system" etc + status=$? + rm "$modDir/system/etc/MAGIC" + exit $status + ;; + + putconfig|put) + srcFile=$filename + tmpdir=/tmp/tmp.configtool + + if [ ! -r "$srcFile" ] ; then + if [ "$warn" != nowarn ] ; then + echo "ERROR: source file '$sourceFile' not readable!" + exit 1 + else + exit 0 + fi + fi + + rm -rf "$tmpdir" + mkdir -p "$tmpdir" + if ! tar xzf "$srcFile" -C "$tmpdir" ; then + echo "ERROR: cannot unpack tar file!" + rm -rf "$tmpdir" + exit 1 + fi + + cfgMagic=$(awk '{print $1;exit}' < "$tmpdir/etc/MAGIC") + cfgVersion=$(awk '{print $2;exit}' < "$tmpdir/etc/MAGIC") + cfgDate=$(awk '{print $3;exit}' < "$tmpdir/etc/MAGIC") + + if [ "$cfgMagic" != "$MAGIC" ] ; then + echo "ERROR: wrong magic '$cfgMagic' - expected '$MAGIC'!" + rm -rf "$tmpdir" + exit 1 + fi + rm "$tmpdir/etc/MAGIC" + + if ! tar cpf - -C "$tmpdir" etc | (cd "$modDir/system" ; tar xpf -) ; then + echo "ERROR: cannot copy from '$tmpdir' to '$modDir/system'!" + rm -rf "$tmpdir" + exit 1 + fi + + rm -rf "$tmpdir" + + if ! PostRestore ; then + echo "ERROR: PostRestore script failed!" + exit 1 + fi + ;; + + *) + echo "ERROR: invalid command '$cmd'!" + echo "Usage: $0 {backup|restore|getconfig|putconfig} " + exit 1 + ;; +esac + +exit 0 Index: /mediatomb/module/system/.htaccess =================================================================== --- /mediatomb/module/system/.htaccess (revision 4) +++ /mediatomb/module/system/.htaccess (revision 4) @@ -0,0 +1,2 @@ +Order Deny,Allow +Deny from all Index: /mediatomb/module/system/etc/config.xml =================================================================== --- /mediatomb/module/system/etc/config.xml (revision 4) +++ /mediatomb/module/system/etc/config.xml (revision 4) @@ -0,0 +1,132 @@ + + + + 8080 + @@@INTERFACE@@@ + + + + + + @@@NAME@@@ + /adm/getform.html?Module=MEDIATOMB + uuid:@@@UUID@@@ + /raid0/data/module/MEDIATOMB/system/var/mediatomb + /raid0/data/module/MEDIATOMB/system/share/mediatomb/web + + + mediatomb.db + + + + + + + + + + + + 128 + 5 + yes + no + 8 + + + * + + video + + + + + + UTF-8 + UTF-8 + + /raid0/data/module/MEDIATOMB/system/share/mediatomb/js/common.js + /raid0/data/module/MEDIATOMB/system/share/mediatomb/js/playlists.js + + /raid0/data/module/MEDIATOMB/system/share/mediatomb/js/import.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + audio/L16 + no + yes + no + + + + + video/mpeg + yes + yes + yes + + + + + + Index: /mediatomb/module/www/foo =================================================================== --- /mediatomb/module/www/foo (revision 4) +++ /mediatomb/module/www/foo (revision 4) @@ -0,0 +1,321 @@ +$value"); + $node1 = dom_import_simplexml($parent); + $dom_sxe = dom_import_simplexml($new_child); + $node2 = $node1->ownerDocument->importNode($dom_sxe, true); + $node1->appendChild($node2); + return simplexml_import_dom($node2); + } + + + function simplexml_addAttribute($parent, $name, $value=''){ + $node1 = dom_import_simplexml($parent); + $node1->setAttribute($name,$value); + return simplexml_import_dom($node1); + } + + function write_mt_config($xml) { + global $mt_config; + + // Import into DOM as this allows for PrettyPrinting + $dom = new DOMDocument(); + $dom->preserveWhiteSpace = false; + $dom->loadXML($xml->asXML()); + $dom->formatOutput = true; + $dom->save($mt_config); +// echo "
".htmlentities($dom->saveXML())."
"; + } + + require_once('/img/www/inc/db.class.php'); + + // retrieve the configuration status of the shipped DLNA_server + $dbtool=new dbtool(); + $dbtool->connect(); + $DLNA_server=$dbtool->db_getvar("DLNA_server","0"); + $bonding=$dbtool->db_getvar("nic1_mode_8023ad","none"); + $dbtool->db_close(); + + // Load the MediaTomb XML config + $mt_config = '/raid/data/module/MEDIATOMB/system/etc/config.xml'; + $xml = simplexml_load_file($mt_config); + + // Get the interface from the MT config + $interface = (string)$xml->server->interface; + + // Fixup incorrect network settings, e.g. bonding enabled but MT listening somewhere else. + if ($bonding != 'none' && $interface != 'bond0') { + $interface = bond0; + $xml->server->interface = $interface; + write_mt_config($xml); + } else if ($bonding == 'none' && interface == 'bond0') { + $interface = eth0; + $xml->server->interface = $interface; + write_mt_config($xml); + } + + // Get the list of available shares from the samba config + $fh = fopen("/etc/samba/smb.conf", "r"); + $contents = fread($fh, filesize("/etc/samba/smb.conf")); + fclose($fh); + preg_match_all("/\[([^\]]*)\]\s*comment = ([^\n]*)[^\[]*guest only = ([^\n]*)[^\[]*path = ([^\n]*)/",$contents,$shares); + + $share_blacklist = array("nsync", "usbhdd", "usbcopy"); + + $mt_share_list = array(); + // Get the list of exported shares from the mediatomb xml config + foreach ($xml->import->autoscan->directory as $elem) { + $mt_share_list[] = (string)$elem['location']; + } + + + + // We're seeing a request. Handle it. + if (array_key_exists('action', $_POST)) { + if (!array_key_exists('shared', $_POST)) { + $_POST['shared'] = array(); + } + + // Find the shares not currently shared but requested + $add = (array_diff($_POST['shared'], $mt_share_list)); + // Find the shares not currently shared but requested + $del = (array_diff($mt_share_list, $_POST['shared'])); + + foreach ($add as $dir) { + print '

Adding '.$dir.'

'; + $directory = simplexml_addChild($xml->import->autoscan, 'directory'); + simplexml_addAttribute($directory, 'location', $dir); +// inotify is not supported on the current thecus kernel +// simplexml_addAttribute($directory, 'mode', 'inotify'); + simplexml_addAttribute($directory, 'mode', 'timed'); + simplexml_addAttribute($directory, 'interval', '3600'); + simplexml_addAttribute($directory, 'level', 'basic'); + simplexml_addAttribute($directory, 'recursive', 'yes'); + simplexml_addAttribute($directory, 'hidden-files', 'no'); + } + + + // Outer loop is a workaround for an early break as content is changing. + for ($i=0; $i < count($del); $i++) { + foreach ($xml->import->autoscan->directory as $dir) { + if (in_array((string)$dir['location'], $del)) { + print '

Removing '.(string)$dir['location'].'

'; + $oNode = dom_import_simplexml($dir); + $oNode->parentNode->removeChild($oNode); + } + } + } + + write_mt_config($xml); + + // File was modified, reload + $xml = simplexml_load_file($mt_config); + $mt_share_list = array(); + // Get the list of exported shares from the mediatomb xml config + foreach ($xml->import->autoscan->directory as $elem) { + $mt_share_list[] = (string)$elem['location']; + } + } + + + print ' +
+ + + + + + + +
+ + + + +
+
+
+ + + + + +
+
Mediatomb - Free UPnP MediaServer
+
+
+
+
+
+
+'; + + if ($DLNA_server == 1) { + print ' + + + + +
+

The internal Mediabolic DLNA server is currently enabled.

+

Please disable it first through the Network/Media Server menu.

+
+'; + + } else { + + print ' +
+ + + + +
+ + + + +'; + + for ($i=0; $i < count($shares[0]); $i++) { + if (!in_array($shares[1][$i], $share_blacklist)) { + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + } + + print '
+
+
+ + + + +
Shared Media Folders
+
+
+
'; + if (in_array($shares[4][$i], $mt_share_list)) { + print ''.$shares[1][$i].''.$shares[2][$i].'
+
+'; + + + print ' + + + + +
+ + + + '; + + + + print ' + + + +'; + +/* + + if ((string)$xml->server->ui['enabled'] == "yes") { + $webui = true; + } else { + $webui = false; + } + + print ' + + + +'; + + + print '
+
+
+ + + + +
System settings
+
+
+
Network Interface: + +
Webinterface + +
+
+'; +*/ + + print ' + + + + +
+
+ +
+
+ +
+'; + + + + } + + + + +?> Index: /mediatomb/module/www/.htaccess =================================================================== --- /mediatomb/module/www/.htaccess (revision 4) +++ /mediatomb/module/www/.htaccess (revision 4) @@ -0,0 +1,1 @@ + Index: /mediatomb/module/www/index.htm =================================================================== --- /mediatomb/module/www/index.htm (revision 4) +++ /mediatomb/module/www/index.htm (revision 4) @@ -0,0 +1,353 @@ +$value"); + $node1 = dom_import_simplexml($parent); + $dom_sxe = dom_import_simplexml($new_child); + $node2 = $node1->ownerDocument->importNode($dom_sxe, true); + $node1->appendChild($node2); + return simplexml_import_dom($node2); + } + + + function simplexml_addAttribute($parent, $name, $value=''){ + $node1 = dom_import_simplexml($parent); + $node1->setAttribute($name,$value); + return simplexml_import_dom($node1); + } + + function write_mt_config($xml) { + global $mt_config; + + // Import into DOM as this allows for PrettyPrinting + $dom = new DOMDocument(); + $dom->preserveWhiteSpace = false; + $dom->loadXML($xml->asXML()); + $dom->formatOutput = true; + $dom->save($mt_config); +// echo "
".htmlentities($dom->saveXML())."
"; + } + + function restart_mt_server() { + shell_exec("/raid/data/module/MEDIATOMB/Shell/module.rc stop"); + shell_exec("/raid/data/module/MEDIATOMB/Shell/module.rc start"); + } + + require_once('/img/www/inc/db.class.php'); + + // retrieve the configuration status of the shipped DLNA_server + $dbtool=new dbtool(); + $dbtool->connect(); + $DLNA_server=$dbtool->db_getvar("DLNA_server","0"); + $bonding=$dbtool->db_getvar("nic1_mode_8023ad","none"); + $dbtool->db_close(); + + // Load the MediaTomb XML config + $mt_config = '/raid/data/module/MEDIATOMB/system/etc/config.xml'; + $xml = simplexml_load_file($mt_config); + + // Get the interface from the MT config + $interface = (string)$xml->server->interface; + + // Fixup incorrect network settings, e.g. bonding enabled but MT listening somewhere else. + if ($bonding != 'none' && $interface != 'bond0') { + $interface = 'bond0'; + $xml->server->interface = $interface; + write_mt_config($xml); + restart_mt_server(); + } else if ($bonding == 'none' && $interface == 'bond0') { + $interface = 'eth0'; + $xml->server->interface = $interface; + write_mt_config($xml); + restart_mt_server(); + } + + // Get the list of available shares from the samba config + $fh = fopen("/etc/samba/smb.conf", "r"); + $contents = fread($fh, filesize("/etc/samba/smb.conf")); + fclose($fh); + preg_match_all("/\[([^\]]*)\]\s*comment = ([^\n]*)[^\[]*guest only = ([^\n]*)[^\[]*path = ([^\n]*)/",$contents,$shares); + + $share_blacklist = array("nsync", "usbhdd", "usbcopy"); + + $mt_share_list = array(); + // Get the list of exported shares from the mediatomb xml config + foreach ($xml->import->autoscan->directory as $elem) { + $mt_share_list[] = (string)$elem['location']; + } + + + + // We're seeing a request. Handle it. + if (array_key_exists('action', $_POST)) { + if (!array_key_exists('shared', $_POST)) { + $_POST['shared'] = array(); + } + + // Find the shares not currently shared but requested + $add = (array_diff($_POST['shared'], $mt_share_list)); + // Find the shares not currently shared but requested + $del = (array_diff($mt_share_list, $_POST['shared'])); + + foreach ($add as $dir) { + print '

Adding '.$dir.'

'; + $directory = simplexml_addChild($xml->import->autoscan, 'directory'); + simplexml_addAttribute($directory, 'location', $dir); +// inotify is not supported on the current thecus kernel +// simplexml_addAttribute($directory, 'mode', 'inotify'); + simplexml_addAttribute($directory, 'mode', 'timed'); + simplexml_addAttribute($directory, 'interval', '3600'); + simplexml_addAttribute($directory, 'level', 'basic'); + simplexml_addAttribute($directory, 'recursive', 'yes'); + simplexml_addAttribute($directory, 'hidden-files', 'no'); + } + + + // Outer loop is a workaround for an early break as content is changing. + for ($i=0; $i < count($del); $i++) { + foreach ($xml->import->autoscan->directory as $dir) { + if (in_array((string)$dir['location'], $del)) { + print '

Removing '.(string)$dir['location'].'

'; + $oNode = dom_import_simplexml($dir); + $oNode->parentNode->removeChild($oNode); + + // Remove the deleted stuff from the sqlite db. Have to shellexec this here as php has no + // support for sqlite3 + $cmd = 'LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/raid/data/module/MEDIATOMB/system/lib/"'; + $cmd .= ' /raid/data/module/MEDIATOMB/system/bin/sqlite3'; + $cmd .= ' /raid/data/module/MEDIATOMB/system/var/mediatomb/mediatomb.db'; + $cmd .= ' "DELETE FROM mt_cds_object + WHERE + location LIKE \'F'.(string)$dir['location'].'/%\' + OR + location LIKE \'D'.(string)$dir['location'].'/%\' + OR + location LIKE \'D'.(string)$dir['location'].'\' + ;"'; + + shell_exec("/raid/data/module/MEDIATOMB/Shell/module.rc stop"); + shell_exec($cmd); + shell_exec("/raid/data/module/MEDIATOMB/Shell/module.rc start"); + } + } + } + + if (array_key_exists('interface', $_POST)) { + $interface = $_POST['interface']; + $xml->server->interface = $interface; + } + + write_mt_config($xml); + restart_mt_server(); + + // File was modified, reload + $xml = simplexml_load_file($mt_config); + $mt_share_list = array(); + // Get the list of exported shares from the mediatomb xml config + foreach ($xml->import->autoscan->directory as $elem) { + $mt_share_list[] = (string)$elem['location']; + } + } + + + print ' +
+ + + + + + + +
+ + + + +
+
+
+ + + + + +
+
Mediatomb - Free UPnP MediaServer
+
+
+
+
+
+
+'; + + if ($DLNA_server == 1) { + print ' + + + + +
+

The internal Mediabolic DLNA server is currently enabled.

+

Please disable it first through the Network/Media Server menu.

+
+'; + + } else { + + print ' +
+ + + + +
+ + + + +'; + + for ($i=0; $i < count($shares[0]); $i++) { + if (!in_array($shares[1][$i], $share_blacklist)) { + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + + print ''."\n"; + print ''."\n"; + print ''."\n"; + } + } + + print '
+
+
+ + + + +
Shared Media Folders
+
+
+
'; + if (in_array($shares[4][$i], $mt_share_list)) { + print ''.$shares[1][$i].''.$shares[2][$i].'
+
+'; + + + print ' + + + + +
+ + + + '; + + + + print ' + + + +'; + +/* + + if ((string)$xml->server->ui['enabled'] == "yes") { + $webui = true; + } else { + $webui = false; + } + + print ' + + + +'; + + + print '
+
+
+ + + + +
System settings
+
+
+
Network Interface: + +
Webinterface + +
+
+'; +*/ + + print ' + + + + +
+
+ +
+
+ +
+'; + + + + } + + + + +?> Index: /mediatomb/module/Shell/enable.sh =================================================================== --- /mediatomb/module/Shell/enable.sh (revision 4) +++ /mediatomb/module/Shell/enable.sh (revision 4) @@ -0,0 +1,65 @@ +#!/bin/sh +############################################################################### +## +## Module enable/disable script +## +############################################################################### + +modName=$1 +modEnable=$2 + +############################################################################### +## +## Include module library +## +############################################################################### +modLibDir=/raid/data/module/$modName/Shell +{ [ -r "$modLibDir/module.lib" ] && source "$modLibDir/module.lib"; } || { echo error; exit 1; } + +############################################################################### +## +## Enable +## +############################################################################### +enable() { + $modRC start + + return $? +} + +############################################################################### +## +## Disable +## +############################################################################### +disable() { + $modRC stop + + return $? +} + +############################################################################### +## +## Main +## +############################################################################### + +result=fail + +case "$modEnable" in + No|no) + enable && result=pass + ;; + + Yes|yes) + disable && result=pass + ;; + + *) + ;; +esac + +echo $result + +exit 0 + Index: /mediatomb/module/Shell/install.sh =================================================================== --- /mediatomb/module/Shell/install.sh (revision 4) +++ /mediatomb/module/Shell/install.sh (revision 4) @@ -0,0 +1,59 @@ +#!/bin/sh +############################################################################### +## +## Module install script +## +############################################################################### + +modName=MEDIATOMB + +############################################################################### +## +## Include module library +## +############################################################################### +shellDir="/raid/data/module/$modName/Shell" +[ ! -d "$shellDir" -o ! -r "$shellDir/module.lib" ] && shellDir=/raid/data/tmp/module/Shell +{ [ -r "$shellDir/module.lib" ] && source "$shellDir/module.lib"; } || { echo fail; exit 1; } + +############################################################################### +## +## Start the module installation +## +############################################################################### +ModuleInstallStart + +############################################################################### +## +## Module specific installation stuff +## +############################################################################### +# Do the initial configuration of the mediatomb server + +# Set UUID +UUID=$(cat /proc/sys/kernel/random/uuid) +echo "Setting initial UUID to randomly generated string: $UUID" >>$modLog +sed -i -e "s/@@@UUID@@@/$UUID/" $modDir/system/etc/config.xml +unset UUID + +# Set hostname +echo "Setting display name of mediatomb: $(hostname -f)" >>$modLog +sed -i -e "s/@@@NAME@@@/$(hostname -f)/" $modDir/system/etc/config.xml + +# Set interface to bind to +IF_MODE=$(/opt/bin/sqlite /app/cfg/conf.db "SELECT v FROM conf WHERE k = 'nic1_mode_8023ad';") +if [ "$IF_MODE" != "none" ]; then + echo "Interface bonding mode is $IF_MODE. Bonding detected, binding mediatomb service to bond0" >>$modLog + sed -i -e "s/@@@INTERFACE@@@/bond0/" $modDir/system/etc/config.xml +else + echo "Interface bonding mode is $IF_MODE. No bonding detected, binding mediatomb service to WAN interface" >>$modLog + sed -i -e "s/@@@INTERFACE@@@/eth0/" $modDir/system/etc/config.xml +fi + +############################################################################### +## +## Finish module installation indicating success +## +############################################################################### +ModuleInstallEnd 0 + Index: /mediatomb/module/Shell/uninstall.sh =================================================================== --- /mediatomb/module/Shell/uninstall.sh (revision 4) +++ /mediatomb/module/Shell/uninstall.sh (revision 4) @@ -0,0 +1,38 @@ +#!/bin/sh +############################################################################### +## +## Module uninstall script +## +############################################################################### + +modName=MEDIATOMB + +############################################################################### +## +## Include module library +## +############################################################################### +shellDir=/raid/data/module/$modName/Shell +{ [ -r "$shellDir/module.lib" ] && source "$shellDir/module.lib"; } || { echo fail; exit 1; } + +############################################################################### +## +## Start module uninstall +## +############################################################################### +ModuleUninstallStart + +############################################################################### +## +## Module specific uninstallation stuff +## +############################################################################### + + +############################################################################### +## +## Finish module uninstall indicating success +## +############################################################################### +ModuleUninstallEnd 0 + Index: /mediatomb/module/Shell/module.rc =================================================================== --- /mediatomb/module/Shell/module.rc (revision 4) +++ /mediatomb/module/Shell/module.rc (revision 4) @@ -0,0 +1,139 @@ +#!/bin/sh +############################################################################### +## +## Startup script for Module +## +############################################################################### + +modName=MEDIATOMB + +cmd=$1 + +############################################################################### +## +## Include module library +## +############################################################################### +modLibDir=/raid/data/module/$modName/Shell +{ [ -r "$modLibDir/module.lib" ] && source "$modLibDir/module.lib"; } || { echo error; exit 1; } + +############################################################################### +## +## Start +## +############################################################################### +start () { + + ProcsRunning "$modDir/system/bin/mediatomb" && $0 stop + + mv $modDir/system/var/log/mediatomb.log $modDir/system/var/log/mediatomb.log.old 2> /dev/null + + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$modDir/system/lib" + $modDir/system/bin/mediatomb \ + -m $modDir/system \ + -f etc \ + -P $modDir/system/var/run/mediatomb.pid \ + -l $modDir/system/var/log/mediatomb.log \ + -d + + if ! ProcsRunning "$modDir/system/bin/mediatomb" &>/dev/null ; then + return 1 + fi + + return 0 +} + +############################################################################### +## +## Stop +## +############################################################################### +stop () { + + ProcKillall "$modDir/system/bin/mediatomb" 15 + return $? +} + +############################################################################### +## +## Boot +## +############################################################################### +boot () { + $0 start + return $? +} + +############################################################################### +## +## Status +## +############################################################################### +status () { + + if nProcs=$(ProcsRunning "$modDir/system/bin/mediatomb") ; then + echo "$modName running($nProcs)" + else + echo "$modName stopped!" + fi + + +} + +############################################################################### +## +## Main +## +############################################################################### + +case "$cmd" in + start) + echo "Starting $modName..." + if start ; then + echo "Started $modName!" + else + echo "Failed to start $modName!" + exit 1 + fi + ;; + + stop) + echo "Stopping $modName..." + if stop ; then + echo "Stopped $modName!" + else + echo "Failed to stop $modName!" + exit 1 + fi + ;; + + boot) + echo "Booting $modName..." + if boot ; then + echo "Booted $modName!" + else + echo "Failed to boot $modName!" + exit 1 + fi + ;; + + status) + status + ;; + + restart) + echo "Restarting $modName..." + if stop && start ; then + echo "Restarted $modName!" + else + echo "Failed to restart $modName!" + exit 1 + fi + ;; + + *) + echo "Usage: $0 {start|stop|restart|boot|status}" + exit 1 +esac + +exit 0 Index: /mediatomb/module/Shell/module.lib =================================================================== --- /mediatomb/module/Shell/module.lib (revision 4) +++ /mediatomb/module/Shell/module.lib (revision 4) @@ -0,0 +1,452 @@ +############################################################################### +## +## Module library +## +## 2007-01-16 Andreas Vogel (omega) +## +############################################################################### + +modInstDir=/raid/data/tmp/module # temporary module directory during install +modBaseDir=/raid/data/module # root of the module tree +modCfgDir=$modBaseDir/cfg # config directory for all modules +modBinDir=$modBaseDir/bin # directory for all module executables +modShlibDir=$modBaseDir/shlib # directory for all module shared libraries +modBackupDir=$modBaseDir/backup/$modName # directory holding backup data for each module +modDir=$modBaseDir/$modName # home directory for this module + +modRC=$modCfgDir/module.rc/$modName.rc # system start/stop script for this module +modDB=$modCfgDir/module.db # system module database + +modLogDir=$modBaseDir/log # directory for log files +modLog=$modLogDir/$modName.log # install/uninstall/update log file for module + +############################################################################### +## +## Include E-Mail library +## +############################################################################### +shellDir="/raid/data/module/$modName/Shell" +[ ! -d "$shellDir" -o ! -r "$shellDir/email.lib" ] && shellDir=/raid/data/tmp/module/Shell +{ [ -r "$shellDir/email.lib" ] && source "$shellDir/email.lib"; } || { echo fail; exit 1; } + +############################################################################### +## +## Now +## +############################################################################### +Now () { + echo $(date '+%Y-%m-%d %H:%M:%S') +} + +############################################################################### +## +## ModVersion +## +############################################################################### +ModVersion () { + local version=$(awk '{print $2}' < "$modDir/VERSION") + + if [ -z $version ] ; then + version="0.00.00" + fi + echo $version +} + +############################################################################### +## +## ModuleInit +## +############################################################################### +ModuleInit () { + [ -d $modBaseDir -a ! -d $modLogDir ] && mkdir $modLogDir &>/dev/null + [ ! -d $modLogDir ] && modLog=/raid/data/$modName.log + > $modLog +} + +############################################################################### +## +## ModuleStart +## +############################################################################### +ModuleStart () { + mode=$1 + + ModuleInit + + echo "START module $mode: $modName ($(Now))" >>$modLog + echo "------------------------------------------------------------------------------" >>$modLog +} + +############################################################################### +## +## ModuleInstallStart +## +############################################################################### +ModuleInstallStart () { + ModuleStart install + + allDirs="$modCfgDir $modCfgDir/module.rc \ + $modBaseDir/backup $modBackupDir \ + $modShlibDir $modBinDir \ + $modDir $modDir/Shell $modDir/system $modDir/system/etc $modDir/www" + + for dir in $allDirs ; do + echo "Create standard directory: $dir" >>$modLog + [ ! -d $dir ] && mkdir $dir >>$modLog 2>&1 + FileAttr root root 755 $dir >>$modLog 2>&1 + done + ln -sf Shell $modDir/shell + echo >>$modLog + + for dir in Shell system www ; do + echo "Copy standard directory: $modInstDir/$dir -> $modDir/$dir" >>$modLog + for file in $modInstDir/$dir/* ; do + [ -e "$file" ] && cp -r $file $modDir/$dir/ >>$modLog 2>&1 + done + done + echo >>$modLog + + echo "Copy license file: $modInstDir/Configure/license.txt -> $modDir/COPY" >>$modLog + rm -f $modDir/COPY >>$modLog 2>&1 + cp $modInstDir/Configure/license.txt $modDir/COPY >>$modLog 2>&1 + FileAttr root root 644 $modDir/COPY >>$modLog 2>&1 + + echo "Create module.rc link: $modRC -> $modDir/Shell/module.rc" >>$modLog + rm -f $modRC >>$modLog 2>&1 + ln -s $modDir/Shell/module.rc $modRC >>$modLog 2>&1 + + modVersion="$(grep '.*' $modInstDir/Configure/install.rdf | tr '<' ' ' | tr '>' ' ' | awk '{print $2;exit}')" + echo "$modName $modVersion $(Now)" > $modDir/VERSION + FileAttr root root 644 $modDir/VERSION >>$modLog 2>&1 + + ## + ## TODO: Patch the apache config file in order to allow .htaccess files in the module directory + ## + apacheCfg=/etc/httpd/conf/httpd.conf + echo "Apache config: Saving apache config file $apacheCfg -> $apacheCfg.ORIG" >>$modLog + [ ! -e "$apacheCfg.ORIG" ] && cp -p "$apacheCfg" "$apacheCfg.ORIG" >>$modLog 2>&1 + + grepLine='LoadModule access_module modules/mod_access.so' + if grep "$grepLine" "$apacheCfg" &>/dev/null ; then + echo "Apache config: add module_access to apache config file: $apacheCfg" >>$modLog + echo "$grepLine" > $tmpfile + cat "$apacheCfg" >> $tmpfile + mv $tmpfile "$apacheCfg" + fi + + grepLine='AllowOverride AuthConfig' + if grep "$grepLine" "$apacheCfg" &>/dev/null ; then + echo "Apache config: add 'AllowOverride Limit' apache config file: $apacheCfg" >>$modLog + sed -i -e "s/$grepLine/ AllowOverride Limit AuthConfig/g" "$apacheCfg" >>$modLog 2>&1 + fi + + ## + ## TODO: Augment PATH variable and add LD_LIBRARY_PATH variable to /etc/profile + ## + profile=/etc/profile + tmpfile=/tmp/profile.tmp + + echo "Backup SHELL profile settings: $profile -> $profile.ORIG" >>$modLog + [ ! -e "$profile.ORIG" ] && cp -p "$profile" "$profile.ORIG" >>$modLog 2>&1 + + grepLine1='true && export PATH=' + grepLine2='true && export LD_LIBRARY_PATH=' + + cat $profile | grep -v "$grepLine1" | grep -v "$grepLine2" > $tmpfile + echo 'true && export PATH="/raid/data/module/bin:$PATH"' >> $tmpfile + echo 'true && export LD_LIBRARY_PATH="/raid/data/module/lib:/opt/apache/lib:$LD_LIBRARY_PATH"' >> $tmpfile + mv $tmpfile $profile + + ## + ## TODO: This patching code can be removed after Thecus fixed their software + ## + rclocal=/app/cfg/rc.local + if grep '/img/bin/rc/rc.module >/dev/null 2>&1 &' $rclocal &>/dev/null ; then + echo "Patch $rclocal..." + if [ ! -e $rclocal.ORIG ] ; then + echo "Backup rc.local: $rclocal -> $rclocal.ORIG" >>$modLog + cp $rclocal $rclocal.ORIG >>$modLog 2>&1 + fi + sed -i -e 's#/img/bin/rc/rc.module >/dev/null 2>&1 &#/img/bin/rc/rc.module start >/dev/null 2>\&1 \&#' \ + $rclocal >>$modLog 2>&1 + fi + + echo >>$modLog + echo "---- Start module specific log -----------------------------------------------" >>$modLog + echo >>$modLog +} + +############################################################################### +## +## ModuleUpdateStart +## +############################################################################### +ModuleUpdateStart () { + ModuleStart update + + if [ -r "$modDir/VERSION" ] ; then + modVersion=$(awk '{print $2}' < "$modDir/VERSION") + else + modVersion="0.00.00" + fi + + echo >>$modLog + echo "---- Start module specific log -----------------------------------------------" >>$modLog + echo >>$modLog +} + +############################################################################### +## +## ModuleUninstallStart +## +############################################################################### +ModuleUninstallStart () { + ModuleStart uninstall + + echo "Stop module: $modRC stop" >>$modLog 2>&1 + $modRC stop >>$modLog 2>&1 + + if [ -r "$modDir/VERSION" ] ; then + modVersion=$(awk '{print $2}' < "$modDir/VERSION") + else + modVersion="0.00.00" + fi + + echo >>$modLog + echo "---- Start module specific log -----------------------------------------------" >>$modLog + echo >>$modLog +} + +############################################################################### +## +## ModuleEnd +## +############################################################################### +ModuleEnd () { + exitcode=$1 ; mode=$2 + + if [ "$exitcode" == "0" ] ; then + echo "FINISH module $mode: $modName ($(Now))" >>$modLog + exitMsg=pass + else + echo "ERROR($exitcode) module $mode: $modName ($(Now))" >>$modLog + exitMsg=fail + fi + + ## + ## Append this log to the log file containing all logs. + ## + modLogAll=${modLog}-all + echo >>$modLogAll + echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" >>$modLogAll + echo >>$modLogAll + cat $modLog >>$modLogAll + + ## + ## Mail the result + ## + if [ -f $modLog -a -r $modLog ] ; then + case $mode in + install) modeNoun=Installation ; modeVerb=installed ;; + update) modeNoun=Update ; modeVerb=updated ;; + uninstall) modeNoun=Uninstallation ; modeVerb=uninstalled ;; + *) modeNoun=Unknown ; modeVerb=unknown ;; + esac + MailResult "$modName" "$modVersion" "$modLog" "$modeNoun" "$modeVerb" + fi + + echo $exitMsg +} + +############################################################################### +## +## ModuleInstallEnd +## +############################################################################### +ModuleInstallEnd () { + exitcode=$1 + + echo >>$modLog + echo "---- End module specific log -------------------------------------------------" >>$modLog + echo >>$modLog + + ## + ## Set file attributes for standard scripts + ## + for script in configtool ; do + echo "Setting file attribs for: $modDir/system/$script" >>$modLog + FileAttr root root 755 $modDir/system/$script >>$modLog 2>&1 + done + + ## + ## Restore saved config files if there are any + ## + echo "Restoring saved $modName configuration files (if any)" >>$modLog + $modDir/system/configtool restore $modName nowarn >>$modLog 2>&1 + + ModuleEnd $exitcode install +} + +############################################################################### +## +## ModuleUpdateEnd +## +############################################################################### +ModuleUpdateEnd () { + exitcode=$1 + + echo >>$modLog + echo "---- End module specific log -------------------------------------------------" >>$modLog + echo >>$modLog + + ModuleEnd $exitcode update +} + +############################################################################### +## +## ModuleUninstallEnd +## +############################################################################### +ModuleUninstallEnd () { + exitcode=$1 + + echo >>$modLog + echo "---- End module specific log -------------------------------------------------" >>$modLog + echo >>$modLog + + ## + ## Restore saved config files if there are any + ## + echo "Save $modName configuration files" >>$modLog + $modDir/system/configtool backup $modName >>$modLog 2>&1 + + ## + ## Delete module from config database + ## + echo "Delete module '$modName' from table 'module' in $modDB..." >>$modLog + /opt/bin/sqlite $modDB "delete from module where name = '$modName'" >>$modLog 2>&1 + + echo "Delete module '$modName' from table 'mod' in $modDB..." >>$modLog + /opt/bin/sqlite $modDB "delete from mod where module = '$modName'" >>$modLog 2>&1 + + echo "Remove start/stop script $modRC..." >>$modLog + rm -f $modRC >>$modLog 2>&1 + + echo "Remove module directory $modDir..." >>$modLog + rm -rf $modDir >>$modLog 2>&1 + + ModuleEnd $exitcode uninstall +} + +############################################################################### +## +## ProcsRunning +## +############################################################################### +ProcsRunning () { + searchPattern="$1" + + procs=$(ps w | grep -v grep | grep -E "$searchPattern" 2>/dev/null | wc -l 2>/dev/null) + [ -z $procs ] && procs=0 + + echo $procs + + return $(expr $procs == 0) +} + +############################################################################### +## +## ProcKillall +## +############################################################################### +ProcKillall () { + procPattern="$1" ; signal=${2:-9} + + if [ -z "$procPattern" ] ; then + return 0 + fi + + loop=0 + while true ; do + pidlist=$(ps -w | grep -v grep | grep -E "$procPattern" 2>/dev/null | awk '{print $1}') + for pid in $pidlist ; do + kill -$signal $pid &>/dev/null + done + + if ! ProcsRunning "$procPattern" &>/dev/null || test $loop -gt 10 ; then + break + fi + sleep 1 + let loop++ + done + + if ProcsRunning "$procPattern" &>/dev/null ; then + return 1 + fi + + return 0 +} + +############################################################################### +## +## MailResult +## +############################################################################### +MailResult() { + modName=$1 ; modVers=$2 ; instLogFile=$3 ; modeNoun=${4:-Installation} ; modeVerb=${5:-installed} + + tmpmsgfile=/tmp/tmp.TestMail.$$ + + cat > $tmpmsgfile <<-EOF + From: @mailEnvFrom@ + To: @mailEnvTo@ + Subject: $modeNoun finished for module $modName-$modVers + + Hello @mailEnvTo@, + + The module $modName-$modVers was $modeVerb on your Thecus N5200 device @hostname@. + + Please check the log output below for errors ($instLogFile): + ======================================================================= + +EOF + + cat $instLogFile >> $tmpmsgfile + + cat >> $tmpmsgfile <<-EOF + + ======================================================================= + + + ----------------------------------------------------------------------- + This is a software generated mail message on @hostname@ at @now@. +EOF + + MailSend "" "" $tmpmsgfile + rm -f $tmpmsgfile +} + + +############################################################################### +## +## FileAttr +## +############################################################################### +FileAttr () { + sOwner=$1 ; sGroup=$2 ; sMode=$3 ; shift ; shift ; shift + + if [ $# -le 0 ] ; then + echo "FileAttr: WARNING: no files given" + return 1 + fi + + ret=0 + + for file in $* ; do + chown $sOwner.$sGroup "$file" || ret=1 + chmod $sMode "$file" || ret=1 + done + + return $ret +} + Index: /mediatomb/module/Shell/update.sh =================================================================== --- /mediatomb/module/Shell/update.sh (revision 4) +++ /mediatomb/module/Shell/update.sh (revision 4) @@ -0,0 +1,41 @@ +#!/bin/sh +############################################################################### +## +## Module update script +## +############################################################################### + +modName=$1 +modVersion=$2 +modEnable=$3 +modURL=$4 + +############################################################################### +## +## Include module library +## +############################################################################### +modLibDir=/raid/data/module/$modName/Shell +{ [ -r "$modLibDir/module.lib" ] && source "$modLibDir/module.lib"; } || { echo error; exit 1; } + +############################################################################### +## +## Start the module update +## +############################################################################### +ModuleUpdateStart + +############################################################################### +## +## Module specific update stuff +## +############################################################################### + + +############################################################################### +## +## Finish module update indicating error +## +############################################################################### +ModuleUpdateEnd 1 + Index: /mediatomb/module/Shell/email.lib =================================================================== --- /mediatomb/module/Shell/email.lib (revision 4) +++ /mediatomb/module/Shell/email.lib (revision 4) @@ -0,0 +1,195 @@ +#!/bin/sh +############################################################################### +## +## This is a more general script library for sending +## E-Mail on the Thecus N5200. +## +## The main function is MailSend(). +## +## 2007-01-16 Andreas Vogel (omega) +## +## Changes: +## 09.01.2007 0.1 initial version +## 31.05.2007 0.2 change mail from for FW >= 1.00.10 (by Peter Futterknecht (peterfu)) +## +############################################################################### + +msmtp=/opt/bin/msmtp +sqlite=/opt/bin/sqlite +confdb=/app/cfg/conf.db + +MailGetRecipients() { + if [ -z "$mailRecipients" ] ; then + sqlcmd="select v from conf where k like 'notif_addr%'" + mailRecipients=$($sqlite $confdb "$sqlcmd" | tr "\n" " ") + fi + echo $mailRecipients +} + +MailGetAuthName() { + if [ -z "$mailAuthName" ] ; then + sqlcmd="select v from conf where k='notif_account'" + mailAuthName=$($sqlite $confdb "$sqlcmd") + fi + echo $mailAuthName +} + +MailGetAuthPasswd() { + if [ -z "$mailAuthPasswd" ] ; then + sqlcmd="select v from conf where k='notif_password'" + mailAuthPasswd=$($sqlite $confdb "$sqlcmd") + fi + echo $mailAuthPasswd +} + +MailGetAuthMethod() { + if [ -z "$mailAuthMethod" ] ; then + sqlcmd="select v from conf where k='notif_auth'" + mailAuthMethod=$($sqlite $confdb "$sqlcmd") + fi + echo $mailAuthMethod +} + +MailGetServer() { + if [ -z "$mailServer" ] ; then + sqlcmd="select v from conf where k='notif_smtp'" + mailServer=$($sqlite $confdb "$sqlcmd") + fi + echo $mailServer +} + +MailGetPort() { + if [ -z "$mailPort" ] ; then + sqlcmd="select v from conf where k='notif_smtport'" + mailPort=$($sqlite $confdb "$sqlcmd") + fi + echo $mailPort +} + +MailGetNotify() { + if [ -z "$mailNotify" ] ; then + if [ -n "$1" ];then + field="notif_$1" + sqlcmd="select v from conf where k='$field'" + mailNotify=$($sqlite $confdb "$sqlcmd") + fi + fi + echo $mailNotify +} + +MailGetFrom () { + if [ -z "$mailFrom" ] ; then + sqlcmd="select v from conf where k='notif_from'" + mailFrom=$($sqlite $confdb "$sqlcmd") + fi + if [ -z "$mailFrom" ] ; then + mailFrom="thecus@$(hostname)" + fi + echo $mailFrom +} + +############################################################################### +## +## +## +############################################################################### +MailSend () { + mailEnvFrom=$1 + mailEnvToList=$2 + msgOrFile=$3 + + if [ -z "$mailEnvFrom" ] ; then + mailEnvFrom=$(MailGetFrom) + fi + if [ -z "$mailEnvToList" ] ; then + mailEnvToList=$(MailGetRecipients) + fi + if [ -z "$(MailGetAuthName)" -o -z "$(MailGetAuthPasswd)" ] ; then + auth=$(MailGetAuthMethod) + else + auth=off + fi + + wanAddr=$(/sbin/ifconfig eth0 | grep 'inet addr:' | tr ':' ' ' | awk '{print $3;exit}') + lanAddr=$(/sbin/ifconfig eth1 | grep 'inet addr:' | tr ':' ' ' | awk '{print $3;exit}') + now=$(date '+%Y-%m-%d %H:%M:%S') + + tmpInFile=/tmp/tmp.MailSend.in.$$ + tmpOutFile=/tmp/tmp.MailSend.out.$$ + + if [ -f "$msgOrFile" ] ; then + cp "$msgOrFile" $tmpInFile + else + echo "$msgOrFile" > $tmpInFile + fi + + for mailEnvTo in $mailEnvToList ; do + sed \ + -e "s/@mailEnvFrom@/$mailEnvFrom/g" \ + -e "s/@mailEnvTo@/$mailEnvTo/g" \ + -e "s/@mailRecipients@/$(MailGetRecipients)/g" \ + -e "s/@mailAuthName@/$(MailGetAuthName)/g" \ + -e "s/@mailAuthPasswd@/$(MailGetAuthPasswd)/g" \ + -e "s/@mailAuthMethod@/$(MailGetAuthMethod)/g" \ + -e "s/@mailServer@/$(MailGetServer)/g" \ + -e "s/@mailPort@/$(MailGetPort)/g" \ + -e "s/@mailNotify@/$(MailGetNotify)/g" \ + -e "s/@wanAddr@/$wanAddr/g" \ + -e "s/@lanAddr@/$lanAddr/g" \ + -e "s/@hostname@/$(hostname)/g" \ + -e "s/@now@/$now/g" \ + < $tmpInFile > $tmpOutFile + + $msmtp --host="$(MailGetServer)" --port="$(MailGetPort)" \ + --auth="$auth" --user="$(MailGetAuthName)" --password="$(MailGetAuthPasswd)" \ + --from="$mailEnvFrom" \ + $mailEnvTo \ + < $tmpOutFile + done + + rm -f $tmpOutFile + rm -f $tmpInFile +} + + +############################################################################### +## +## +## +############################################################################### +TestMail() { + tmpmsgfile=/tmp/tmp.TestMail.$$ + + cat > $tmpmsgfile <<-EOF + From: @mailEnvFrom@ + To: @mailEnvTo@ + Subject: Test E-Mail from Thecus N5200 (@hostname@) + + Hello @mailEnvTo@ + + This is a test message. + + mailEnvFrom: '@mailEnvFrom@' + mailEnvTo: '@mailEnvTo@' + + mailRecipients: '@mailRecipients@' + mailAuthName: '@mailAuthName@' + mailAuthPasswd: '@mailAuthPasswd@' + mailAuthMethod: '@mailAuthMethod@' + mailServer: '@mailServer@' + mailPort: '@mailPort@' + mailNotify: '@mailNotify@' + + wanAddr: '@wanAddr@' + lanAddr: '@lanAddr@' + + hostname: '@hostname@' + now: '@now@' + + ======================================================= + This is a TEST mail message generated at @now@ on @hostname@. +EOF + + MailSend "" "" $tmpmsgfile + rm -f $tmpmsgfile +} Index: /mediatomb/module/.htaccess =================================================================== --- /mediatomb/module/.htaccess (revision 4) +++ /mediatomb/module/.htaccess (revision 4) @@ -0,0 +1,3 @@ +Order Deny,Allow +Deny from all + Index: /mediatomb/module/Thecus =================================================================== --- /mediatomb/module/Thecus (revision 4) +++ /mediatomb/module/Thecus (revision 4) @@ -0,0 +1,2 @@ +“ +¢£€€[Û=ûž7wš Index: /mediatomb/build.sh =================================================================== --- /mediatomb/build.sh (revision 4) +++ /mediatomb/build.sh (revision 4) @@ -0,0 +1,550 @@ +#!/bin/sh -e + +set -e + +D=${PWD} +D_PREFIX="/raid0/data/module/MEDIATOMB/system" + +rm -rf tmp + +mkdir tmp +mkdir tmp/build +mkdir tmp/install +mkdir tmp/install/bin +mkdir tmp/install/lib +mkdir tmp/install/lib/pkgconfig/ +mkdir tmp/install/include +pushd tmp/build + +export CFLAGS="-O2 -g -march=i686 -mcpu=i686" + +# libjs +tar xvfz ${D}/sources/js-1.5.tar.gz +pushd js/src +gmake -f Makefile.ref BUILD_OPT=1 +install -D -m 755 Linux_All_OPT.OBJ/libjs.so ${D}/tmp/install/lib/libjs.so +install -D -m 755 Linux_All_OPT.OBJ/jsautocfg.h ${D}/tmp/install/include/js/jsautocfg.h +for f in *.h; do + install -D -m 644 $f ${D}/tmp/install/include/js/$f +done +popd + +# libmagic +tar xvfz ${D}/sources/file-5.04.tar.gz +pushd file-5.04 +./configure --prefix=${D_PREFIX} +make +install -D -m 755 src/.libs/file ${D}/tmp/install/bin/file +install -D -m 644 magic/magic.mgc ${D}/tmp/install/share/misc/magic.mgc +install -D -m 644 src/magic.h ${D}/tmp/install/include/magic.h +install -D -m 755 src/.libs/libmagic.so.1.0.0 ${D}/tmp/install/lib/libmagic.so.1.0.0 +ln -sf libmagic.so.1.0.0 ${D}/tmp/install/lib/libmagic.so.1 +ln -sf libmagic.so.1.0.0 ${D}/tmp/install/lib/libmagic.so +popd + +# taglib +tar xvfz ${D}/sources/taglib-1.6.3.tar.gz +pushd taglib-1.6.3 +./configure +make +install -D -m 755 taglib/.libs/libtag.so.1.9.0 ${D}/tmp/install/lib/libtag.so.1.9.0 +ln -sf libtag.so.1.9.0 ${D}/tmp/install/lib/libtag.so.1 +ln -sf libtag.so.1.9.0 ${D}/tmp/install/lib/libtag.so +for f in $(find . -type f -name '*.h'); do + install -D -m 644 ${f} ${D}/tmp/install/include/taglib/$(basename ${f}) +done +install -D -m 644 taglib/toolkit/tlist.tcc ${D}/tmp/install/include/taglib/tlist.tcc +install -D -m 644 taglib/toolkit/tmap.tcc ${D}/tmp/install/include/taglib/tmap.tcc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" taglib.pc > ${D}/tmp/install/lib/pkgconfig/taglib.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" taglib-config > ${D}/tmp/install/bin/taglib-config +chmod +x ${D}/tmp/install/bin/taglib-config +popd + +# libexif +tar xvfj ${D}/sources/libexif-0.6.13.tar.bz2 +pushd libexif-0.6.13 +./configure +make +install -D -m 755 libexif/.libs/libexif.so.12.0.1 ${D}/tmp/install/lib/libexif.so.12.0.1 +ln -sf libexif.so.12.0.1 ${D}/tmp/install/lib/libexif.so.12 +ln -sf libexif.so.12.0.1 ${D}/tmp/install/lib/libexif.so +for f in $(find . -type f -name '*.h'); do + install -D -m 644 ${f} ${D}/tmp/install/include/libexif/$(basename ${f}) +done +popd + +# libjpeg +tar xvfz ${D}/sources/jpegsrc.v8b.tar.gz +pushd jpeg-8b +./configure +make +install -D -m 755 .libs/libjpeg.so.8.0.2 ${D}/tmp/install/lib/libjpeg.so.8.0.2 +ln -sf libjpeg.so.8.0.2 ${D}/tmp/install/lib/libjpeg.so.8 +ln -sf libjpeg.so.8.0.2 ${D}/tmp/install/lib/libjpeg.so +for f in jconfig.h jerror.h jmorecfg.h jpeglib.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/$(basename ${f}) +done +popd + +# libmp4v2 +tar xvfj ${D}/sources/libmp4v2-1.5.0.1.tar.bz2 +pushd libmp4v2-1.5.0.1 +./configure +make +install -D -m 755 ./.libs/libmp4v2.so.0.0.0 ${D}/tmp/install/lib/libmp4v2.so.0.0.0 +ln -sf libmp4v2.so.0.0.0 ${D}/tmp/install/lib/libmp4v2.so.0 +ln -sf libmp4v2.so.0.0.0 ${D}/tmp/install/lib/libmp4v2.so +for f in *.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/libmp4v2/$(basename ${f}) +done +popd + +# lame +tar xvfz ${D}/sources/lame-3.97.tar.gz +pushd lame-3.97 +patch -p 1 < ${D}/sources/lame-as-needed.patch +patch -p 1 < ${D}/sources/lame-noexecstack.patch +autoreconf +sed -i -e 's/^\(\s*hardcode_libdir_flag_spec\s*=\).*/\1/' configure +CFLAGS="$CFLAGS -ffast-math" ./configure \ + --enable-nasm \ + --enable-mp3x \ + --enable-mp3rtp \ + --enable-decode-layer1 +make +install -D -m 755 libmp3lame/.libs/libmp3lame.so.0.0.0 ${D}/tmp/install/lib/libmp3lame.so.0.0.0 +ln -sf libmp3lame.so.0.0.0 ${D}/tmp/install/lib/libmp3lame.so.0 +ln -sf libmp3lame.so.0.0.0 ${D}/tmp/install/lib/libmp3lame.so +install -D -m 644 include/lame.h ${D}/tmp/install/include/lame/lame.h +install -D -m 755 frontend/lame ${D}/tmp/install/bin/lame +install -D -m 755 frontend/mp3rtp ${D}/tmp/install/bin/mp3rtp +install -D -m 755 frontend/mp3x ${D}/tmp/install/bin/mp3x +popd + +# libogg +tar xvfz ${D}/sources/libogg-1.1.3.tar.gz +pushd libogg-1.1.3 +patch -p 1 < ${D}/sources/libogg-1.0-m4.patch +./configure +make +install -D -m 755 src/.libs/libogg.so.0.5.3 ${D}/tmp/install/lib/libogg.so.0.5.3 +ln -sf libogg.so.0.5.3 ${D}/tmp/install/lib/libogg.so.0 +ln -sf libogg.so.0.5.3 ${D}/tmp/install/lib/libogg.so +for f in include/ogg/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/ogg/$(basename ${f}) +done +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" ogg.pc > ${D}/tmp/install/lib/pkgconfig/ogg.pc +popd + +# libvorbis +tar xvfz ${D}/sources/libvorbis-1.3.1.tar.gz +pushd libvorbis-1.3.1 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig ./configure \ + --with-ogg-libraries=${D}/tmp/install/lib \ + --with-ogg-includes=${D}/tmp/install/include +make +for f in libvorbisenc.so.2.0.7 libvorbisfile.so.3.3.2 libvorbis.so.0.4.4; do + install -D -m 755 lib/.libs/${f} ${D}/tmp/install/lib/${f} +done +ln -sf libvorbisenc.so.2.0.7 ${D}/tmp/install/lib/libvorbisenc.so.2 +ln -sf libvorbisenc.so.2.0.7 ${D}/tmp/install/lib/libvorbisenc.so +ln -sf libvorbisfile.so.3.3.2 ${D}/tmp/install/lib/libvorbisfile.so.3 +ln -sf libvorbisfile.so.3.3.2 ${D}/tmp/install/lib/libvorbisfile.so +ln -sf libvorbis.so.0.4.4 ${D}/tmp/install/lib/libvorbis.so.0 +ln -sf libvorbis.so.0.4.4 ${D}/tmp/install/lib/libvorbis.so +for f in include/vorbis/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/vorbis/$(basename ${f}) +done +for f in vorbis.pc vorbisfile.pc vorbisenc.pc; do + sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" ${f} > ${D}/tmp/install/lib/pkgconfig/${f} +done +popd + +# libtheora +tar xvfj ${D}/sources/libtheora-1.1.1.tar.bz2 +pushd libtheora-1.1.1 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig ./configure \ + --with-ogg-libraries=${D}/tmp/install/lib \ + --with-ogg-includes=${D}/tmp/install/include \ + --with-vorbis-libraries=${D}/tmp/install/lib \ + --with-vorbis-includes=${D}/tmp/install/include +make +install -D -m 755 lib/.libs/libtheora.so.0.3.10 ${D}/tmp/install/lib/libtheora.so.0.3.10 +ln -sf libtheora.so.0.3.10 ${D}/tmp/install/lib/libtheora.so.0 +ln -sf libtheora.so.0.3.10 ${D}/tmp/install/lib/libtheora.so +install -D -m 755 lib/.libs/libtheoraenc.so.1.1.2 ${D}/tmp/install/lib/libtheoraenc.so.1.1.2 +ln -sf libtheoraenc.so.1.1.2 ${D}/tmp/install/lib/libtheoraenc.so.1 +ln -sf libtheoraenc.so.1.1.2 ${D}/tmp/install/lib/libtheoraenc.so +install -D -m 755 lib/.libs/libtheoraenc.so.1.1.2 ${D}/tmp/install/lib/libtheoradec.so.1.1.4 +ln -sf libtheoradec.so.1.1.4 ${D}/tmp/install/lib/libtheoradec.so.1 +ln -sf libtheoradec.so.1.1.4 ${D}/tmp/install/lib/libtheoradec.so +for f in include/theora/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/theora/$(basename ${f}) +done +popd + +# flac +tar xvfz ${D}/sources/flac-1.2.1.tar.gz +pushd flac-1.2.1 +LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${D}/tmp/install/lib \ + ./configure \ + --disable-xmms-plugin \ + --disable-rpath \ + --with-ogg-libraries=${D}/tmp/install/lib \ + --with-ogg-includes=${D}/tmp/install/include +make +install -D -m 755 src/libFLAC/.libs/libFLAC.so.8.2.0 ${D}/tmp/install/lib/libFLAC.so.8.2.0 +ln -sf libFLAC.so.8.2.0 ${D}/tmp/install/lib/libFLAC.so.8 +ln -sf libFLAC.so.8.2.0 ${D}/tmp/install/lib/libFLAC.so +install -D -m 755 src/libFLAC++/.libs/libFLAC++.so.6.2.0 ${D}/tmp/install/lib/libFLAC++.so.6.2.0 +ln -sf libFLAC++.so.6.2.0 ${D}/tmp/install/lib/libFLAC++.so.6 +ln -sf libFLAC++.so.6.2.0 ${D}/tmp/install/lib/libFLAC++.so +for f in include/FLAC/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/FLAC/$(basename ${f}) +done +for f in include/FLAC++/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/FLAC++/$(basename ${f}) +done +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" src/libFLAC/flac.pc > ${D}/tmp/install/lib/pkgconfig/flac.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" src/libFLAC++/flac++.pc > ${D}/tmp/install/lib/pkgconfig/flac++.pc +install -D -m 644 src/libFLAC/libFLAC.m4 ${D}/tmp/install/share/aclocal/libFLAC.m4 +install -D -m 644 src/libFLAC++/libFLAC++.m4 ${D}/tmp/install/share/aclocal/libFLAC++.m4 +popd + +# libsndfile +tar xvfz ${D}/sources/libsndfile-1.0.21.tar.gz +pushd libsndfile-1.0.21 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig \ + LDFLAGS="-Wl,--rpath-link,${D}/tmp/install/lib" \ + ./configure \ + --disable-alsa +make +install -D -m 755 ./src/.libs/libsndfile.so.1.0.21 ${D}/tmp/install/lib/libsndfile.so.1.0.21 +ln -sf libsndfile.so.1.0.21 ${D}/tmp/install/lib/libsndfile.so.1 +ln -sf libsndfile.so.1.0.21 ${D}/tmp/install/lib/libsndfile.so +for f in src/sndfile.h src/sndfile.hh; do + install -D -m 644 ${f} ${D}/tmp/install/include/$(basename ${f}) +done +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" sndfile.pc > ${D}/tmp/install/lib/pkgconfig/sndfile.pc +popd + + +# id3lib +tar xvfz ${D}/sources/id3lib-3.8.3.tar.gz +pushd id3lib-3.8.3 +./configure +make +install -D -m 755 src/.libs/libid3-3.8.so.3.0.0 ${D}/tmp/install/lib/libid3-3.8.so.3.0.0 +ln -sf libid3-3.8.so.3.0.0 ${D}/tmp/install/lib/libid3-3.8.so.3 +ln -sf libid3-3.8.so.3.0.0 ${D}/tmp/install/lib/libid3-3.8.so +install -D -m 644 include/id3.h ${D}/tmp/install/include/id3.h +for f in include/id3/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/id3/$(basename ${f}) +done +popd + +# twolame +tar xvfz ${D}/sources/twolame-0.3.12.tar.gz +pushd twolame-0.3.12 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig \ + LDFLAGS="-Wl,--rpath-link,${D}/tmp/install/lib" \ + ./configure +make +install -D -m 755 libtwolame/.libs/libtwolame.so.0.0.0 ${D}/tmp/install/lib/libtwolame.so.0.0.0 +ln -sf libtwolame.so.0.0.0 ${D}/tmp/install/lib/libtwolame.so.0 +ln -sf libtwolame.so.0.0.0 ${D}/tmp/install/lib/libtwolame.so +install -D -m 644 libtwolame/twolame.h ${D}/tmp/install/include/twolame.h +install -D -m 755 frontend/.libs/twolame ${D}/tmp/install/bin/twolame +install -D -m 755 simplefrontend/.libs/stwolame ${D}/tmp/install/bin/stwolame +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" twolame.pc > ${D}/tmp/install/lib/pkgconfig/twolame.pc +popd + +# faad2 +tar xvfz ${D}/sources/faad2-2.6.1.tar.gz +pushd faad2 +patch -p 1 < ${D}/sources/faad2-cve-2008-4201.patch +autoreconf -vif +./configure +make +install -D -m 755 libfaad/.libs/libfaad.so.0.0.0 ${D}/tmp/install/lib/libfaad.so.0.0.0 +ln -sf libfaad.so.0.0.0 ${D}/tmp/install/lib/libfaad.so.0 +ln -sf libfaad.so.0.0.0 ${D}/tmp/install/lib/libfaad.so +for f in include/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/$(basename ${f}) +done +install -D -m 755 frontend/.libs/faad ${D}/tmp/install/bin/faad +popd + +# xvidcore +tar xvfj ${D}/sources/xvidcore-1.2.1.tar.bz2 +pushd xvidcore +patch -p 1 < ${D}/sources/xvidcore-1.2.1-noexec-stack.patch +pushd build/generic +CFLAGS="$CFLAGS -ffast-math" ./configure +make +popd +install -D -m 755 build/generic/=build/libxvidcore.so.4.2 ${D}/tmp/install/lib/libxvidcore.so.4.2 +ln -sf libxvidcore.so.4.2 ${D}/tmp/install/lib/libxvidcore.so.4 +ln -sf libxvidcore.so.4.2 ${D}/tmp/install/lib/libxvidcore.so +install -D -m 644 src/xvid.h ${D}/tmp/install/include/xvid.h +popd + +# a52dec +tar xvfz ${D}/sources/a52dec-0.7.4.tar.gz +pushd a52dec-0.7.4 +./configure \ + --enable-shared \ + --disable-static +make +install -D -m 755 liba52/.libs/liba52.so.0.0.0 ${D}/tmp/install/lib/liba52.so.0.0.0 +ln -sf liba52.so.0.0.0 ${D}/tmp/install/lib/liba52.so.0 +ln -sf liba52.so.0.0.0 ${D}/tmp/install/lib/liba52.so +for f in a52.h attributes.h audio_out.h mm_accel.h; do + install -D -m 644 include/${f} ${D}/tmp/install/include/a52dec/${f} +done +install -D -m 755 src/.libs/a52dec ${D}/tmp/install/bin/a52dec +popd + +# libmpeg2 +tar xvfz ${D}/sources/libmpeg2-0.5.1.tar.gz +pushd libmpeg2-0.5.1 +./configure \ + --without-x \ + --disable-sdl +make +install -D -m 755 libmpeg2/.libs/libmpeg2.so.0.1.0 ${D}/tmp/install/lib/libmpeg2.so.0.1.0 +ln -sf libmpeg2.so.0.1.0 ${D}/tmp/install/lib/libmpeg2.so.0 +ln -sf libmpeg2.so.0.1.0 ${D}/tmp/install/lib/libmpeg2.so +install -D -m 755 ./libmpeg2/convert/.libs/libmpeg2convert.so.0.0.0 ${D}/tmp/install/lib/libmpeg2convert.so.0.0.0 +ln -sf libmpeg2convert.so.0.0.0 ${D}/tmp/install/lib/libmpeg2convert.so.0 +ln -sf libmpeg2convert.so.0.0.0 ${D}/tmp/install/lib/libmpeg2convert.so +install -D -m 644 libmpeg2/libmpeg2.pc ${D}/tmp/install/lib/pkgconfig/libmpeg2.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" libmpeg2/libmpeg2.pc > ${D}/tmp/install/lib/pkgconfig/libmpeg2.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" libmpeg2/convert/libmpeg2convert.pc > ${D}/tmp/install/lib/pkgconfig/libmpeg2convert.pc +for f in include/mpeg2.h libmpeg2/mpeg2_internal.h include/mpeg2convert.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/mpeg2dec/$(basename ${f}) +done +install -D -m 755 src/.libs/mpeg2dec ${D}/tmp/install/bin/mpegdec +popd + +# ffmpeg +tar xvfj ${D}/sources/ffmpeg-20080908.tar.bz2 +pushd ffmpeg-20080908 +CFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib" LDFLAGS="-L${D}/tmp/install/lib" ./configure \ + --incdir=${D}/tmp/install/include/ffmpeg \ + --libdir=${D}/tmp/install/lib \ + --disable-demuxer=v4l \ + --enable-libfaad \ + --enable-libmp3lame \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libxvid \ + --enable-avfilter \ + --enable-swscale \ + --enable-postproc \ + --enable-avfilter-lavf \ + --enable-shared \ + --enable-gpl \ + --enable-liba52 +make +install -D -m 755 libavformat/libavformat.so.52 ${D}/tmp/install/lib/libavformat.so.52 +ln -sf libavformat.so.52 ${D}/tmp/install/lib/libavformat.so +install -D -m 755 libpostproc/libpostproc.so.51 ${D}/tmp/install/lib/libpostproc.so.51 +ln -sf libpostproc.so.51 ${D}/tmp/install/lib/libpostproc.so +install -D -m 755 libavcodec/libavcodec.so.51 ${D}/tmp/install/lib/libavcodec.so.51 +ln -sf libavcodec.so.51 ${D}/tmp/install/lib/libavcodec.so +install -D -m 755 libavfilter/libavfilter.so.0 ${D}/tmp/install/lib/libavfilter.so.0 +ln -sf libavfilter.so.0 ${D}/tmp/install/lib/libavfilter.so +install -D -m 755 libavdevice/libavdevice.so.52 ${D}/tmp/install/lib/libavdevice.so.52 +ln -sf libavdevice.so.52 ${D}/tmp/install/lib/libavdevice.so +install -D -m 755 libavutil/libavutil.so.49 ${D}/tmp/install/lib/libavutil.so.49 +ln -sf libavutil.so.49 ${D}/tmp/install/lib/libavutil.so +install -D -m 755 libswscale/libswscale.so.0 ${D}/tmp/install/lib/libswscale.so.0 +ln -sf libswscale.so.0 ${D}/tmp/install/lib/libswscale.so +install -D -m 755 ffmpeg ${D}/tmp/install/bin/ffmpeg +install -D -m 755 ffmpeg_g ${D}/tmp/install/bin/ffmpeg_g +install -D -m 755 ffserver ${D}/tmp/install/bin/ffserver +install -D -m 755 ffserver_g ${D}/tmp/install/bin/ffserver_g +for f in libavcodec/libavcodec.pc libavdevice/libavdevice.pc libavfilter/libavfilter.pc libavformat/libavformat.pc libavutil/libavutil.pc \ + libpostproc/libpostproc.pc libswscale/libswscale.pc; do + sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" $f > ${D}/tmp/install/lib/pkgconfig/$(basename $f) +done +for f in libavcodec/avcodec.h libavcodec/opt.h libavdevice/avdevice.h libavfilter/avfilter.h libavformat/avformat.h libavformat/avio.h \ + libavutil/adler32.h libavutil/avstring.h libavutil/avutil.h libavutil/base64.h libavutil/common.h libavutil/crc.h \ + libavutil/fifo.h libavutil/intfloat_readwrite.h libavutil/log.h libavutil/lzo.h libavutil/mathematics.h libavutil/md5.h \ + libavutil/mem.h libavutil/rational.h libavutil/sha1.h libpostproc/postprocess.h libswscale/swscale.h; do + install -D -m 644 $f ${D}/tmp/install/include/ffmpeg/$f + ln -sf $f ${D}/tmp/install/include/ffmpeg/$(basename $f) +done +for f in libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswscale; do + ln -sf ffmpeg/$f ${D}/tmp/install/include/$f +done +popd + +# ffmpegthumbnailer +tar xvfz ${D}/sources/ffmpegthumbnailer-2.0.2.tar.gz +pushd ffmpegthumbnailer-2.0.2 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig \ + CFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CXXFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CPPFLAGS="-I${D}/tmp/install/include" \ + LDFLAGS="-L${D}/tmp/install/lib" \ + ./configure \ + --includedir=${D}/tmp/install/include/libffmpegthumbnailer \ + --libdir=${D}/tmp/install/lib +make +install -D -m 755 .libs/libffmpegthumbnailer.so.4.0.2 ${D}/tmp/install/lib/libffmpegthumbnailer.so.4.0.2 +ln -sf libffmpegthumbnailer.so.4.0.2 ${D}/tmp/install/lib/libffmpegthumbnailer.so.4 +ln -sf libffmpegthumbnailer.so.4.0.2 ${D}/tmp/install/lib/libffmpegthumbnailer.so +for f in libffmpegthumbnailer/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/libffmpegthumbnailer/$(basename ${f}) +done +install -D -m 644 libffmpegthumbnailer.pc ${D}/tmp/install/lib/pkgconfig/libffmpegthumbnailer.pc +popd + +# sqlite3 +tar xvfz ${D}/sources/sqlite-amalgamation-3.7.0.1.tar.gz +pushd sqlite-3.7.0.1 +./configure +make +install -D -m 755 .libs/libsqlite3.so.0.8.6 ${D}/tmp/install/lib/libsqlite3.so.0.8.6 +ln -sf libsqlite3.so.0.8.6 ${D}/tmp/install/lib/libsqlite3.so.0 +ln -sf libsqlite3.so.0.8.6 ${D}/tmp/install/lib/libsqlite3.so +install -D -m 644 sqlite3.h ${D}/tmp/install/include/sqlite3.h +install -D -m 755 .libs/sqlite3 ${D}/tmp/install/bin/sqlite3 +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" sqlite3.pc > ${D}/tmp/install/lib/pkgconfig/sqlite3.pc +popd + +# mediatomb +tar xvfz ${D}/sources/mediatomb-0.12.1.tar.gz +pushd mediatomb-0.12.1 +patch -p 0 < ${D}/sources/samsung_video_subtitles.patch +CFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CXXFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CPPFLAGS="-I${D}/tmp/install/include" \ + LDFLAGS="-L${D}/tmp/install/lib" \ + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${D}/tmp/install/lib ./configure \ + --prefix=${D_PREFIX} \ + --disable-mysql \ + --disable-id3lib \ + --with-js-libs=${D}/tmp/install/lib \ + --with-js-h=${D}/tmp/install/include/js \ + --with-libmagic-h=${D}/tmp/install/include \ + --with-libmagic-libs=${D}/tmp/install/lib \ + --with-taglib-cfg=${D}/tmp/install/bin/taglib-config \ + --with-libexif-h=${D}/tmp/install/include \ + --with-libexif-libs=${D}/tmp/install/lib \ + --with-libmp4v2-h=${D}/tmp/install/include/libmp4v2 \ + --with-libmp4v2-libs=${D}/tmp/install/lib \ + --enable-ffmpeg \ + --with-avformat-h=${D}/tmp/install/include \ + --with-avformat-libs=${D}/tmp/install/lib \ + --with-avutil-libs=${D}/tmp/install/lib \ + --with-ffmpegthumbnailer-libs=${D}/tmp/install/lib \ + --with-ffmpegthumbnailer-h=${D}/tmp/install/include \ + --with-sqlite3-libs=${D}/tmp/install/lib \ + --with-sqlite3-h=${D}/tmp/install/include + +CFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CXXFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CPPFLAGS="-I${D}/tmp/install/include" + LDFLAGS="-L${D}/tmp/install/lib" \ + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${D}/tmp/install/lib \ + make +install -D -m 755 build/mediatomb ${D}/tmp/install/bin/mediatomb +mkdir -p ${D}/tmp/install/share/mediatomb +cp -a web ${D}/tmp/install/share/mediatomb/web +cp -a scripts/js ${D}/tmp/install/share/mediatomb/js +cp -a config/mappings.xml ${D}/tmp/install/share/mediatomb +find ${D}/tmp/install/share/mediatomb -name Makefile | xargs rm -f +popd + +# VLC +tar xvfj ${D}/sources/vlc-1.1.2.tar.bz2 +pushd vlc-1.1.2 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig \ + CFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CXXFLAGS="${CFLAGS} -I${D}/tmp/install/include -L${D}/tmp/install/lib -Wl,--rpath-link,${D}/tmp/install/lib" \ + CPPFLAGS="-I${D}/tmp/install/include" \ + LDFLAGS="-L${D}/tmp/install/lib " \ + LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${D}/tmp/install/lib \ + ./configure \ + --prefix=${D_PREFIX} \ + --enable-run-as-root \ + --without-x \ + --disable-bonjour \ + --disable-dbus \ + --disable-lua \ + --disable-mad \ + --disable-rpath \ + --disable-xcb \ + --disable-fribidi \ + --disable-qt4 \ + --disable-skins2 \ + --disable-libgcrypt \ + --disable-remoteosd \ + --disable-v4l2 \ + --disable-libv4l \ + --disable-libv4l2 \ + --disable-sdl \ + --enable-libmpeg2 \ + --enable-a52 \ + +make +install -D -m 755 src/.libs/libvlccore.so.4.0.0 ${D}/tmp/install/lib/libvlccore.so.4.0.0 +ln -sf libvlccore.so.4.0.0 ${D}/tmp/install/lib/libvlccore.so.4.0 +ln -sf libvlccore.so.4.0.0 ${D}/tmp/install/lib/libvlccore.so +install -D -m 755 src/.libs/libvlc.so.5.1.0 ${D}/tmp/install/lib/libvlc.so.5.1.0 +ln -sf libvlc.so.5.1.0 ${D}/tmp/install/lib/libvlc.so.5 +ln -sf libvlc.so.5.1.0 ${D}/tmp/install/lib/libvlc.so +install -D -m 755 bin/.libs/vlc ${D}/tmp/install/bin/vlc +install -D -m 755 ./bin/.libs/vlc-cache-gen ${D}/tmp/install/lib/vlc/vlc-cache-gen +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" src/libvlc.pc > ${D}/tmp/install/lib/pkgconfig/libvlc.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" src/vlc-plugin.pc > ${D}/tmp/install/lib/pkgconfig/vlc-plugin.pc +for f in $(find modules -name '*.so'); do + install -D -m 755 ${f} ${D}/tmp/install/lib/vlc/$(echo ${f} | sed -e 's/^modules/plugins/; s/\.libs\///') +done +for f in include/vlc/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/vlc/$(basename ${f}) +done +for f in include/*.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/vlc/plugins/$(basename ${f}) +done +popd + +# libxml +tar xvfz ${D}/sources/libxml-1.8.17.tar.gz +pushd libxml-1.8.17 +./configure +make +install -D -m 755 .libs/libxml.so.1.8.17 ${D}/tmp/install/lib/libxml.so.1.8.17 +ln -sf libxml.so.1.8.17 ${D}/tmp/install/lib/libxml.so.1 +ln -sf libxml.so.1.8.17 ${D}/tmp/install/lib/libxml.so +for f in SAX.h entities.h encoding.h parser.h parserInternals.h xml-error.h HTMLparser.h \ + HTMLtree.h debugXML.h tree.h xpath.h xmlIO.h xmlmemory.h nanohttp.h nanoftp.h \ + valid.h xlink.h uri.h; do + install -D -m 644 ${f} ${D}/tmp/install/include/gnome-xml/$(basename ${f}) +done +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" libxml.pc > ${D}/tmp/install/lib/pkgconfig/libxml.pc +sed -e "s#prefix=/usr/local#prefix=${D}/tmp/install#" xml-config > ${D}/tmp/install/bin/xml-config +chmod +x ${D}/tmp/install/bin/xml-config +popd + +# xml2 +tar xvfz ${D}/sources/xml2-0.4.tar.gz +pushd xml2-0.4 +PKG_CONFIG_PATH=${D}/tmp/install/lib/pkgconfig \ + LDFLAGS="-L${D}/tmp/install/lib " \ + ./configure +make +for f in 2csv 2xml csv2 xml2; do + install -D -m 755 $f ${D}/tmp/install/bin/${f} +done +popd + +# system libs +install -D -m 755 /usr/lib/libstdc++.so.6.0.3 ${D}/tmp/install/lib/libstdc++.so.6.0.3 +install -D -m 755 /lib/libgcc_s.so.1 ${D}/tmp/install/lib/libgcc_s.so.1 +ln -sf libstdc++.so.6.0.3 ${D}/tmp/install/lib/libstdc++.so.6 +popd + Index: /mediatomb/release.sh =================================================================== --- /mediatomb/release.sh (revision 4) +++ /mediatomb/release.sh (revision 4) @@ -0,0 +1,33 @@ +#!/bin/bash + +set -ex + +D=${PWD} + +rm -rf tmp/MEDIATOMB +mkdir tmp/MEDIATOMB + +cp -a ${D}/module/* ${D}/tmp/MEDIATOMB/ +cp -a ${D}/tmp/install/* ${D}/tmp/MEDIATOMB/system/ +mkdir -p ${D}/tmp/MEDIATOMB/system/var/mediatomb/ + +# clean out development remains not needed in the release +#find ${D}/tmp/MEDIATOMB/system -name '*.so' | xargs rm -f +rm -rf ${D}/tmp/MEDIATOMB/system/lib/pkgconfig/ +rm -rf ${D}/tmp/MEDIATOMB/system/include +rm -rf ${D}/tmp/MEDIATOMB/system/bin/*-config +rm -rf ${D}/tmp/MEDIATOMB/system/share/aclocal/ + + +# Binary file +pushd ${D}/tmp/ +VERSION=$(LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${D}/tmp/MEDIATOMB/system/lib" ${D}/tmp/MEDIATOMB/system/bin/xml2 \ + < ${D}/module/Configure/install.rdf | grep /rdf:RDF/md:Install/md:Version | cut -d "=" -f 2) +tar cfvz ${D}/N5200_MEDIATOMB-${VERSION}.mod --owner 0 --group 0 MEDIATOMB/ +popd + +# Source file +mkdir N5200_MEDIATOMB-${VERSION}-src +cp -a build.sh release.sh module sources N5200_MEDIATOMB-${VERSION}-src +tar cfvz ${D}/N5200_MEDIATOMB-${VERSION}-src.tar.gz --owner 0 --group 0 N5200_MEDIATOMB-${VERSION}-src +rm -rf N5200_MEDIATOMB-${VERSION}-src