]> www.vanbest.org Git - sasc-ng.git/commitdiff
Merge all into a single package debian/620-16
authorJan-Pascal van Best <janpascal@vanbest.org>
Wed, 21 Aug 2013 19:55:35 +0000 (21:55 +0200)
committerJan-Pascal van Best <janpascal@vanbest.org>
Thu, 22 Aug 2013 09:27:52 +0000 (11:27 +0200)
15 files changed:
.gitignore
debian/changelog
debian/control.flavor [deleted file]
debian/control.kernel [deleted file]
debian/control.source
debian/rules
debian/sasc-ng-common.install [deleted file]
debian/sasc-ng-common.sasc-ng.default [deleted file]
debian/sasc-ng-common.sasc-ng.init [deleted file]
debian/sasc-ng-common.sasc-ng.logrotate [deleted file]
debian/sasc-ng.default [new file with mode: 0755]
debian/sasc-ng.init [new file with mode: 0755]
debian/sasc-ng.install-flavor.in [new file with mode: 0644]
debian/sasc-ng.install.in
debian/sasc-ng.logrotate [new file with mode: 0644]

index 97e11226caa8b6f0952fd7b301bf52cc39b7d54d..174b80343d70f27a7431331bd48754d2e1698ac7 100644 (file)
@@ -1,4 +1,4 @@
 .*.swp
 debian/control
 debian/control.md5sum
-debian/sasc-ng-*-*.install
+debian/sasc-ng.install
index 768af3aeac5859a8208616cca4dd178b955de557..b0c75665f667930aaf31b9ccc66bcb551a5a9e8f 100644 (file)
@@ -1,3 +1,9 @@
+sasc-ng (620-16) unstable; urgency=low
+
+  * Merge all into a single Debian package
+
+ -- Jan-Pascal van Best <janpascal@vanbest.org>  Wed, 21 Aug 2013 21:56:33 +0200
+
 sasc-ng (620-15) unstable; urgency=low
 
   * Added kernel 3.8 again
diff --git a/debian/control.flavor b/debian/control.flavor
deleted file mode 100644 (file)
index df8007d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Package: sasc-ng-#KERNEL#-#FLAVOR#
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends},
- sasc-ng-common (=${source:Version}),
- sasc-ng-kernel-#KERNEL# (=${source:Version})
-#Provides: sasc-ng-daemon
-Description: softcam to help decode DVB streams
- sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
- and outputs through them.
- .
- This package contains the sasc-ng daemon and the dvbloopback
- kernel module for kernel #KERNEL#, optimised for #FLAVOR# cpus.
-
-Package: sasc-ng-#KERNEL#-#FLAVOR#-dbg
-Architecture: any
-Section: debug
-Priority: extra
-Depends:
-    sasc-ng-#KERNEL#-#FLAVOR# (= ${binary:Version}),
-    ${misc:Depends}
-Description: debugging symbols for sasc-ng
- sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
- and outputs through them.
- . 
- This package contains the debugging symbols for sasc-ng-#KERNEL#-#FLAVOR#.
-
diff --git a/debian/control.kernel b/debian/control.kernel
deleted file mode 100644 (file)
index 52e606f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Package: sasc-ng-kernel-#KERNEL#
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends},
- sasc-ng-common (=${source:Version}),
- linux-image-#KERNEL# (=#KERNEL_VERSION#)
-Description: softcam to help decode DVB streams (dvb-core module)
- sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
- and outputs through them.
- .
- This package contains a fixed kernel dvb-core module needed 
- for dvbloopback.
-
index fc1dc0f7fcea4b6e6700f3c6a7d06433e4a2a25b..0352a583a36a9ce863a2e87c74ef1c1a4e988f75 100644 (file)
@@ -6,12 +6,25 @@ Standards-Version: 3.9.4
 Build-Depends: debhelper (>= 8), libssl-dev (>= 1.0), gcc-4.6, g++-4.6,
  #LINUX_HEADERS#, #LINUX_SOURCES#
 
-Package: sasc-ng-common
-Architecture: all
-Depends: ${misc:Depends}
+Package: sasc-ng
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: #LINUX_KERNELS#
 Description: softcam to help decode DVB streams
  sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
  and outputs through them.
+
+Package: sasc-ng-dbg
+Architecture: any
+Section: debug
+Priority: extra
+Depends:
+    sasc-ng (= ${binary:Version}),
+    ${misc:Depends}
+Description: debugging symbols for sasc-ng
+ sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
+ and outputs through them.
  . 
- This package contains common files for the sasc-ng daemon
+ This package contains the debugging symbols for sasc-ng
 
+# linux-image-#KERNEL# (=#KERNEL_VERSION#)
index 8742dac041a689392ae293145580d484e9aa7ac3..7fb65c1cc86232c7432ba0ab2aec8906cfb8aece 100755 (executable)
@@ -54,12 +54,9 @@ build_sasc_%:
        cd contrib/sasc-ng; \
        make module CC=gcc-4.6 CXX=g++-4.6 BUILD_DIR=$${BUILD_DIR}; \
        make CC=gcc-4.6 CXX=g++-4.6 CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)"; \
-       mkdir -p $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/bin; \
-       mkdir -p $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/modules; \
-       mkdir -p $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/lib; \
-       install -m0755 sasc-ng $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/bin/; \
-       install -m0644 dvbloopback.ko $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/modules/dvbloopback_$$FLAVOR.ko; \
-       install -m0644 sc/PLUGINS/lib/* $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/lib/; \
+       mkdir -p $(CURDIR)/debian/tmp/install/$$KERNEL/$$FLAVOR; \
+       install -m0755 sasc-ng $(CURDIR)/debian/tmp/install/$$KERNEL/$$FLAVOR/; \
+       install -m0644 dvbloopback.ko $(CURDIR)/debian/tmp/install/$$KERNEL/$$FLAVOR/; \
        make module_clean; \
        make clean
 
@@ -106,16 +103,11 @@ override_dh_auto_build:
 
 override_dh_auto_install: build_kernel build_sasc
 
-dh_strip_%:
-       VERSION="$*"; \
-       FLAVOR=$${VERSION#*_}; \
-       KERNEL=$${VERSION/_$$FLAVOR/}; \
-       dh_strip -p sasc-ng-$$KERNEL-$$FLAVOR --dbg-package=sasc-ng-$$KERNEL-$$FLAVOR-dbg
-
 .PHONY: override_dh_strip
-override_dh_strip: $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),dh_strip_$(kernel)_$(flav))) 
+override_dh_strip:
+       dh_strip -p sasc-ng --dbg-package=sasc-ng-dbg
 
-CONTROL_FILES    = debian/control.source debian/control.flavor debian/control.kernel debian/rules debian/rules.defs debian/sasc-ng.install.in
+CONTROL_FILES    = debian/control.source debian/rules debian/rules.defs debian/sasc-ng.install.in debian/sasc-ng.install-flavor.in debian/sasc-ng.install-kernel.in
 comma            = ,
 
 debian/control: $(CONTROL_FILES)
@@ -128,38 +120,20 @@ endif
 
 LINUX_HEADERS    =$(foreach f,$(KERNELS),linux-headers-$(f) (=$(KERNEL_VERSION_$(f)))$(comma))
 LINUX_SOURCES    =$(foreach f,$(KERNELS),linux-source-$(call kernel_short_version,$(f)) (=$(KERNEL_VERSION_$(f)))$(comma))
-
-# call with $1 = kernel version, $2 = full kernel version, $3 = flavor
-define append-flavor-entries
-       sed \
-               -e 's/#KERNEL#/$1/g' \
-               -e 's/#KERNEL_VERSION#/$2/g' \
-               -e 's/#FLAVOR#/$3/g' \
-               debian/control.flavor >> debian/control.tmp
-
-endef
-
-# call with $1 = kernel version, $2 = full kernel version
-define append-kernel-entries
-       sed \
-               -e 's/#KERNEL#/$1/g' \
-               -e 's/#KERNEL_VERSION#/$2/g' \
-               debian/control.kernel >> debian/control.tmp
-
-endef
+LINUX_KERNELS    =$(foreach f,$(KERNELS),linux-image-$(call kernel_short_version,$(f)) (=$(KERNEL_VERSION_$(f)))$(comma))
 
 # call with $1 = kernel version, $2 = flavor
 define create-flavor-install
         sed -e 's/#KERNEL#/$1/g' \
             -e 's/#FLAVOR#/$2/g' \
-               debian/sasc-ng.install.in > debian/sasc-ng-$1-$2.install
+               debian/sasc-ng.install-flavor.in >> debian/sasc-ng.install.tmp
 
 endef
 
 # call with $1 = kernel version
 define create-kernel-install
         sed -e 's/#KERNEL#/$1/g' \
-               debian/sasc-ng.install-kernel.in > debian/sasc-ng-kernel-$1.install
+               debian/sasc-ng.install-kernel.in >> debian/sasc-ng.install.tmp
 
 endef
 
@@ -168,12 +142,13 @@ debian/control-real: $(CONTROL_FILES)
        sed \
                -e 's/#LINUX_HEADERS#/$(LINUX_HEADERS)/g' \
                -e 's/#LINUX_SOURCES#/$(LINUX_SOURCES)/g' \
+               -e 's/#LINUX_KERNELS#/$(LINUX_KERNELS)/g' \
                debian/control.source > debian/control.tmp
-       $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),$(call append-flavor-entries,$(kernel),$(KERNEL_VERSION_$(kernel)),$(flav))))
-       $(foreach kernel,$(KERNELS),$(call append-kernel-entries,$(kernel),$(KERNEL_VERSION_$(kernel))))
        mv debian/control.tmp debian/control
+       cat debian/sasc-ng.install.in >debian/sasc-ng.install.tmp
        $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),$(call create-flavor-install,$(kernel),$(flav))))
        $(foreach kernel,$(KERNELS),$(call create-kernel-install,$(kernel)))
+       mv debian/sasc-ng.install.tmp debian/sasc-ng.install
        md5sum debian/control $^ > debian/control.md5sum
        @echo
        @echo This target is made to fail intentionally, to make sure
diff --git a/debian/sasc-ng-common.install b/debian/sasc-ng-common.install
deleted file mode 100644 (file)
index 992e57f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-examples/cardclient.conf.example /etc/sasc-ng/
-examples/cardslot.conf.example   /etc/sasc-ng/ 
-examples/externalau.sh.example   /etc/sasc-ng/
-examples/override.conf.example   /etc/sasc-ng/
-examples/smartcard.conf.example  /etc/sasc-ng/
-examples/SoftCam.Key  /etc/sasc-ng/
-examples/Ird-Beta.KID /etc/sasc-ng/
-examples/Seca.KID     /etc/sasc-ng/
-examples/Viaccess.KID /etc/sasc-ng/
diff --git a/debian/sasc-ng-common.sasc-ng.default b/debian/sasc-ng-common.sasc-ng.default
deleted file mode 100755 (executable)
index d28a9b3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Default settings for sasc-ng. This file is sourced by /bin/sh from
-# /etc/init.d/sasc-ng-common.
-
-# Uncomment the following line when you've configured sasc-ng using
-# this file and the files in /etc/sasc-ng
-#CONFIGURED=yes
-
-PIDFILE=/var/run/$NAME.pid
-LOGFILE=/var/log/$NAME.log
-
-ADDITIONAL_DVBLOOPBACK_PARAMS="adapter_nr=1"
-
-NUM_LOOPBACK_ADAPTERS=1
-DAEMON_JOIN_ARGS="--join 0:1"
-DEBUG_MASK=0
-
-# Using a log file seems to cause segfaults, use syslog instead
-#DAEMON_ARGS="$DAEMON_JOIN_ARGS --cam-budget --cam-dir /etc/sasc-ng --sid-filt 12 --sid-allpid --sid-nocache --buffer 8M --sid-experimental --daemon --pidfile $PIDFILE --debug $DEBUG_MASK --log $LOGFILE"
-DAEMON_ARGS="$DAEMON_JOIN_ARGS --cam-budget --cam-dir /etc/sasc-ng --sid-filt 12 --sid-allpid --sid-nocache --buffer 8M --sid-experimental --daemon --pidfile $PIDFILE --debug $DEBUG_MASK"
diff --git a/debian/sasc-ng-common.sasc-ng.init b/debian/sasc-ng-common.sasc-ng.init
deleted file mode 100755 (executable)
index d4aba00..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-#! /bin/sh
-
-### BEGIN INIT INFO
-# Provides:          sasc-ng
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: sasc-ng DVB decryption loopback device
-### END INIT INFO
-
-# Author: Hein Rigolo <rigolo@gmail.com>
-#
-
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="sasc-ng"
-NAME=sasc-ng
-KERNEL=$( uname -r )
-FLAVOR="corei5"
-SASCNGDIR="/usr/lib/sasc-ng/$KERNEL-$FLAVOR"
-DAEMON="$SASCNGDIR/$NAME"
-SCRIPTNAME=/etc/init.d/$NAME
-MODULE="dvbloopback_$FLAVOR"
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Exit if the module is not available
-modprobe --dry-run --quiet $MODULE || {
-  echo "Error: dvbloopback module not found"
-  echo "Please install the sasc-ng-daemon package for your"
-  echo "current kernel"
-  exit 0
-}
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-if [ "$CONFIGURED" != "yes" ]; then
-  echo "Error: sasc-ng not configured, exiting"
-  echo "Please modify the files in /etc/sasc-ng and /etc/default/sasc-ng"
-  exit 0
-fi
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
-       modprobe $MODULE num_adapters=$NUM_LOOPBACK_ADAPTERS $ADDITIONAL_DVBLOOPBACK_PARAMS
-
-        # Return
-        #   0 if daemon has been started
-        #   1 if daemon was already running
-        #   2 if daemon could not be started
-        #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
-        #        || return 1
-        start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --test  \
-                || return 1
-        logrotate -f /etc/logrotate.d/sasc-ng
-        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
-                $DAEMON_ARGS >> $LOGFILE 2>&1 \
-                || return 2
-        # Add code here, if necessary, that waits for the process to be ready
-        # to handle requests from services started subsequently which depend
-        # on this one.  As a last resort, sleep for some time.
-}
-
-# 
-# Function that stops the daemon/service
-# 
-do_stop()
-{
-        # Return
-        #   0 if daemon has been stopped
-        #   1 if daemon was already stopped
-        #   2 if daemon could not be stopped
-        #   other if a failure occurred
-        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
-        RETVAL="$?"
-        [ "$RETVAL" = 2 ] && return 2
-        # Wait for children to finish too if this is a daemon that forks
-        # and if the daemon is only ever run from this initscript.
-        # If the above conditions are not satisfied then add some other code
-        # that waits for the process to drop all resources that could be
-        # needed by services started subsequently.  A last resort is to
-        # sleep for some time.
-        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
-        [ "$?" = 2 ] && return 2
-        # Many daemons don't delete their pidfiles when they exit.
-        rm -f $PIDFILE
-        return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
-        #
-        # If the daemon can reload its configuration without
-        # restarting (for example, when it is sent a SIGHUP),
-        # then implement that here.
-        #
-        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
-        return 0
-}
-
-case "$1" in
-  start)
-        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-        do_start
-        case "$?" in
-                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
-                2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
-        esac
-        ;;
-  stop)
-        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-        do_stop
-        case "$?" in
-                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
-                2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
-        esac
-        ;;
-  #reload|force-reload)
-        #
-        # If do_reload() is not implemented then leave this commented out
-        # and leave 'force-reload' as an alias for 'restart'.
-        #
-        #log_daemon_msg "Reloading $DESC" "$NAME"
-        #do_reload
-        #log_end_msg $?
-        #;;
-  restart|force-reload)
-        #
-        # If the "reload" option is implemented then remove the
-        # 'force-reload' alias
-        # 
-        log_daemon_msg "Restarting $DESC" "$NAME"
-        do_stop
-        case "$?" in
-          0|1)
-                do_start
-                case "$?" in
-                        0) log_end_msg 0 || true ;;
-                        1) log_end_msg 1 || true ;; # Old process is still running
-                        *) log_end_msg 1 || true ;; # Failed to start
-                esac
-                ;;
-          *)
-                # Failed to stop
-                log_end_msg 1
-                ;;
-        esac
-        ;;
-  *)
-        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
-        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
-        exit 3
-        ;;
-esac
-
diff --git a/debian/sasc-ng-common.sasc-ng.logrotate b/debian/sasc-ng-common.sasc-ng.logrotate
deleted file mode 100644 (file)
index 4bec968..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/var/log/sasc-ng.log {
-       daily
-       rotate 7
-       delaycompress
-       compress
-       missingok
-       postrotate 
-       # [ ! -f /var/run/sasc-ng.pid ] || kill -HUP `cat /var/run/sasc-ng.pid`
-       endscript
-}
diff --git a/debian/sasc-ng.default b/debian/sasc-ng.default
new file mode 100755 (executable)
index 0000000..d13807b
--- /dev/null
@@ -0,0 +1,23 @@
+# Default settings for sasc-ng. This file is sourced by /bin/sh from
+# /etc/init.d/sasc-ng-common.
+
+# Uncomment the following line when you've configured sasc-ng using
+# this file and the files in /etc/sasc-ng
+#CONFIGURED=yes
+
+PIDFILE=/var/run/$NAME.pid
+LOGFILE=/var/log/$NAME.log
+
+ADDITIONAL_DVBLOOPBACK_PARAMS="adapter_nr=1"
+
+NUM_LOOPBACK_ADAPTERS=1
+DAEMON_JOIN_ARGS="--join 0:1"
+DEBUG_MASK=0
+
+# FFDECSA flavor, choose from athlon64, atom, core2, corei5
+# See source code for cpu specification needed for each flavor
+FLAVOR="corei5"
+
+# Using a log file seems to cause segfaults, use syslog instead
+#DAEMON_ARGS="$DAEMON_JOIN_ARGS --cam-budget --cam-dir /etc/sasc-ng --sid-filt 12 --sid-allpid --sid-nocache --buffer 8M --sid-experimental --daemon --pidfile $PIDFILE --debug $DEBUG_MASK --log $LOGFILE"
+DAEMON_ARGS="$DAEMON_JOIN_ARGS --cam-budget --cam-dir /etc/sasc-ng --sid-filt 12 --sid-allpid --sid-nocache --buffer 8M --sid-experimental --daemon --pidfile $PIDFILE --debug $DEBUG_MASK"
diff --git a/debian/sasc-ng.init b/debian/sasc-ng.init
new file mode 100755 (executable)
index 0000000..870d4fd
--- /dev/null
@@ -0,0 +1,181 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides:          sasc-ng
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# X-Start-Before:    mythtv-backend
+# X-Stop-After:      mythtv-backend
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: sasc-ng DVB decryption loopback device
+### END INIT INFO
+
+# Author: Hein Rigolo <rigolo@gmail.com>
+#
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="sasc-ng"
+NAME=sasc-ng
+KERNEL=$( uname -r )
+FLAVOR="corei5"
+SASCNGDIR="/usr/lib/sasc-ng"
+
+DAEMON="$SASCNGDIR/$KERNEL/$FLAVOR/$NAME"
+SCRIPTNAME=/etc/init.d/$NAME
+MODULE="$SASCNGDIR/$KERNEL/$FLAVOR/dvbloopback.ko"
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+# Exit if the package is not configured
+if [ "$CONFIGURED" != "yes" ]; then
+  echo "Error: sasc-ng not configured, exiting"
+  echo "Please modify the files in /etc/sasc-ng and /etc/default/sasc-ng"
+  exit 0
+fi
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || {
+  echo "Error: could not find sasc-ng daemon $DAEMON"
+  echo "Make sure you're running a supported kernel and you've "
+  echo "selected the proper cpu type (FLAVOR) in /etc/default/sasc-ng"
+  exit 0
+}
+
+# Exit if the module is not available
+[ -r "$MODULE" ] || {
+  echo "Error: dvbloopback module not found"
+  echo "Make sure you're running a supported kernel and you've "
+  echo "selected the proper cpu type (FLAVOR) in /etc/default/sasc-ng"
+  exit 0
+}
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+       insmod $MODULE num_adapters=$NUM_LOOPBACK_ADAPTERS $ADDITIONAL_DVBLOOPBACK_PARAMS
+
+        # Return
+        #   0 if daemon has been started
+        #   1 if daemon was already running
+        #   2 if daemon could not be started
+        #start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
+        #        || return 1
+        start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --test  \
+                || return 1
+        logrotate -f /etc/logrotate.d/sasc-ng
+        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+                $DAEMON_ARGS >> $LOGFILE 2>&1 \
+                || return 2
+        # Add code here, if necessary, that waits for the process to be ready
+        # to handle requests from services started subsequently which depend
+        # on this one.  As a last resort, sleep for some time.
+}
+
+# 
+# Function that stops the daemon/service
+# 
+do_stop()
+{
+        # Return
+        #   0 if daemon has been stopped
+        #   1 if daemon was already stopped
+        #   2 if daemon could not be stopped
+        #   other if a failure occurred
+        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+        RETVAL="$?"
+        [ "$RETVAL" = 2 ] && return 2
+        # Wait for children to finish too if this is a daemon that forks
+        # and if the daemon is only ever run from this initscript.
+        # If the above conditions are not satisfied then add some other code
+        # that waits for the process to drop all resources that could be
+        # needed by services started subsequently.  A last resort is to
+        # sleep for some time.
+        start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+        [ "$?" = 2 ] && return 2
+        # Many daemons don't delete their pidfiles when they exit.
+        rm -f $PIDFILE
+        return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+        #
+        # If the daemon can reload its configuration without
+        # restarting (for example, when it is sent a SIGHUP),
+        # then implement that here.
+        #
+        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+        return 0
+}
+
+case "$1" in
+  start)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+        do_start
+        case "$?" in
+                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
+                2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
+        esac
+        ;;
+  stop)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+        do_stop
+        case "$?" in
+                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 || true ;;
+                2) [ "$VERBOSE" != no ] && log_end_msg 1 || true ;;
+        esac
+        ;;
+  #reload|force-reload)
+        #
+        # If do_reload() is not implemented then leave this commented out
+        # and leave 'force-reload' as an alias for 'restart'.
+        #
+        #log_daemon_msg "Reloading $DESC" "$NAME"
+        #do_reload
+        #log_end_msg $?
+        #;;
+  restart|force-reload)
+        #
+        # If the "reload" option is implemented then remove the
+        # 'force-reload' alias
+        # 
+        log_daemon_msg "Restarting $DESC" "$NAME"
+        do_stop
+        case "$?" in
+          0|1)
+                do_start
+                case "$?" in
+                        0) log_end_msg 0 || true ;;
+                        1) log_end_msg 1 || true ;; # Old process is still running
+                        *) log_end_msg 1 || true ;; # Failed to start
+                esac
+                ;;
+          *)
+                # Failed to stop
+                log_end_msg 1
+                ;;
+        esac
+        ;;
+  *)
+        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+        exit 3
+        ;;
+esac
+
diff --git a/debian/sasc-ng.install-flavor.in b/debian/sasc-ng.install-flavor.in
new file mode 100644 (file)
index 0000000..103c601
--- /dev/null
@@ -0,0 +1 @@
+debian/tmp/install/#KERNEL#/#FLAVOR#/* /usr/lib/sasc-ng/#KERNEL#/#FLAVOR#
index e14dd0fdb12aabf4678b2e10af21a37e94efb1c1..992e57f63d49a4e72011c22243557731b887dd54 100644 (file)
@@ -1,3 +1,9 @@
-debian/tmp/#KERNEL#-#FLAVOR#/bin/* /usr/lib/sasc-ng/#KERNEL#-#FLAVOR#/bin/
-debian/tmp/#KERNEL#-#FLAVOR#/modules/* /lib/modules/#KERNEL#/misc
-debian/tmp/#KERNEL#-#FLAVOR#/lib/* /usr/lib/sasc-ng/#KERNEL#-#FLAVOR#/lib/
+examples/cardclient.conf.example /etc/sasc-ng/
+examples/cardslot.conf.example   /etc/sasc-ng/ 
+examples/externalau.sh.example   /etc/sasc-ng/
+examples/override.conf.example   /etc/sasc-ng/
+examples/smartcard.conf.example  /etc/sasc-ng/
+examples/SoftCam.Key  /etc/sasc-ng/
+examples/Ird-Beta.KID /etc/sasc-ng/
+examples/Seca.KID     /etc/sasc-ng/
+examples/Viaccess.KID /etc/sasc-ng/
diff --git a/debian/sasc-ng.logrotate b/debian/sasc-ng.logrotate
new file mode 100644 (file)
index 0000000..4bec968
--- /dev/null
@@ -0,0 +1,10 @@
+/var/log/sasc-ng.log {
+       daily
+       rotate 7
+       delaycompress
+       compress
+       missingok
+       postrotate 
+       # [ ! -f /var/run/sasc-ng.pid ] || kill -HUP `cat /var/run/sasc-ng.pid`
+       endscript
+}