From 7d8a4f93e15f61418ea89666b57063111700dc7e Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verizon.net>
Date: Wed, 3 Aug 2011 22:49:59 +0000
Subject: mythexport: Upgrade to 2.2.3 -- needs testing

---
 abs/extra/mythexport/PKGBUILD                      | 38 ++++++++++---
 abs/extra/mythexport/mythexport-2.2.3-1.src.tar.gz |  1 +
 abs/extra/mythexport/mythexport.install            | 65 ++++++++++++++++++++++
 abs/extra/mythexport/mythexport.lighttpd.include   |  3 +
 4 files changed, 100 insertions(+), 7 deletions(-)
 create mode 120000 abs/extra/mythexport/mythexport-2.2.3-1.src.tar.gz
 create mode 100644 abs/extra/mythexport/mythexport.lighttpd.include

diff --git a/abs/extra/mythexport/PKGBUILD b/abs/extra/mythexport/PKGBUILD
index 3cd04f3..6fd3000 100644
--- a/abs/extra/mythexport/PKGBUILD
+++ b/abs/extra/mythexport/PKGBUILD
@@ -2,16 +2,40 @@
 # Maintainer: Cecil Watson<knoppmyth@gmail.com>
 
 pkgname=mythexport
-pkgver=2.0.71
-pkgrel=5
-pkgdesc="Script to export recordings for portable devices."
+pkgver=2.2.3
+pkgrel=1
+pkgdesc="Export MythTV recording to portable media players"
 arch=('i686' 'x86_64')
 license=('GPL3')
-depends=('atomicparsley' 'perl-config-simple' 'perl-net-upnp' 'perl-proc-daemon' 'perl-proc-pid-file')
-url="http://linhes.org/"
-source=(ftp://ftp.knoppmyth.net/R6/sources/mythexport.tar.bz2)
+depends=('atomicparsley' 'perl-config-simple' 'perl-net-upnp'
+         'perl-proc-daemon' 'perl-proc-pid-file')
+optdepends=('lighttpd: For web based interaction')
+url="http://www.ubuntuupdates.org/mythexport"
+source=(https://launchpad.net/ubuntu/natty/+source/${pkgname}/${pkgver}-0ubuntu1/+files/${pkgname}_${pkgver}.orig.tar.gz
+        mythexport.lighttpd.include)
 install=mythexport.install
 
 build() {
-  cp -a mythexport/* $startdir/pkg
+
+  /bin/true
+
+}
+
+package() {
+  cd ${srcdir}/${pkgname}-${pkgver}
+  cp -a ./usr ${pkgdir}/ || return 1
+
+  # Install lighttpd include file
+  install -D -m644 ${srcdir}/mythexport.lighttpd.include ${pkgdir}/etc/mythexport/mythexport.lighttpd.include
+
+  # Compress man pages
+  gzip -9 *.1
+  install -D -m644 mythexport.1.gz ${pkgdir}/usr/share/man/man1/mythexport.1.gz || return 1
+  install -D -m644 mythimport.1.gz ${pkgdir}/usr/share/man/man1/mythimport.1.gz || return 1
+
+  # Standard GPL3 license text already in distro
+  rm -f ${pkgdir}/COPYING
+
 }
+md5sums=('a780c00536a4680ce7d79057658971c8'
+         'b08404255abcc99a35e9c1ab8e0dec57')
diff --git a/abs/extra/mythexport/mythexport-2.2.3-1.src.tar.gz b/abs/extra/mythexport/mythexport-2.2.3-1.src.tar.gz
new file mode 120000
index 0000000..3d55272
--- /dev/null
+++ b/abs/extra/mythexport/mythexport-2.2.3-1.src.tar.gz
@@ -0,0 +1 @@
+/data/pkg_repo/packages/mythexport-2.2.3-1.src.tar.gz
\ No newline at end of file
diff --git a/abs/extra/mythexport/mythexport.install b/abs/extra/mythexport/mythexport.install
index edd60f5..a6a2085 100644
--- a/abs/extra/mythexport/mythexport.install
+++ b/abs/extra/mythexport/mythexport.install
@@ -3,8 +3,73 @@ post_install() {
 	mysql -u root mythconverg < /usr/share/mythtv/mythexport.sql
 	ln -s /usr/share/mythtv/mythexport /data/srv/httpd/htdocs/
 	ln -s /myth/archive /usr/share/mythtv/mythexport/video
+
+  COUNT=`grep -c "include \"/etc/mythexport/mythexport.lighttpd.include\"" /etc/lighttpd/conf.include`
+
+  if [ $COUNT == 0 ] ; then
+    echo "==> Adding mythexport.lighttpd.include to conf.include"
+    echo "include \"/etc/mythexport/mythexport.lighttpd.include\"" >> \
+         /etc/lighttpd/conf.include
+  fi
+
+  echo ""
+  echo "==> Forcing a re-read of lighttpd's configuration file."
+  echo ""
+    /sbin/sv hup /service/lighttpd
+
+  echo ""
+  echo "==> Add the mythexport service to start the mythexport daemon"
+  echo "==> $ sudo add_service.sh mythexport"
+  echo ""
+
+  echo ""
+  echo "==> For move information on setup and configuration:"
+  echo "==> http://www.linhes.org/bugs/projects/linhes/wiki/HOWTO_Setup_MythExport_for_iPod"
+  echo ""
+
+}
+
+post_upgrade() {
+
+  COUNT=`grep -c "include \"/etc/mythexport/mythexport.lighttpd.include\"" /etc/lighttpd/conf.include`
+
+  if [ $COUNT == 0 ] ; then
+    echo "==> Adding mythexport.lighttpd.include to conf.include"
+    echo "include \"/etc/mythexport/mythexport.lighttpd.include\"" >> \
+         /etc/lighttpd/conf.include
+  fi
+
+  echo ""
+  echo "==> Forcing a re-read of lighttpd's configuration file."
+  echo ""
+    /sbin/sv hup /service/lighttpd
+
 }
 
+pre_remove() {
+
+  remove_service.sh mythexport
+
+}
+
+post_remove() {
+
+  COUNT=`grep -c "include \"/etc/mythexport/mythexport.lighttpd.include\"" /etc/lighttpd/conf.include`
+
+  if [ $COUNT -gt 0 ] ; then
+    echo "==> Removing mythexport.lighttpd.include from conf.include"
+    sed -e 's#include \"/etc/mythexport/mythexport.lighttpd.include\"##' -i \
+         /etc/lighttpd/conf.include
+  fi
+
+  echo ""
+  echo "==> Forcing re-read of lighttpd's configuration file."
+  echo ""
+    /sbin/sv hup /service/lighttpd
+}
+
+
+
 op=$1
 shift
 $op $*
diff --git a/abs/extra/mythexport/mythexport.lighttpd.include b/abs/extra/mythexport/mythexport.lighttpd.include
new file mode 100644
index 0000000..b846507
--- /dev/null
+++ b/abs/extra/mythexport/mythexport.lighttpd.include
@@ -0,0 +1,3 @@
+$HTTP["url"] =~ "/mythexport/" {
+        cgi.assign = ( ".cgi" => "/usr/bin/perl" )
+      }
-- 
cgit v0.12


From daf5a55912f10a1d4053e173f286eb2c59cea1dd Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verizon.net>
Date: Wed, 3 Aug 2011 22:50:37 +0000
Subject: runit-scripts: Add mythexport

---
 abs/core/runit-scripts/PKGBUILD                                |  2 +-
 abs/core/runit-scripts/runit-scripts-2.1.1-23.src.tar.gz       |  1 +
 abs/core/runit-scripts/runitscripts/services/mythexport/finish |  4 ++++
 abs/core/runit-scripts/runitscripts/services/mythexport/run    | 10 ++++++++++
 4 files changed, 16 insertions(+), 1 deletion(-)
 create mode 120000 abs/core/runit-scripts/runit-scripts-2.1.1-23.src.tar.gz
 create mode 100755 abs/core/runit-scripts/runitscripts/services/mythexport/finish
 create mode 100755 abs/core/runit-scripts/runitscripts/services/mythexport/run

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index f6cace4..aa7b767 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=2.1.1
-pkgrel=22
+pkgrel=23
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runit-scripts-2.1.1-23.src.tar.gz b/abs/core/runit-scripts/runit-scripts-2.1.1-23.src.tar.gz
new file mode 120000
index 0000000..0f2b2fa
--- /dev/null
+++ b/abs/core/runit-scripts/runit-scripts-2.1.1-23.src.tar.gz
@@ -0,0 +1 @@
+/data/pkg_repo/packages/runit-scripts-2.1.1-23.src.tar.gz
\ No newline at end of file
diff --git a/abs/core/runit-scripts/runitscripts/services/mythexport/finish b/abs/core/runit-scripts/runitscripts/services/mythexport/finish
new file mode 100755
index 0000000..b7fa7a6
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mythexport/finish
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# runit only knows about the run script wrapper, so kill the daemon ourselves
+  kill `pidof -o %PPID -x /usr/bin/mythexport-daemon` >/dev/null 2>&1
diff --git a/abs/core/runit-scripts/runitscripts/services/mythexport/run b/abs/core/runit-scripts/runitscripts/services/mythexport/run
new file mode 100755
index 0000000..45f77fd
--- /dev/null
+++ b/abs/core/runit-scripts/runitscripts/services/mythexport/run
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+/sbin/chpst -u mythtv /usr/bin/mythexport-daemon
+
+PID=`pidof -o %PPID -x /usr/bin/mythexport-daemon`
+
+# Wait until daemon dies, else runit can't supervise us
+  while [ "`pidof -o %PPID -x /usr/bin/mythexport-daemon`" == "$PID" ]; do
+    sleep 2
+  done
-- 
cgit v0.12


From 7bb3e1c97f4c18c533abff00ad2da119aaa29a59 Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 3 Aug 2011 18:00:13 -0500
Subject: rrd_stats: Update index.html to match local-website. ref #17

---
 abs/extra/rrd_stats/PKGBUILD      |   4 ++--
 abs/extra/rrd_stats/rrd_stats.tgz | Bin 8444 -> 8944 bytes
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/abs/extra/rrd_stats/PKGBUILD b/abs/extra/rrd_stats/PKGBUILD
index 1f987e4..6df24f4 100644
--- a/abs/extra/rrd_stats/PKGBUILD
+++ b/abs/extra/rrd_stats/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=rrd_stats
 pkgver=1
-pkgrel=18
+pkgrel=19
 pkgdesc="graph system stats"
 arch=('i686' 'x86_64')
 url=""
@@ -18,4 +18,4 @@ build() {
   chown -R http:users $startdir/pkg/data/srv/httpd
   chmod -R 755 $startdir/pkg/data/srv/httpd
 }
-md5sums=('e3d5f7d56fd1a3f26af0226ddcc53bfa')
+md5sums=('4398623b9a8afb62743509e35c15b683')
diff --git a/abs/extra/rrd_stats/rrd_stats.tgz b/abs/extra/rrd_stats/rrd_stats.tgz
index 4f1f3f5..6532648 100644
Binary files a/abs/extra/rrd_stats/rrd_stats.tgz and b/abs/extra/rrd_stats/rrd_stats.tgz differ
-- 
cgit v0.12


From 6a332588e14116977841fba80c063c59011d0ea0 Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verizon.net>
Date: Wed, 3 Aug 2011 23:03:29 +0000
Subject: runit-scripts: change lighttpd to start with lighttpd-angel (To
 accept signals)

---
 abs/core/runit-scripts/PKGBUILD                           | 2 +-
 abs/core/runit-scripts/runit-scripts-2.1.1-24.src.tar.gz  | 1 +
 abs/core/runit-scripts/runitscripts/services/lighttpd/run | 7 ++++++-
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 120000 abs/core/runit-scripts/runit-scripts-2.1.1-24.src.tar.gz

diff --git a/abs/core/runit-scripts/PKGBUILD b/abs/core/runit-scripts/PKGBUILD
index aa7b767..e186f99 100755
--- a/abs/core/runit-scripts/PKGBUILD
+++ b/abs/core/runit-scripts/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=runit-scripts
 pkgver=2.1.1
-pkgrel=23
+pkgrel=24
 pkgdesc="collection of startup scripts for runit"
 url="http://smarden.org/runit/"
 license="BSD"
diff --git a/abs/core/runit-scripts/runit-scripts-2.1.1-24.src.tar.gz b/abs/core/runit-scripts/runit-scripts-2.1.1-24.src.tar.gz
new file mode 120000
index 0000000..46a0e4a
--- /dev/null
+++ b/abs/core/runit-scripts/runit-scripts-2.1.1-24.src.tar.gz
@@ -0,0 +1 @@
+/data/pkg_repo/packages/runit-scripts-2.1.1-24.src.tar.gz
\ No newline at end of file
diff --git a/abs/core/runit-scripts/runitscripts/services/lighttpd/run b/abs/core/runit-scripts/runitscripts/services/lighttpd/run
index 798690c..f9c574d 100755
--- a/abs/core/runit-scripts/runitscripts/services/lighttpd/run
+++ b/abs/core/runit-scripts/runitscripts/services/lighttpd/run
@@ -4,5 +4,10 @@ export TERM=linux
 . /etc/rc.d/functions
 stat_runit "Starting lighttpd"
 
+if [ ! -d /var/run/lighttpd ] ; then
+   mkdir -p /var/run/lighttpd
+   chown http /var/run/lighttpd
+fi
 
-exec /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
+# Using -angel to start lighttpd allows lighttpd to accept signals
+exec /usr/sbin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf
-- 
cgit v0.12


From 2ba0826ab4c85aa4caf1613cfdb77123935a16b4 Mon Sep 17 00:00:00 2001
From: Michael Hanson <hansonorders@verizon.net>
Date: Wed, 3 Aug 2011 23:10:38 +0000
Subject: tzdata: update to most recent

---
 abs/core/tzdata/PKGBUILD                  | 10 +++++-----
 abs/core/tzdata/tzdata-2011h-1.src.tar.gz |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)
 create mode 120000 abs/core/tzdata/tzdata-2011h-1.src.tar.gz

diff --git a/abs/core/tzdata/PKGBUILD b/abs/core/tzdata/PKGBUILD
index b09c6c6..17d0d3c 100644
--- a/abs/core/tzdata/PKGBUILD
+++ b/abs/core/tzdata/PKGBUILD
@@ -2,10 +2,10 @@
 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
 
 pkgname=tzdata
-pkgver=2011g
+pkgver=2011h
 pkgrel=1
 _tzcode=2011g
-_tzdata=2011g
+_tzdata=2011h
 pkgdesc="Sources for time zone and daylight saving time data"
 arch=('i686' 'x86_64')
 url="http://www.twinsun.com/tz/tz-link.htm"
@@ -17,9 +17,6 @@ options=('!emptydirs')
 source=(ftp://elsie.nci.nih.gov/pub/tzcode${_tzcode}.tar.gz \
         ftp://elsie.nci.nih.gov/pub/${pkgname}${_tzdata}.tar.gz \
         Makefile.patch)
-md5sums=('ecb564279b28c5b184421c525d997d6c'
-         'a068c27e7e426fdb12ab0c88506df20d'
-         'a64ed97d1fc03c66ee8612c0d9f40507')
 
 build() {
   cd ${srcdir}
@@ -43,3 +40,6 @@ package() {
 
   rm "${pkgdir}/usr/share/zoneinfo/localtime"
 }
+md5sums=('ecb564279b28c5b184421c525d997d6c'
+         '546d27b6c1e5e1097bd512651815017f'
+         'a64ed97d1fc03c66ee8612c0d9f40507')
diff --git a/abs/core/tzdata/tzdata-2011h-1.src.tar.gz b/abs/core/tzdata/tzdata-2011h-1.src.tar.gz
new file mode 120000
index 0000000..cbba652
--- /dev/null
+++ b/abs/core/tzdata/tzdata-2011h-1.src.tar.gz
@@ -0,0 +1 @@
+/data/pkg_repo/packages/tzdata-2011h-1.src.tar.gz
\ No newline at end of file
-- 
cgit v0.12

