]> www.vanbest.org Git - sasc-ng.git/commitdiff
Trying to dynamically create control file
authorJan-Pascal van Best <janpascal@vanbest.org>
Fri, 25 Jan 2013 10:49:24 +0000 (11:49 +0100)
committerJan-Pascal van Best <janpascal@vanbest.org>
Fri, 25 Jan 2013 12:17:51 +0000 (13:17 +0100)
debian/control
debian/control.backup [new file with mode: 0644]
debian/control.flavor [new file with mode: 0644]
debian/control.md5sum [new file with mode: 0644]
debian/control.source [new file with mode: 0644]
debian/rules
debian/rules.defs [new file with mode: 0644]
debian/sasc-ng-3.2.0-4-amd64-sse2.install [new file with mode: 0644]
debian/sasc-ng-3.7-trunk-amd64-sse2.install.backup [new file with mode: 0644]
debian/sasc-ng.install.in [new file with mode: 0644]

index 872d6abcc66d0f0a56e6ce863aee0cec6293a706..8c281f55c5183e250eb84e79d60f88c91d0271c2 100644 (file)
@@ -3,12 +3,11 @@ Section: devel
 Priority: extra
 Maintainer: Jan-Pascal van Best <janpascal@vanbest.org>
 Standards-Version: 3.9.4
-#Build-Depends: debhelper (>= 5), ${kver:BuildDepends}
-Build-Depends: debhelper (>= 8)
+Build-Depends: debhelper (>= 8), linux-headers-3.7-trunk-amd64 (=3.7.1-1~experimental.2.sasc1), linux-headers-3.2.0-4-amd64 (=3.2.35-2),
 
 Package: sasc-ng-common
 Architecture: all
-Depends: ${misc:Depends}, sasc-ng-daemon (=${binary:Version})
+Depends: ${misc:Depends}, 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.
@@ -17,12 +16,31 @@ Description: softcam to help decode DVB streams
 
 Package: sasc-ng-3.7-trunk-amd64-sse2
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${kver:Depends},
- sasc-ng-common (=${binary:Version})
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ sasc-ng-common (=${binary:Version}),
+ linux-image-3.7-trunk-amd64 (=3.7.1-1~experimental.2.sasc1)
 Conflicts: sasc-ng-daemon
 Replaces: sasc-ng-daemon
 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 3.7-trunk-amd64.
+
+Package: sasc-ng-3.2.0-4-amd64-sse2
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ sasc-ng-common (=${binary:Version}),
+ linux-image-3.2.0-4-amd64 (=3.2.35-2)
+Conflicts: sasc-ng-daemon
+Replaces: sasc-ng-daemon
+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 3.2.0-4-amd64.
 
diff --git a/debian/control.backup b/debian/control.backup
new file mode 100644 (file)
index 0000000..fb48e71
--- /dev/null
@@ -0,0 +1,31 @@
+Source: sasc-ng
+Section: devel
+Priority: extra
+Maintainer: Jan-Pascal van Best <janpascal@vanbest.org>
+Standards-Version: 3.9.4
+#Build-Depends: debhelper (>= 5), ${kver:BuildDepends}
+Build-Depends: debhelper (>= 8)
+
+Package: sasc-ng-common
+Architecture: all
+Depends: ${misc:Depends}, 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 common files for the sasc-ng daemon
+
+Package: sasc-ng-3.7-trunk-amd64-sse2
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${kver:Depends},
+ sasc-ng-common (=${binary:Version})
+Conflicts: sasc-ng-daemon
+Replaces: sasc-ng-daemon
+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
+
diff --git a/debian/control.flavor b/debian/control.flavor
new file mode 100644 (file)
index 0000000..65c1bd0
--- /dev/null
@@ -0,0 +1,15 @@
+Package: sasc-ng-#KERNEL#-#FLAVOR#
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ sasc-ng-common (=${binary:Version}),
+ linux-image-#KERNEL# (=#KERNEL_VERSION#)
+Conflicts: sasc-ng-daemon
+Replaces: sasc-ng-daemon
+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#.
+
diff --git a/debian/control.md5sum b/debian/control.md5sum
new file mode 100644 (file)
index 0000000..fd2d2c8
--- /dev/null
@@ -0,0 +1,5 @@
+98e40a12c40e8d3088ca0f4457b4a198  debian/control
+4004570ed61be152549b6ddc265948aa  debian/control.source
+ef99cebba74aa8d065cd6af017ddb205  debian/control.flavor
+182b135392172e7230f4e370c5ac134a  debian/rules
+9ed618ee077b893024bcd140756b2754  debian/rules.defs
diff --git a/debian/control.source b/debian/control.source
new file mode 100644 (file)
index 0000000..4a82996
--- /dev/null
@@ -0,0 +1,16 @@
+Source: sasc-ng
+Section: devel
+Priority: extra
+Maintainer: Jan-Pascal van Best <janpascal@vanbest.org>
+Standards-Version: 3.9.4
+Build-Depends: debhelper (>= 8), #LINUX_HEADERS#
+
+Package: sasc-ng-common
+Architecture: all
+Depends: ${misc:Depends}, 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 common files for the sasc-ng daemon
+
index 4aee3b2db8ad81046b9ff22aff11a2e2866577e0..dcd379b826cc58f25b83e8ac1fb05867b6c3e25f 100755 (executable)
@@ -1,16 +1,18 @@
 #!/usr/bin/make -f
 
-kernel_name = "3.7-trunk-amd64"
-kernel_version = "3.7.1-1~experimental.2.sasc1"
+include debian/rules.defs
 
-DVB_DIR=/home/janpascal/src/tmp/linux/linux-3.7.1
+#kernel_name = "3.7-trunk-amd64"
+#kernel_version = "3.7.1-1~experimental.2.sasc1"
+
+#DVB_DIR=/home/janpascal/src/tmp/linux/linux-3.7.1
 
 PACKAGE = $(firstword $(shell dh_listpackages))
 TMP     = $(CURDIR)/debian/$(PACKAGE)
 
-SUBSTVARS = \
- -Vkver:Depends="linux-image-$(kernel_name) (=$(kernel_version))" \
- -Vkver:BuildDepends="linux-headers-$(kernel_name) (=$(kernel_version))"
+#SUBSTVARS = \
+# -Vkver:Depends="linux-image-$(kernel_name) (=$(kernel_version))" \
+# -Vkver:BuildDepends="linux-headers-$(kernel_name) (=$(kernel_version))"
 
 #SUBSTVARS = -Vkver:BuildDepends="foo (>= 2)"
 
@@ -39,3 +41,52 @@ override_dh_auto_install:
        #install -m0755 contrib/sasc-ng/sasc-ng $(TMP)/usr/bin/
        #install -m0644 contrib/sasc-ng/dvbloopback.ko $(TMP)/lib/modules/$(kernel_name)/misc
        #install -m0644 contrib/sasc-ng/sc/PLUGINS/lib/* $(TMP)/usr/lib/
+
+CONTROL_FILES    = debian/control.source debian/control.flavor debian/rules debian/rules.defs
+comma            = ,
+
+debian/control: $(CONTROL_FILES)
+ifeq ($(wildcard debian/control.md5sum),)
+       $(MAKE) -f debian/rules debian/control-real
+else
+       md5sum --check debian/control.md5sum --status || \
+               $(MAKE) -f debian/rules debian/control-real
+endif
+
+LINUX_HEADERS    =$(foreach f,$(KERNELS),linux-headers-$(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 = flavor
+define create-flavor-install
+        sed -e 's/#KERNEL#/$1/g' \
+               debian/sasc-ng.install.in > debian/sasc-ng-$1-$2.install
+
+endef
+
+debian/control-real: $(CONTROL_FILES)
+       sed \
+               -e 's/#LINUX_HEADERS#/$(LINUX_HEADERS)/g' \
+               debian/control.source > debian/control.tmp
+       $(foreach f,$(KERNELS),$(call append-flavor-entries,$(f),$(KERNEL_VERSION_$(f)),sse2))
+       #$(foreach f,$(KERNEL_FLAVORS_only_i386),$(call append-flavor-entries,$(KERNEL_VERSION),$(f),i386))
+       #$(foreach f,$(KERNEL_FLAVORS_only_amd64),$(call append-flavor-entries,$(KERNEL_VERSION),$(f),amd64))
+       mv debian/control.tmp debian/control
+       $(foreach kernel,$(KERNELS),$(foreach flav,$(FFDECSA_FLAVORS),$(call create-flavor-install,$(kernel),$(flav))))
+       md5sum debian/control $^ > debian/control.md5sum
+       @echo
+       @echo This target is made to fail intentionally, to make sure
+       @echo that it is NEVER run during the automated build. Please
+       @echo ignore the following error, the debian/control file has
+       @echo been generated SUCCESSFULLY.
+       @echo
+       exit 1
+
diff --git a/debian/rules.defs b/debian/rules.defs
new file mode 100644 (file)
index 0000000..7d29956
--- /dev/null
@@ -0,0 +1,16 @@
+KERNELS = 3.7-trunk-amd64 3.2.0-4-amd64
+KERNEL_VERSION_3.7-trunk-amd64 = 3.7.1-1~experimental.2.sasc1
+KERNEL_VERSION_3.2.0-4-amd64 = 3.2.35-2
+
+FFDECSA_FLAVORS          = sse2 #sse 
+
+# For the moment we just support amd64
+#KERNEL_FLAVORS_i386_$(DEFAULT)        += 486
+#KERNEL_FLAVORS_i386_$(DEFAULT)        += 686 686-bigmem amd64
+#KERNEL_FLAVORS_i386_$(OPENVZ) += openvz-686
+#KERNEL_FLAVORS_i386_$(VSERVER)        += vserver-686 vserver-686-bigmem
+#KERNEL_FLAVORS_i386_$(XEN)    += xen-686
+#KERNEL_FLAVORS_amd64_$(DEFAULT)       += amd64
+#KERNEL_FLAVORS_amd64_$(OPENVZ)        += openvz-amd64
+#KERNEL_FLAVORS_amd64_$(VSERVER)       += vserver-amd64
+#KERNEL_FLAVORS_amd64_$(XEN)   += xen-amd64
diff --git a/debian/sasc-ng-3.2.0-4-amd64-sse2.install b/debian/sasc-ng-3.2.0-4-amd64-sse2.install
new file mode 100644 (file)
index 0000000..671c60e
--- /dev/null
@@ -0,0 +1,3 @@
+contrib/sasc-ng/sasc-ng /usr/bin/
+contrib/sasc-ng/dvbloopback.ko /lib/modules/3.2.0-4-amd64/misc
+contrib/sasc-ng/sc/PLUGINS/lib/* /usr/lib/
diff --git a/debian/sasc-ng-3.7-trunk-amd64-sse2.install.backup b/debian/sasc-ng-3.7-trunk-amd64-sse2.install.backup
new file mode 100644 (file)
index 0000000..b2a3a61
--- /dev/null
@@ -0,0 +1,3 @@
+contrib/sasc-ng/sasc-ng /usr/bin/
+contrib/sasc-ng/dvbloopback.ko /lib/modules/3.7-trunk-amd64/misc
+contrib/sasc-ng/sc/PLUGINS/lib/* /usr/lib/
diff --git a/debian/sasc-ng.install.in b/debian/sasc-ng.install.in
new file mode 100644 (file)
index 0000000..66fe38d
--- /dev/null
@@ -0,0 +1,3 @@
+contrib/sasc-ng/sasc-ng /usr/bin/
+contrib/sasc-ng/dvbloopback.ko /lib/modules/#KERNEL#/misc
+contrib/sasc-ng/sc/PLUGINS/lib/* /usr/lib/