[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#570611: ITP: mythtv -- A personal video recorder application



I did some more work on this package, fixing the things that were obvious issues on Debian:

Add init script
fix libtiff5-dev -> libtiff-dev build-dep issue
Fix nonexistent 'syslog' user in postinsts script of mythtv-common
Add -Wdeprecated-declarations so that mythtarchive plugin builds 
Add DEB_BUILD_OPTS noopt, nostrip support
Include a bit of extra info in README on getting started with mythtv-setup

The built packages are available at http://wookware.org/software/repo/pool/main/m/mythtv/
built for jessie

Attached is the diff against fixes/0.27 branch

I will test these and see if there are issues. 

Is there a more stable branch I should be working against, and if you
are happy with this stuff would it make sense to give me git access (or
do we have some kind of review process or some other place to ddiscuss
things than this bug?)

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
diff --git a/deb/debian/README.Debian b/deb/debian/README.Debian
index 8ad8bae..ebe0b72 100644
--- a/deb/debian/README.Debian
+++ b/deb/debian/README.Debian
@@ -1,11 +1,41 @@
 --------------------------
 MythTV for Debian & Ubuntu
 --------------------------
+
+This package is set up so that mythtv should be run as the mythtv
+user.  For a dedicated mythtv system, you may wish to set up your
+display manager (e.g., gdm) to automatically login as the mythtv user
+and start mythfrontend.
+
+
+How to use myth-setup
+---------------------
+
+In order to use mythtv you need to run myth-setup.
+
+First you need to stop the backend :
+ sudo invoke-rc.d mythtv-backend stop
+
+Then run myth-setup as user mythtv:
+ sudo -u mythtv mythtv-setup
+
+If this doesn't work, change the X server permission :
+ xhost +local
+ sudo -u mythtv mythtv-setup
+ xhost -local
+
+Start the backend:
+ sudo invoke-rc.d mythtv-backend start
+
+
+-------------------
+>Package uploading<
+-------------------
 The MythTV package is actually a giant source package that includes all of the
 work that upstream MythTV works on.  It's organized this way for maintainer 
 simplicity and to workaround some limitations within Launchpad.
 
-If it's decoupled into many individual packages, the maintainer will need to 
+As it is decoupled into many individual packages, the maintainer will need to 
 always make sure they're uploaded in sync.  This can mean 3-5 uploads each time 
 rather than a single one.
 
diff --git a/deb/debian/changelog.in b/deb/debian/changelog.in
index 2361f8a..80d0d87 100644
--- a/deb/debian/changelog.in
+++ b/deb/debian/changelog.in
@@ -1,3 +1,12 @@
+mythtv (2:0.27.0+fixes.20131209.f785255-0) unstable; urgency=low
+
+  [ Wookey ]
+  * libtiff instead of libtiff5 to avoid imlib2-dev conflict
+  * Add init script for sysvinit
+  * Use root instead of non-existent syslog user in -common install script
+
+ -- Wookey <wookey@debian.org>  Wed, 22 Jan 2014 00:38:01 +0000
+
 mythtv (2:0.27.0+fixes.20130919.5b917e8-0ubuntu1) saucy; urgency=low
 
   * Scripted Build from fixes git packaging [8e8fe6d]
diff --git a/deb/debian/control.in b/deb/debian/control.in
index 0fc27c6..a1d4f12 100644
--- a/deb/debian/control.in
+++ b/deb/debian/control.in
@@ -65,7 +65,8 @@ Build-Depends:  debhelper (>= 7.0.50~),
                 libsdl1.2-dev,
                 libfaad-dev | libfaad2-dev,
                 libexif-dev (>= 0.6.9-6),
-                libtiff5-dev | libtiff4-dev | libtiff-dev,
+                libexiv2-dev,
+                libtiff-dev | libtiff5-dev | libtiff4-dev,
                 libxv-dev,
                 libtag1-dev,
                 libvisual-0.4-dev,
diff --git a/deb/debian/mythtv-backend.configfiles b/deb/debian/mythtv-backend.configfiles
index 9b1f97b..6d02325 100644
--- a/deb/debian/mythtv-backend.configfiles
+++ b/deb/debian/mythtv-backend.configfiles
@@ -1,2 +1,4 @@
 /etc/logrotate.d/mythtv-backend
+/etc/default/mythtv-backend
+/etc/init.d/mythtv-backend 
 /etc/cron.daily/mythtv-backend
diff --git a/deb/debian/mythtv-backend.default b/deb/debian/mythtv-backend.default
new file mode 100644
index 0000000..be4fc5e
--- /dev/null
+++ b/deb/debian/mythtv-backend.default
@@ -0,0 +1,11 @@
+# User as which to run
+#USER=mythtv
+
+# Replace all arguments to mythtvbackend
+#ARGS=""
+
+# Append additional arguments
+#EXTRA_ARGS="--verbose"
+
+# Set priority
+#NICE=-10
diff --git a/deb/debian/mythtv-backend.init b/deb/debian/mythtv-backend.init
new file mode 100644
index 0000000..8a9d5d0
--- /dev/null
+++ b/deb/debian/mythtv-backend.init
@@ -0,0 +1,87 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          mythtv-backend
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Should-Start:      mysql
+# Should-Stop:       mysql
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# X-Interactive:     true
+# Short-Description: Start/Stop the MythTV server.
+### END INIT INFO
+
+if [ -f /etc/default/locale ]; then
+  . /etc/default/locale
+  export LANG
+fi
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/mythbackend
+NAME="mythbackend"
+DESC="MythTV server"
+
+test -x $DAEMON || exit 0
+
+. /lib/lsb/init-functions
+
+set -e
+
+USER=mythtv
+RUNDIR=/var/run/mythtv
+ARGS="--daemon --syslog local7 --pidfile $RUNDIR/$NAME.pid"
+EXTRA_ARGS=""
+NICE=0
+
+if [ -f /etc/default/mythtv-backend ]; then
+  . /etc/default/mythtv-backend
+fi
+
+ARGS="$ARGS $EXTRA_ARGS"
+
+mkdir -p $RUNDIR
+chown -R $USER $RUNDIR
+
+unset DISPLAY
+unset SESSION_MANAGER
+
+case "$1" in
+  start)
+	if test -e $RUNDIR/$NAME.pid ; then
+		echo "mythbackend already running, use restart instead."
+	else
+		echo -n "Starting $DESC: $NAME "
+		start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
+			--chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
+		echo "."
+	fi
+	;;
+  stop)
+	echo -n "Stopping $DESC: $NAME "
+	start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
+		--chuid $USER --exec $DAEMON -- $ARGS
+	test -e $RUNDIR/$NAME.pid && rm $RUNDIR/$NAME.pid
+	echo "."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: $NAME "
+	start-stop-daemon --stop --oknodo --retry 10 --pidfile $RUNDIR/$NAME.pid \
+                --chuid $USER --exec $DAEMON -- $ARGS
+	echo "."
+	start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
+                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
+	echo "."
+	;;
+  reload)
+  	start-stop-daemon --stop --oknodo --signal HUP --pidfile \
+  	$RUNDIR/$NAME.pid --chuid $USER --exec $DAEMON -- $ARGS
+  	echo "."
+  	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/deb/debian/mythtv-common.postinst b/deb/debian/mythtv-common.postinst
index 3f1a451..9cd7613 100644
--- a/deb/debian/mythtv-common.postinst
+++ b/deb/debian/mythtv-common.postinst
@@ -75,7 +75,7 @@ case "$1" in
 
     #fix rsyslog permissions
     if [ -d "/var/log/mythtv" ] && ! dpkg-statoverride --list "/var/log/mythtv" >/dev/null; then
-        chown syslog:adm -R /var/log/mythtv
+        chown root:adm -R /var/log/mythtv
         chmod 2755 /var/log/mythtv
     fi
 
diff --git a/deb/debian/rules b/deb/debian/rules
index b1239e1..68e55f2 100755
--- a/deb/debian/rules
+++ b/deb/debian/rules
@@ -12,7 +12,8 @@ include debian/mythtv.make
 MYTHTV_CONFIGURE_OPTS +=    --compile-type=profile \
 				--prefix=/usr \
 				--runprefix=/usr \
-                                --disable-mythlogserver \
+				--extra-cxxflags=-Wdeprecated-declarations \
+				--disable-mythlogserver \
 				--enable-crystalhd \
 				--enable-lirc \
 				--enable-audio-alsa \
@@ -58,6 +59,16 @@ ifeq "$(DEB_BUILD_ARCH)" "armhf"
 	MYTHPLUGINS_CONFIGURE_OPTS += --disable-opengl
 endif
 
+ifeq (nostrip,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	DEBUG_BUILD=1
+endif
+ifeq (noopt,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	DEBUG_BUILD=1
+endif
+ifdef DEBUG_BUILD
+	CONFIGURE_OPTS += --compile-type=debug
+endif
+
 #Use moar CPUs for jya
 PROCESSORS       ?= $(shell grep -ic ^processor /proc/cpuinfo)
 ifeq (0,$(PROCESSORS))

Reply to: