.*.swp
 debian/control
 debian/control.md5sum
-debian/sasc-ng-*.install
+debian/sasc-ng-*-*.install
 
+sasc-ng (620-14) unstable; urgency=low
+
+  * Allow simultaneous installation for multiple kernel versions
+
+ -- Jan-Pascal van Best <janpascal@vanbest.org>  Tue, 20 Aug 2013 23:41:01 +0200
+
 sasc-ng (620-13) unstable; urgency=low
 
   * Enable kernel 3.2 for Wheezy users
 
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends},
  sasc-ng-common (=${source:Version}),
- linux-image-#KERNEL# (=#KERNEL_VERSION#)
-Conflicts: sasc-ng-daemon
-Replaces: sasc-ng-daemon
+ 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 
 Depends:
     sasc-ng-#KERNEL#-#FLAVOR# (= ${binary:Version}),
     ${misc:Depends}
-Conflicts: sasc-ng-daemon-dbg
-Replaces: sasc-ng-daemon-dbg
-Provides: sasc-ng-daemon-dbg
 Description: debugging symbols for sasc-ng
  sasc-ng is a versatile SoftCAM which creates virtual DVB devices 
  and outputs through them.
 
--- /dev/null
+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.
+
 
        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; \
+       install -m0644 dvbloopback.ko $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/modules/dvbloopback_$$FLAVOR.ko; \
        install -m0644 sc/PLUGINS/lib/* $(CURDIR)/debian/tmp/$$KERNEL-$$FLAVOR/lib/; \
        make module_clean; \
        make clean
 .PHONY: override_dh_strip
 override_dh_strip: $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),dh_strip_$(kernel)_$(flav))) 
 
-CONTROL_FILES    = debian/control.source debian/control.flavor debian/rules debian/rules.defs debian/sasc-ng.install.in
+CONTROL_FILES    = debian/control.source debian/control.flavor debian/control.kernel debian/rules debian/rules.defs debian/sasc-ng.install.in
 comma            = ,
 
 debian/control: $(CONTROL_FILES)
 
 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
+
 # call with $1 = kernel version, $2 = flavor
 define create-flavor-install
         sed -e 's/#KERNEL#/$1/g' \
 
 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
+
+endef
+
 
 debian/control-real: $(CONTROL_FILES)
        sed \
                -e 's/#LINUX_SOURCES#/$(LINUX_SOURCES)/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
        $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),$(call create-flavor-install,$(kernel),$(flav))))
+       $(foreach kernel,$(KERNELS),$(call create-kernel-install,$(kernel)))
        md5sum debian/control $^ > debian/control.md5sum
        @echo
        @echo This target is made to fail intentionally, to make sure
 
--- /dev/null
+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/
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="sasc-ng"
 NAME=sasc-ng
-DAEMON=/usr/sbin/$NAME
+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 dvbloopback || {
+modprobe --dry-run --quiet $MODULE || {
   echo "Error: dvbloopback module not found"
   echo "Please install the sasc-ng-daemon package for your"
   echo "current kernel"
 #
 do_start()
 {
-       modprobe dvbloopback num_adapters=$NUM_LOOPBACK_ADAPTERS $ADDITIONAL_DVBLOOPBACK_PARAMS
+       modprobe $MODULE num_adapters=$NUM_LOOPBACK_ADAPTERS $ADDITIONAL_DVBLOOPBACK_PARAMS
 
         # Return
         #   0 if daemon has been started
 
--- /dev/null
+debian/tmp/#KERNEL#/module-updates/* /lib/modules/#KERNEL#/updates
 
-debian/tmp/#KERNEL#-#FLAVOR#/bin/* /usr/sbin/
+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/
-debian/tmp/#KERNEL#/module-updates/* /lib/modules/#KERNEL#/updates
-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/
+debian/tmp/#KERNEL#-#FLAVOR#/lib/* /usr/lib/sasc-ng/#KERNEL#-#FLAVOR#/lib/