[108562] trunk/dports/multimedia

pixilla at macports.org pixilla at macports.org
Fri Jul 26 09:37:12 PDT 2013


Revision: 108562
          https://trac.macports.org/changeset/108562
Author:   pixilla at macports.org
Date:     2013-07-26 09:37:12 -0700 (Fri, 26 Jul 2013)
Log Message:
-----------
multimedia/mythtv-core.26:
- New port mythtv-core.26.

Added Paths:
-----------
    trunk/dports/multimedia/mythtv-core.26/
    trunk/dports/multimedia/mythtv-core.26/Portfile
    trunk/dports/multimedia/mythtv-core.26/files/
    trunk/dports/multimedia/mythtv-core.26/files/Myth_Filldatabase.applescript
    trunk/dports/multimedia/mythtv-core.26/files/Myth_Frontend.applescript
    trunk/dports/multimedia/mythtv-core.26/files/Myth_Setup.applescript
    trunk/dports/multimedia/mythtv-core.26/files/Myth_Stop_Start.applescript
    trunk/dports/multimedia/mythtv-core.26/files/logrotate.conf
    trunk/dports/multimedia/mythtv-core.26/files/logrotate.mythtv
    trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythbackend.plist
    trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythlogserver.plist
    trunk/dports/multimedia/mythtv-core.26/files/patch-bonjour-correction.diff
    trunk/dports/multimedia/mythtv-core.26/files/patch-configure-configincludepath.diff
    trunk/dports/multimedia/mythtv-core.26/files/patch-mythtv_settings.pro.diff
    trunk/dports/multimedia/mythtv-core.26/files/patch-protect-metadata-loads-from-multiple-threads.diff
    trunk/dports/multimedia/mythtv-core.26/files/patch-restore-fe-netcontrol-play-resume-functionality.diff

Added: trunk/dports/multimedia/mythtv-core.26/Portfile
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/Portfile	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/Portfile	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,392 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+PortGroup           github 1.0
+PortGroup           qt4 1.0
+
+set shorthash       99eb39adb
+# set fullhash      99eb39adb5ff15ea6b3d1c968c64883646f8bf0f
+set majorversion    .26
+set minorversion    ""
+github.setup        MythTV mythtv ${shorthash}
+name                mythtv-core${majorversion}
+version             0${majorversion}${minorversion}-Fixes-20130720
+revision            0
+categories          multimedia
+platforms           darwin
+license             GPL-2
+maintainers         cogeco.ca:ctreleaven openmaintainer
+
+description         MythTV - Open source digital video recorder
+long_description    The ultimate Digital Video Recorder and home media \
+                    center hub. Think of it as a Free and Open Source alternative \
+                    to Windows Media Center or Tivo.
+
+homepage            http://www.mythtv.org/
+checksums           rmd160  a1eb2ac1754535dc94eb327e96630bdb6e3808f3 \
+                    sha256  c044011002d635f878806ecf36b4d7acf242d3624423e14baa7d8ff348f2b0f4
+
+set nick            mythtv
+set mythtvhomedir   ${prefix}/var/mythtvuser
+set mythtvlogdir    ${prefix}/var/log/${nick}${majorversion}
+set mythtvrundir    ${prefix}/var/run/${nick}${majorversion}
+set mythtvpidfile   ${mythtvrundir}/${nick}
+set plistdir        ${prefix}/Library/LaunchDaemons
+set plistfiles      {org.mythtv.mythbackend.plist org.mythtv.mythlogserver.plist}
+set mythverstring   v0${majorversion}${minorversion}-${shorthash}-MacPorts
+set mythbranch      fixes/0${majorversion}
+set applescripts    {Myth_Frontend Myth_Filldatabase Myth_Setup Myth_Stop_Start}
+set mysqlver        mysql5
+set perlver         perl5.12
+set perlbin         ${prefix}/bin/${perlver}
+set perlmodver      p5.12
+set pythonver       python2.6
+set pythonbin       ${prefix}/bin/${pythonver}
+set pymodver        py26
+
+depends_lib         port:libdvdcss \
+                    port:freetype \
+                    port:lame \
+                    port:x264 \
+                    port:qt4-mac-${mysqlver}-plugin \
+                    port:libpng \
+                    port:${pymodver}-mysql \
+                    port:${pymodver}-lxml \
+                    port:${pymodver}-urlgrabber \
+                    port:${perlmodver}-dbd-mysql \
+                    port:${perlmodver}-http-request-ascgi \
+                    port:${perlmodver}-lwp-useragent-determined \
+                    port:${perlmodver}-io-socket-inet6 \
+                    port:${perlmodver}-datemanip \
+                    port:${perlmodver}-net-upnp
+
+depends_build       port:yasm  port:pkgconfig
+
+conflicts           mythtv-core.25
+
+depends_run         port:logrotate
+
+# see http://code.mythtv.org/trac/ticket/10890
+patchfiles          patch-configure-configincludepath.diff \
+                    patch-mythtv_settings.pro.diff
+
+# following three patches currently required to support MythExpress
+# See tickets:
+#    http://code.mythtv.org/trac/ticket/10773
+#    http://code.mythtv.org/trac/ticket/10825
+#    http://code.mythtv.org/trac/ticket/11032
+patchfiles-append   patch-bonjour-correction.diff \
+                    patch-protect-metadata-loads-from-multiple-threads.diff \
+                    patch-restore-fe-netcontrol-play-resume-functionality.diff
+
+post-extract {
+    file mkdir ${worksrcpath}/macports
+    foreach {applescript} ${applescripts} {
+        copy ${filespath}/${applescript}.applescript ${worksrcpath}/macports/${applescript}.applescript
+    }
+    foreach {plist} ${plistfiles} {
+        copy ${filespath}/${plist} ${worksrcpath}/macports/${plist}
+    }
+    copy ${filespath}/logrotate.conf ${worksrcpath}/macports/logrotate.conf
+    copy ${filespath}/logrotate.mythtv ${worksrcpath}/macports/logrotate.mythtv
+}
+
+post-patch {
+    set sedPath ${worksrcpath}/mythtv/
+    ui_info "Make Myth utils use MacPorts Perl"
+    reinplace -locale C "s|check_cmd perl -e|check_cmd ${perlbin} -e|" \
+        ${sedPath}configure
+
+    reinplace -locale C "s|#!/usr/bin/env perl|#!${perlbin}|" \
+        ${sedPath}programs/scripts/internetcontent/topdocumentaryfilm.pl  \
+        ${sedPath}programs/scripts/internetcontent/twit.tv.pl
+
+    reinplace -locale C "s|#!/usr/bin/perl|#!${perlbin}|" \
+        ${sedPath}bindings/perl/Makefile.PL  \
+        ${sedPath}bindings/perl/MythTV.pm  \
+        ${sedPath}contrib/maintenance/optimize_mythdb.pl  \
+        ${sedPath}contrib/user_jobs/mythlink.pl  \
+        ${sedPath}programs/scripts/database/mythconverg_backup.pl \
+        ${sedPath}programs/scripts/database/mythconverg_restore.pl
+
+    reinplace -locale C "s|/usr/local/bin|${prefix}/lib/${mysqlver}/bin|"  \
+        ${sedPath}programs/scripts/database/mythconverg_backup.pl \
+        ${sedPath}programs/scripts/database/mythconverg_restore.pl
+
+    ui_info "Record Myth version strings"
+    reinplace -locale C "s#\${SOURCE_VERSION}#${mythverstring}#g" ${sedPath}version.sh
+    reinplace -locale C "s#\${BRANCH}#${mythbranch}#g" ${sedPath}version.sh
+
+    ui_info "Make Myth scripts use MacPorts Python  <<<<"
+    # Hack to install Python bindings in ${prefix}/Library/Frameworks/Python.framework/Versions/2.6
+    reinplace -locale C "s|\$(ROOT_FLAGS) \$(PREFIX_FLAGS)|\$(ROOT_FLAGS) \--prefix=\"${frameworks_dir}/Python.framework/Versions/2.6\"|" \
+        ${sedPath}/bindings/python/Makefile
+    reinplace -locale C "s|/usr/local|${prefix}|" ${worksrcpath}/mythtv/bindings/python/MythTV/static.py
+    reinplace -locale C "s|#!python|#!${pythonbin}|" \
+        ${worksrcpath}/mythtv/bindings/python/scripts/mythpython \
+        ${worksrcpath}/mythtv/bindings/python/scripts/mythwikiscripts
+    fs-traverse f ${sedPath}/bindings/python/ {
+        if [string equal [ file extension ${f} ] ".py" ] {
+            reinplace -locale C "s|^#! */usr/bin/env python\$|#!${pythonbin}|" ${f}
+        }
+    }
+    fs-traverse f ${sedPath}/programs/scripts/ {
+        if [string equal [ file extension ${f} ] ".py" ] {
+            reinplace -locale C "s|^#! */usr/bin/env python\$|#!${pythonbin}|" ${f}
+        }
+    }
+    foreach f [glob -directory ${sedPath}/programs/scripts/hardwareprofile *.py] {
+    # fix even though they're currently non-functional on OS X
+        reinplace -locale C "s|^#!/usr/bin/python\$|#!${pythonbin}|" ${f}
+    }
+
+    foreach {applescript} ${applescripts} {
+        reinplace -locale C "s|@PREFIX@|${prefix}|g" ${worksrcpath}/macports/${applescript}.applescript
+        reinplace -locale C "s|@APPLICATIONS_DIR@|${applications_dir}|" ${worksrcpath}/macports/${applescript}.applescript
+        reinplace -locale C "s|@MYTHTVLOGDIR@|${mythtvlogdir}|" ${worksrcpath}/macports/${applescript}.applescript
+        reinplace -locale C "s|@MYTHTVPIDFILE@|${mythtvpidfile}|" ${worksrcpath}/macports/${applescript}.applescript
+    }
+    foreach {plist} ${plistfiles} {
+        reinplace -locale C "s|@PREFIX@|${prefix}|g" ${worksrcpath}/macports/${plist}
+        reinplace -locale C "s|@MYTHTVLOGDIR@|${mythtvlogdir}|" ${worksrcpath}/macports/${plist}
+        reinplace -locale C "s|@PYTHONVER@|${pythonver}|" ${worksrcpath}/macports/${plist}
+        reinplace -locale C "s|@MYTHTVPIDFILE@|${mythtvpidfile}|" ${worksrcpath}/macports/${plist}
+    }
+    reinplace -locale C "s|@PREFIX@|${prefix}|g" ${worksrcpath}/macports/logrotate.conf
+    reinplace -locale C "s|@MYTHTVLOGDIR@|${mythtvlogdir}|g" ${worksrcpath}/macports/logrotate.mythtv
+    reinplace -locale C "s|xxxyyyzzz|${mythtvpidfile}|" ${worksrcpath}/mythtv/configure
+}
+
+################################################################################
+# We do not want flags except LD...MythTV is smart enough to set up its own.   #
+################################################################################
+
+configure.cflags
+configure.cppflags
+configure.cxxflags
+configure.objcflags
+configure.ldflags    '-L${prefix}/lib'
+
+configure.universal_cflags
+configure.universal_cppflags
+configure.universal_cxxflags
+configure.universal_ldflags
+
+configure.cc_archflags
+configure.cxx_archflags
+configure.ld_archflags
+
+configure.dir       ${worksrcpath}/mythtv
+configure.args      --compile-type=release \
+                    --runprefix=${prefix} \
+                    --cc=${configure.cc} \
+                    --cxx=${configure.cxx} \
+                    --qmake=${qt_qmake_cmd} \
+                    --python=${pythonbin} \
+                    --disable-firewire \
+                    --disable-audio-jack --disable-indev=jack \
+                    --enable-libmp3lame --enable-libx264
+
+if {${configure.ccache} != "yes"} {
+    configure.args-append --disable-ccache
+}
+
+if {${configure.distcc} != "yes"} {
+    configure.args-append --disable-distcc
+}
+
+build.dir           ${worksrcpath}/mythtv
+
+pre-build {
+    ui_info "Build Myth AppleScript helper apps"
+    # Compile applescrips
+    foreach {applescript} ${applescripts} {
+        system "osacompile -x -o ${worksrcpath}/macports/${applescript}.app ${worksrcpath}/macports/${applescript}.applescript"
+    }
+    # Myth custom icon for a couple of the applets
+    copy -force ${configure.dir}/programs/mythfrontend/mythfrontend.icns ${worksrcpath}/macports/Myth_Frontend.app/Contents/Resources/applet.icns
+    copy -force ${configure.dir}/programs/mythfrontend/mythfrontend.icns ${worksrcpath}/macports/Myth_Stop_Start.app/Contents/Resources/applet.icns
+}
+
+destroot.destdir    INSTALL_ROOT=${destroot}
+
+post-destroot {
+# make some directories myth will need
+    xinstall -d -m 666 ${destroot}${mythtvhomedir}
+    xinstall -d -m 666 ${destroot}${mythtvlogdir}
+    xinstall -d -m 666 ${destroot}${mythtvlogdir}/old
+    xinstall -d -m 666 ${destroot}${prefix}/etc/logrotate.d
+    xinstall -d -m 644 ${destroot}${mythtvrundir}
+
+    destroot.keepdirs \
+        ${destroot}${mythtvhomedir} \
+        ${destroot}${mythtvlogdir} \
+        ${destroot}${mythtvlogdir}/old \
+        ${destroot}${mythtvrundir}
+
+# install logrotate.mythtv
+    xinstall -m 400 ${worksrcpath}/macports/logrotate.mythtv ${destroot}${prefix}/etc/logrotate.d/
+
+# install the launchd plist for the backend
+    ui_info "Installing startupitem/launchd plist..."
+    xinstall -d -m 0755 ${destroot}${plistdir}
+    foreach {plist} ${plistfiles} {
+        xinstall ${worksrcpath}/macports/${plist} ${destroot}${plistdir}
+    }
+
+# install scripts we want in share/contrib
+    ui_info "Installing share/$name/contrib scripts..."
+
+    xinstall -d -m 755 ${destroot}${prefix}/share/${nick}/database
+    xinstall -d -m 755 ${destroot}${prefix}/share/${nick}/contrib
+
+    xinstall -m 755 \
+        ${configure.dir}/database/mc.sql \
+        ${destroot}${prefix}/share/${nick}/database/
+    xinstall -m 755 \
+        ${configure.dir}/contrib/maintenance/optimize_mythdb.pl \
+        ${configure.dir}/contrib/user_jobs/mythlink.pl \
+        ${destroot}${prefix}/share/${nick}/contrib/
+
+# install some simple Applescripts to launch common myth apps
+    ui_info "Installing Applescript helpers..."
+    # compile the Applescripts
+    xinstall -m 755 -d ${destroot}${applications_dir}/MythTV
+
+    foreach {applescript} ${applescripts} {
+        copy ${worksrcpath}/macports/${applescript}.app ${destroot}${applications_dir}/MythTV/${applescript}.app
+    }
+
+# Myth custom icon for a couple of the applets
+    copy -force ${configure.dir}/programs/mythfrontend/mythfrontend.icns ${destroot}${applications_dir}/MythTV/Myth_Frontend.app/Contents/Resources/applet.icns
+    copy -force ${configure.dir}/programs/mythfrontend/mythfrontend.icns ${destroot}${applications_dir}/MythTV/Myth_Stop_Start.app/Contents/Resources/applet.icns
+
+# Fix up library entries in dylibs and executables ...
+# need to loop on arch's if/when build universal ?!?
+    set libdir ${prefix}/lib
+
+    ui_info "Correcting library entries in dylibs..."
+
+    foreach {dylib} [glob -types f -tails -directory ${destroot}${libdir} *.dylib] {
+        # glob gives us both files and links to files
+        if { [file type ${destroot}${libdir}/${dylib}] == "file" } {
+            ui_debug "... for ${dylib}"
+            system "install_name_tool -id ${libdir}/${dylib} ${destroot}${libdir}/${dylib}"
+
+            set otool [lrange [split [exec otool -L ${destroot}${libdir}/${dylib}] \n] 1 end]
+
+            foreach {otoolentry} ${otool} {
+                # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib"
+                # assume anything without a leading slash needs fixing
+                set firstchar [string range [string trimleft ${otoolentry}] 0 0]
+                if  { ${firstchar} != "/" }  {
+                    set lib [lindex ${otoolentry} 0]
+                    ui_debug "      Change ${lib}  to  ${libdir}/[file tail ${lib}]"
+                    system "install_name_tool -change \
+                        ${lib} \
+                        ${libdir}/[file tail ${lib}] \
+                        ${destroot}${libdir}/${dylib}"
+                }
+            }
+        }
+    }
+    set bindir ${prefix}/bin
+    ui_info "Correcting library entries in executables..."
+
+    foreach {prog} [glob -types f -tails -directory ${destroot}${bindir} *] {
+        # glob gives us files and links to files but should be no links in bin dir
+        ui_debug "... for ${prog}"
+
+        set otool [lrange [split [exec otool -L ${destroot}${bindir}/${prog}] \n] 1 end]
+
+        foreach {otoolentry} ${otool} {
+            # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib"
+            # assume anything without a leading slash needs fixing
+            set firstchar [string range [string trimleft ${otoolentry}] 0 0]
+            if  { ${firstchar} != "/" }  {
+                set lib [lindex ${otoolentry} 0]
+                ui_debug "      Change ${lib} to ${libdir}/[file tail ${lib}]"
+                system "install_name_tool -change \
+                    ${lib} \
+                    ${libdir}/[file tail ${lib}] \
+                    ${destroot}${bindir}/${prog}"
+            }
+        }
+    }
+
+# fix lib entries in filters
+    set fltdir ${prefix}/lib/mythtv/filters
+    set liblist [glob -types f -tails -directory ${destroot}${libdir} -- *.dylib]
+    ui_info "Correcting library entries in plugins..."
+
+    foreach {flt} [glob -types f -tails -directory ${destroot}${fltdir} *] {
+        # glob gives us files and links to files but should be no links in filters dir
+        ui_debug "... for ${flt}"
+
+        set otool [lrange [split [exec otool -L ${destroot}${fltdir}/${flt}] \n] 1 end]
+
+        foreach {otoolentry} ${otool} {
+            # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib"
+            # assume anything without a leading slash needs fixing
+            set firstchar [string range [string trimleft ${otoolentry}] 0 0]
+            if  { ${firstchar} != "/" }  {
+                set lib [lindex ${otoolentry} 0]
+                if { [ lsearch $liblist ${lib} ] > 0 } {
+                    set goodprefix ${libdir}
+                } else {
+                    set goodprefix ${fltdir}
+                }
+                ui_debug "      Change ${lib} to ${goodprefix}/[file tail ${lib}]"
+                system "install_name_tool -change \
+                    ${lib} \
+                    ${goodprefix}/[file tail ${lib}] \
+                    ${destroot}${fltdir}/${flt}"
+            }
+        }
+    }
+}
+
+universal_variant           no
+
+post-activate {
+    # make logrotate ready to go
+    if {![file exists ${prefix}/etc/logrotate.conf]} {
+        file copy ${destroot}logrotate.conf ${prefix}/etc/logrotate.conf
+    }
+    # delete leftover files, if any
+    foreach {plist} ${plistfiles} {
+        if [file exists /Library/LaunchDaemons/${plist}] {
+            file delete -force /Library/LaunchDaemons/${plist}
+        }
+    }
+    # The startupitem.install keyword does not exist in MacPorts < 2.1.
+    if {![info exists startupitem.install]} {
+        set startupitem.install yes
+    }
+    # If "startupitem.install" is set to "no" in macports.conf then do not link.
+    if {${startupitem.install} != "no"} {
+        foreach {plist} ${plistfiles} {
+            ln -s ${plistdir}/${plist} /Library/LaunchDaemons
+        }
+    }
+}
+
+pre-deactivate {
+    foreach {plist} ${plistfiles} {
+        file delete -force ${plistdir}/${plist}
+    }
+}
+
+notes "############################################################################
+#
+# See http://www.mythtv.org/wiki/Myth_for_Mac_with_MacPorts for information
+# essential to finishing the installation of MythTV!
+#
+# NB -
+# For troubleshooting, all Myth-related logs are stored in
+# ${mythtvlogdir}
+#
+############################################################################"
+
+livecheck.version           ${version}


Property changes on: trunk/dports/multimedia/mythtv-core.26/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/multimedia/mythtv-core.26/files/Myth_Filldatabase.applescript
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/Myth_Filldatabase.applescript	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/Myth_Filldatabase.applescript	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,64 @@
+(*  Applescript to run 'Unix' version of mythfilldatabase
+For use with MacPorts install of Myth
+Author:  Craig Treleaven, ctreleaven at cogeco.ca
+Myth Version: 0.26
+Modified: 2012May17
+          2013Mar06 .26, start mythlogserver if not already running
+
+*)
+property MFDappPath : "@PREFIX@/bin/mythfilldatabase"
+property MFDlogArg : "--logpath @MYTHTVLOGDIR@"
+property MFDlogLevel : "warning" -- single string
+property MFDverboseLevel : {"general"} -- a list, can be multiple strings
+
+property MLSappPath : "@PREFIX@/bin/mythlogserver"
+property MLSlogArg : "--quiet --logpath @MYTHTVLOGDIR@"
+property MLSlogLevel : "info" -- single string
+property MLSverboseLevel : {"system", "general"} -- a list, can be multiple strings
+set MLSpid to false
+
+set welcome to "In a 'production' system, mythfilldatabase is run automatically by mythbackend at the times suggested by the listings source, usually daily.  
+
+This applescript program allows you to run mythfilldatabase 'manually'; perhaps when Myth is first set up or if there are problems with the automatic runs. 
+ 
+"
+
+try
+    set Clicked to display dialog welcome with title "Run mythfilldatabase" buttons {"Cancel", "Start Run"} default button "Start Run"
+on error
+    set Clicked to false
+end try
+
+if Clicked is not false then
+    if button returned of Clicked = "Start Run" then
+        if (do shell script "ps -Ac") does not contain "mythlogserver" then
+            set MLScmd to joinlist({MLSappPath, MLSlogArg, "--loglevel " & MLSlogLevel, \xC2
+                "--verbose " & joinlist(MLSverboseLevel, ","), ">& /dev/null & echo $!"}, " ")
+            --display dialog MLScmd
+            set MLSpid to do shell script MLScmd
+            delay 1
+        end if
+        
+        set CmdList to {MFDappPath, MFDlogArg, "--loglevel " & MFDlogLevel, "--verbose " & joinlist(MFDverboseLevel, ",")}
+        set Cmd to (joinlist(CmdList, " "))
+        --display alert Cmd
+        do shell script Cmd -- run it!
+
+        if MLSpid is not false then
+            --display dialog "Kill: " & MLSpid
+            do shell script "kill " & MLSpid
+        end if
+
+    end if
+end if
+
+-- -- -- -- -- -- -- -- 
+-- Handlers
+to joinlist(aList, delimiter)
+    set retVal to ""
+    set prevDelimiter to AppleScript's text item delimiters
+    set AppleScript's text item delimiters to delimiter
+    set retVal to aList as string
+    set AppleScript's text item delimiters to prevDelimiter
+    return retVal
+end joinlist

Added: trunk/dports/multimedia/mythtv-core.26/files/Myth_Frontend.applescript
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/Myth_Frontend.applescript	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/Myth_Frontend.applescript	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,46 @@
+(*  Applescript to run 'Unix' version of mythfronted
+For use with MacPorts install of Myth
+Author:  Craig Treleaven, ctreleaven at cogeco.ca
+Myth Version: 0.26
+Modified: 2012May15
+          2013Mar05 .26, start mythlogserver if not already running
+
+*)
+property MFEappPath : "@PREFIX@/bin/mythfrontend"
+property MFElogArg : "--logpath @MYTHTVLOGDIR@"
+property MFElogLevel : "info" -- single string
+property MFEverboseLevel : {"none", "general"} -- a list, can be multiple strings
+
+property MLSappPath : "@PREFIX@/bin/mythlogserver"
+property MLSlogArg : "--quiet --logpath @MYTHTVLOGDIR@"
+property MLSlogLevel : "info" -- single string
+property MLSverboseLevel : {"system", "general"} -- a list, can be multiple strings
+set MLSpid to false
+
+if (do shell script "ps -Ac") does not contain "mythlogserver" then
+    set MLScmd to joinlist({MLSappPath, MLSlogArg, "--loglevel " & MLSlogLevel, \xC2
+        "--verbose " & joinlist(MLSverboseLevel, ","), ">& /dev/null & echo $!"}, " ")
+    --display dialog MLScmd
+    set MLSpid to do shell script MLScmd
+end if
+
+set CmdList to {MFEappPath, MFElogArg, "--loglevel " & MFElogLevel, "--verbose " & joinlist(MFEverboseLevel, ",")}
+set Cmd to (joinlist(CmdList, " "))
+--display alert Cmd
+do shell script Cmd
+
+if MLSpid is not false then
+    --display dialog "Kill: " & MLSpid
+    do shell script "kill " & MLSpid
+end if
+
+-- -- -- -- -- -- -- -- 
+-- Handlers
+to joinlist(aList, delimiter)
+    set retVal to ""
+    set prevDelimiter to AppleScript's text item delimiters
+    set AppleScript's text item delimiters to delimiter
+    set retVal to aList as string
+    set AppleScript's text item delimiters to prevDelimiter
+    return retVal
+end joinlist

Added: trunk/dports/multimedia/mythtv-core.26/files/Myth_Setup.applescript
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/Myth_Setup.applescript	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/Myth_Setup.applescript	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,66 @@
+(*  Applescript to run 'Unix' version of mythtv-setup
+For use with MacPorts install of Myth
+Author:  Craig Treleaven, ctreleaven at cogeco.ca
+Myth Version: 0.26
+Modified: 2012May17
+          2012Sep08 Force working themepainter
+          2013Mar05 .26, start mythlogserver if not already running
+*)
+property MSUappPath : "@PREFIX@/bin/mythtv-setup"
+property MSUlogArg : "-O ThemePainter=qt --logpath @MYTHTVLOGDIR@"
+property MSUlogLevel : "info" -- single string
+property MSUverboseLevel : {"general"} -- a list, can be multiple strings
+
+property MLSappPath : "@PREFIX@/bin/mythlogserver"
+property MLSlogArg : "--quiet --logpath @MYTHTVLOGDIR@"
+property MLSlogLevel : "info" -- single string
+property MLSverboseLevel : {"system", "general"} -- a list, can be multiple strings
+set MLSpid to false
+
+set welcome to "Initial setup of Myth is done through the mythtv-setup program.  
+
+This includes defining where recordings and other media are stored, tuners and sources of listings data and scanning for available channels, etc.
+ 
+"
+--Should test if mythbackend is running and warn user...
+
+if (do shell script "ps -Ac") does not contain "mythlogserver" then
+    set MLScmd to joinlist({MLSappPath, MLSlogArg, "--loglevel " & MLSlogLevel, \xC2
+        "--verbose " & joinlist(MLSverboseLevel, ","), ">& /dev/null & echo $!"}, " ")
+    --display dialog MLScmd
+    set MLSpid to do shell script MLScmd
+end if
+
+try
+    set Clicked to display dialog welcome with title \xC2
+        "Run mythtv-setup" buttons {"Cancel", "Start"} default button "Start"
+on error
+    set Clicked to false
+end try
+
+set CmdList to {MSUappPath, MSUlogArg, "--loglevel " & MSUlogLevel, "--verbose " & joinlist(MSUverboseLevel, ",")}
+set Cmd to (joinlist(CmdList, " "))
+--display alert button returned of Clicked
+
+if Clicked is not false then
+    if button returned of Clicked = "Start" then
+        --display alert "mythtv-setup: " & Cmd
+        do shell script Cmd -- run it!
+    end if
+end if
+
+if MLSpid is not false then
+    --display dialog "Kill: " & MLSpid
+    do shell script "kill " & MLSpid
+end if
+
+-- -- -- -- -- -- -- -- 
+-- Handlers
+to joinlist(aList, delimiter)
+    set retVal to ""
+    set prevDelimiter to AppleScript's text item delimiters
+    set AppleScript's text item delimiters to delimiter
+    set retVal to aList as string
+    set AppleScript's text item delimiters to prevDelimiter
+    return retVal
+end joinlist

Added: trunk/dports/multimedia/mythtv-core.26/files/Myth_Stop_Start.applescript
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/Myth_Stop_Start.applescript	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/Myth_Stop_Start.applescript	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,92 @@
+(*  Applescript to stop/start Myth background apps
+For use with MacPorts install of Myth
+Author:  Craig Treleaven, ctreleaven at cogeco.ca
+Version: 0.26
+Modified: 2012Jul11 - new
+           2012Sep21 - log rotation
+           2013Mar06 - .26, log server
+
+NB - if mythbackend or mythlogserver is running, we only stop it if it was launched under launchd
+*)
+property MPprefix : "@PREFIX@"
+set mysqld to " not running on this machine.  Is it on another machine on your network?"
+set rotatorStatus to ""
+set logrotButton to ""
+set mythbackend to ""
+set mythbackendButton to "Donno"
+set newline to "
+"
+set indent to space & space & space & space
+set lineStart to newline & indent & "= "
+set myResult to ""
+
+repeat until myResult is false
+    set launchdList to (do shell script "sudo launchctl list" with administrator privileges)
+    if launchdList contains ".logrotate" then
+        set rotatorStatus to "runs daily"
+        set logrotButton to "Disable log rotation"
+    else
+        set rotatorStatus to "is not scheduled"
+        set logrotButton to "Schedule log rotation"
+    end if
+    
+    set processes to do shell script "ps -Ac"
+    if the processes contains "mysqld" then
+        set mysqld to "running."
+    end if
+    
+    if the processes contains "mythbackend" then
+        set mythbackend to "running."
+        set mythbackendButton to "Stop MythBackend"
+        try
+            do shell script "mythshutdown --check"
+        on error
+            set mythbackend to " running but busy with something.  Are you sure you want to shut down now?"
+        end try
+    else
+        set mythbackend to "not running."
+        set mythbackendButton to "Start MythBackend"
+    end if
+    
+    set myResult to choose from list {logrotButton, mythbackendButton} \xC2
+        with title "Stop/Start Myth-related programs" with prompt \xC2
+        newline & "MacPorts tool to start and stop Myth's background processes" & \xC2
+        newline & newline & "Currently... " & \xC2
+        lineStart & "MySQL is \xC9 " & mysqld & newline & \xC2
+        lineStart & "Log rotation \xC9 " & rotatorStatus & \xC2
+        lineStart & "MythBackend is \xC9 " & mythbackend & newline \xC2
+        OK button name "Modify Selected Process" cancel button name "Close"
+    
+    if myResult contains "Start MythBackend" then
+        do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.mythtv.mythlogserver.plist" with administrator privileges
+        do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
+        delay 3
+    else if myResult contains "Stop MythBackend" then
+        if (launchdList contains ".mythbackend") then
+            do shell script "sudo launchctl unload -w /Library/LaunchDaemons/org.mythtv.mythbackend.plist" with administrator privileges
+            do shell script "sudo launchctl unload -w /Library/LaunchDaemons/org.mythtv.mythlogserver.plist" with administrator privileges
+            delay 4
+            -- there is a longish delay while myth closes down.
+        else
+            display alert " MythBackend appears not to have been started in the normal fashion.  Unable to shut down." message "Was mythbackend started directly from a command line session?" as warning
+        end if
+        --set myResult to "Close"
+        
+    else if myResult contains "Schedule log rotation" then
+        if (FileExists(MPprefix & "/etc/logrotate.conf") and \xC2
+            FileExists(MPprefix & "/etc/logrotate.d/logrotate.mythtv")) and \xC2
+            FileExists("/Library/LaunchDaemons/org.macports.logrotate.plist") then
+            do shell script "sudo launchctl load -w /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
+            delay 1
+        else
+            display dialog "logrotate is not configured.  Please see http://www.mythtv.org/wiki/MacPorts for instructions." buttons {"Close"}
+        end if
+    else if myResult contains "Disable log rotation" then
+        do shell script "sudo launchctl unload -w /Library/LaunchDaemons/org.macports.logrotate.plist" with administrator privileges
+        delay 1
+    end if
+end repeat
+
+on FileExists(theFile) -- (String) as Boolean
+    tell application "System Events" to return (exists file theFile)
+end FileExists

Added: trunk/dports/multimedia/mythtv-core.26/files/logrotate.conf
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/logrotate.conf	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/logrotate.conf	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,22 @@
+# ${prefix}/etc/logrotate.conf
+# 2012Sep11 Craig Treleaven
+# MacPorts logrotate port -- set up for MythTV
+#
+# see "man logrotate" for details
+# rotate log files weekly
+weekly
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# create new (empty) log files after rotating old ones
+create
+
+# use date as a suffix of the rotated file
+dateext
+
+# uncomment this if you want your log files compressed
+#compress
+
+# Drop log rotation information into this directory
+include @PREFIX@/etc/logrotate.d

Added: trunk/dports/multimedia/mythtv-core.26/files/logrotate.mythtv
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/logrotate.mythtv	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/logrotate.mythtv	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,45 @@
+# ${prefix}/etc/logrotate.d/logrotate.mythtv
+# 2012Sep20 Craig Treleaven
+# 2013Mar06 - update for 0.26
+# MacPorts logrotate port -- set up for MythTV
+#
+# based on http://www.mythtv.org/wiki/Logrotate_-_all_applications
+
+# Common settings
+su root admin
+missingok
+ifempty
+nocreate
+nocompress
+sharedscripts
+olddir @MYTHTVLOGDIR@/old
+
+
+# programs that may run for extended periods
+ at MYTHTVLOGDIR@/mythlogserver*.log @MYTHTVLOGDIR@/mythbackend*.log @MYTHTVLOGDIR@/mythfrontend*.log @MYTHTVLOGDIR@/mythjobqueue*.log @MYTHTVLOGDIR@/mythwelcome*.log @MYTHTVLOGDIR@/mythmediaserver*.log @MYTHTVLOGDIR@/mythlcdserver*.log {
+        weekly
+        rotate 8
+        lastaction
+                killall -HUP mythlogserver
+                find @MYTHTVLOGDIR@ -type f -mtime +20 -delete
+                find @MYTHTVLOGDIR@/old -type f -mtime +30 -delete
+        endscript
+}
+
+# tranient programs
+# these won't be running and writing to a log that needs rotating
+ at MYTHTVLOGDIR@/mythfilldatabase*.log @MYTHTVLOGDIR@/mythcommflag*.log @MYTHTVLOGDIR@/mythmetadatalookup*.log @MYTHTVLOGDIR@/mythtranscode*.log @MYTHTVLOGDIR@/mythtv-setup*.log @MYTHTVLOGDIR@/mythutil*.log {
+        weekly
+        rotate 0
+}
+
+# VERY transient
+# many, many previews
+ at MYTHTVLOGDIR@/mythpreviewgen*.log {
+        daily
+        rotate 0
+        lastaction
+                find @MYTHTVLOGDIR@ -name 'mythpreviewgen*' -type f -mtime +6 -delete
+                find @MYTHTVLOGDIR@/old -name 'mythpreviewgen*' -type f -mtime +6 -delete
+        endscript
+}

Added: trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythbackend.plist
===================================================================
(Binary files differ)


Property changes on: trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythbackend.plist
___________________________________________________________________
Added: svn:mime-type
   + application/xml

Added: trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythlogserver.plist
===================================================================
(Binary files differ)


Property changes on: trunk/dports/multimedia/mythtv-core.26/files/org.mythtv.mythlogserver.plist
___________________________________________________________________
Added: svn:mime-type
   + application/xml

Added: trunk/dports/multimedia/mythtv-core.26/files/patch-bonjour-correction.diff
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/patch-bonjour-correction.diff	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/patch-bonjour-correction.diff	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,32 @@
+From 8929314e77dfc5fe9bcc58f4ace4e7ba6fea9bef Mon Sep 17 00:00:00 2001
+From: George Nassas <george at nassas.com>
+Date: Tue, 29 May 2012 10:11:38 -0400
+Subject: [PATCH] make backend's bonjour service name dns-compliant
+
+---
+ mythtv/programs/mythbackend/mediaserver.cpp |    7 ++-----
+ 1 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/mythtv/programs/mythbackend/mediaserver.cpp b/mythtv/programs/mythbackend/mediaserver.cpp
+index 043140d..19d0eb9 100644
+--- mythtv/programs/mythbackend/mediaserver.cpp
++++ mythtv/programs/mythbackend/mediaserver.cpp
+@@ -256,13 +256,10 @@ void MediaServer::Init(bool bIsMaster, bool bDisableUPnp /* = false */)
+         m_bonjour = new BonjourRegister();
+         if (m_bonjour)
+         {
+-            QByteArray dummy;
+             QByteArray name("Mythbackend on ");
+             name.append(gCoreContext->GetHostName());
+-            m_bonjour->Register(nPort,
+-                                bIsMaster ? "_mythbackend-master._tcp" :
+-                                            "_mythbackend-slave._tcp",
+-                                name, dummy);
++            QByteArray txt(bIsMaster ? "\x0Clevel=master" : "\x0Blevel=slave");
++            m_bonjour->Register(nPort, "_mythbackend._tcp", name, txt);
+         }
+ #endif
+     }
+-- 
+1.7.2.5
+

Added: trunk/dports/multimedia/mythtv-core.26/files/patch-configure-configincludepath.diff
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/patch-configure-configincludepath.diff	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/patch-configure-configincludepath.diff	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,20 @@
+--- mythtv/configure.orig	2013-03-08 09:53:10.000000000 -0500
++++ mythtv/configure	2013-03-08 09:53:42.000000000 -0500
+@@ -2554,7 +2554,7 @@
+ ranlib="${cross_prefix}${ranlib}"
+ strip_default="${cross_prefix}${strip_default}"
+ 
+-sysinclude_default="${sysroot}/usr/include"
++#sysinclude_default="${sysroot}/usr/include"
+ 
+ set_default cc cxx nm pkg_config strip sysinclude qmake python yasmexe
+ enabled cross_compile || host_cc_default=$cc
+@@ -3609,7 +3609,7 @@
+ 
+ set_default $PATHS_LIST
+ 
+-append CONFIG_INCLUDEPATH $sysinclude "${sysroot}${prefix}"
++#append CONFIG_INCLUDEPATH $sysinclude "${sysroot}${prefix}"
+ 
+ append CCONFIG "$compile_type"
+ if test x$compile_type = x"profile" ; then

Added: trunk/dports/multimedia/mythtv-core.26/files/patch-mythtv_settings.pro.diff
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/patch-mythtv_settings.pro.diff	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/patch-mythtv_settings.pro.diff	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,13 @@
+--- mythtv/settings.pro.orig	2013-03-24 14:29:50.000000000 -0400
++++ mythtv/settings.pro	2013-03-24 14:30:06.000000000 -0400
+@@ -110,8 +110,8 @@
+ macx: QMAKE_CFLAGS_STATIC_LIB += -fno-common
+ 
+ # figure out compile flags based on qmake info
+-QMAKE_CFLAGS   += $$CPPFLAGS   $$CFLAGS
+-QMAKE_CXXFLAGS += $$CXXPPFLAGS $$ECXXFLAGS
++QMAKE_CFLAGS   = $$CPPFLAGS   $$CFLAGS
++QMAKE_CXXFLAGS = $$CXXPPFLAGS $$ECXXFLAGS
+ 
+ profile:CONFIG += debug
+ 

Added: trunk/dports/multimedia/mythtv-core.26/files/patch-protect-metadata-loads-from-multiple-threads.diff
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/patch-protect-metadata-loads-from-multiple-threads.diff	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/patch-protect-metadata-loads-from-multiple-threads.diff	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,52 @@
+From b20171597097f8b933065ef3291c63194d310fbf Mon Sep 17 00:00:00 2001
+From: George Nassas <george at nassas.com>
+Date: Sun, 10 Jun 2012 13:36:42 -0400
+Subject: [PATCH] protect metadata loads from multiple threads
+
+---
+ mythtv/libs/libmythmetadata/dbaccess.cpp |    9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/mythtv/libs/libmythmetadata/dbaccess.cpp b/mythtv/libs/libmythmetadata/dbaccess.cpp
+index 67cd904..46adb7a 100644
+--- mythtv/libs/libmythmetadata/dbaccess.cpp
++++ mythtv/libs/libmythmetadata/dbaccess.cpp
+@@ -47,8 +47,11 @@ class SingleValueImp
+ 
+     virtual ~SingleValueImp() {}
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+@@ -271,8 +274,11 @@ class MultiValueImp
+                 .arg(m_value_name).arg(m_table_name).arg(m_id_name);
+     }
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+@@ -730,8 +736,11 @@ class FileAssociationsImp
+         }
+     }
+ 
++    mutable QMutex mutex;
++
+     void load_data()
+     {
++        QMutexLocker locker(&mutex);
+         if (!m_ready)
+         {
+             fill_from_db();
+-- 
+1.7.2.5
+

Added: trunk/dports/multimedia/mythtv-core.26/files/patch-restore-fe-netcontrol-play-resume-functionality.diff
===================================================================
--- trunk/dports/multimedia/mythtv-core.26/files/patch-restore-fe-netcontrol-play-resume-functionality.diff	                        (rev 0)
+++ trunk/dports/multimedia/mythtv-core.26/files/patch-restore-fe-netcontrol-play-resume-functionality.diff	2013-07-26 16:37:12 UTC (rev 108562)
@@ -0,0 +1,27 @@
+From 2fb4b7bb111d7ec256f0b0f96c7271bcc0f61766 Mon Sep 17 00:00:00 2001
+From: George Nassas <george at nassas.com>
+Date: Fri, 24 Aug 2012 00:17:08 -0400
+Subject: [PATCH 4/4] restore fe netcontrol play/resume functionality
+
+---
+ mythtv/programs/mythfrontend/playbackbox.cpp |    4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/mythtv/programs/mythfrontend/playbackbox.cpp b/mythtv/programs/mythfrontend/playbackbox.cpp
+index 734cce1..44bb343 100644
+--- mythtv/programs/mythfrontend/playbackbox.cpp
++++ mythtv/programs/mythfrontend/playbackbox.cpp
+@@ -3723,7 +3723,9 @@ void PlaybackBox::processNetworkControlCommand(const QString &command)
+ 
+                 pginfo.SetPathname(pginfo.GetPlaybackURL());
+ 
+-                PlayX(pginfo, true, true);
++		bool ignoreBookmark = tokens[1] == "PLAY";
++
++                PlayX(pginfo, ignoreBookmark, true);
+             }
+             else
+             {
+-- 
+1.7.2.5
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130726/97269580/attachment-0001.html>


More information about the macports-changes mailing list