aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package/builddeb
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2015-09-02 05:57:24 -0400
committerMichal Marek <mmarek@suse.com>2015-09-04 05:25:03 -0400
commit3716001bcb7f5822382ac1f2f54226b87312cc6b (patch)
tree21ec20a68bf4d6787fc014dc2791c5fb5d19beae /scripts/package/builddeb
parent26803821463c4e76322559b3dfb0c6b0fcc8aee8 (diff)
deb-pkg: add source package
Make deb-pkg build both source and binary package like make rpm-pkg does. For people who only need binary kernel package, there is now bindeb-pkg target, same target also used to build the .deb files if built from the source package using dpkg-buildpackage. Generated source package will build the same kernel .config than what was available for make deb-pkg. The name of the source package can be set with KDEB_SOURCENAME enviroment variable. The source package is useful for GPL compliance, or for feeding to a automated debian package builder. Cc: Chris J Arges <chris.j.arges@canonical.com> Reviewed-by: maximilian attems <maks@stro.at> Reviewed-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts/package/builddeb')
-rwxr-xr-xscripts/package/builddeb38
1 files changed, 36 insertions, 2 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 0c18cfd93287..0cd46e129920 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -79,6 +79,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
79else 79else
80 packageversion=$version-$revision 80 packageversion=$version-$revision
81fi 81fi
82sourcename=$KDEB_SOURCENAME
82tmpdir="$objtree/debian/tmp" 83tmpdir="$objtree/debian/tmp"
83fwdir="$objtree/debian/fwtmp" 84fwdir="$objtree/debian/fwtmp"
84kernel_headers_dir="$objtree/debian/hdrtmp" 85kernel_headers_dir="$objtree/debian/hdrtmp"
@@ -238,7 +239,7 @@ fi
238 239
239# Generate a simple changelog template 240# Generate a simple changelog template
240cat <<EOF > debian/changelog 241cat <<EOF > debian/changelog
241linux-upstream ($packageversion) $distribution; urgency=low 242$sourcename ($packageversion) $distribution; urgency=low
242 243
243 * Custom built Linux kernel. 244 * Custom built Linux kernel.
244 245
@@ -265,12 +266,16 @@ On Debian GNU/Linux systems, the complete text of the GNU General Public
265License version 2 can be found in \`/usr/share/common-licenses/GPL-2'. 266License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
266EOF 267EOF
267 268
269
270build_depends="bc, kmod, cpio "
271
268# Generate a control file 272# Generate a control file
269cat <<EOF > debian/control 273cat <<EOF > debian/control
270Source: linux-upstream 274Source: $sourcename
271Section: kernel 275Section: kernel
272Priority: optional 276Priority: optional
273Maintainer: $maintainer 277Maintainer: $maintainer
278Build-Depends: $build_depends
274Standards-Version: 3.8.4 279Standards-Version: 3.8.4
275Homepage: http://www.kernel.org/ 280Homepage: http://www.kernel.org/
276EOF 281EOF
@@ -391,4 +396,33 @@ EOF
391 create_package "$dbg_packagename" "$dbg_dir" 396 create_package "$dbg_packagename" "$dbg_dir"
392fi 397fi
393 398
399if [ "x$1" = "xdeb-pkg" ]
400then
401 cat <<EOF > debian/rules
402#!/usr/bin/make -f
403
404build:
405 \$(MAKE)
406
407binary-arch:
408 \$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg
409
410clean:
411 rm -rf debian/*tmp
412 mv debian/ debian.backup # debian/ might be cleaned away
413 \$(MAKE) clean
414 mv debian.backup debian
415
416binary: binary-arch
417EOF
418 mv ${sourcename}.tar.gz ../${sourcename}_${version}.orig.tar.gz
419 tar caf ../${sourcename}_${packageversion}.debian.tar.gz debian/{copyright,rules,changelog,control}
420 dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
421 -b / ../${sourcename}_${version}.orig.tar.gz ../${sourcename}_${packageversion}.debian.tar.gz
422 mv ${sourcename}_${packageversion}*dsc ..
423 dpkg-genchanges > ../${sourcename}_${packageversion}_${debarch}.changes
424else
425 dpkg-genchanges -b > ../${sourcename}_${packageversion}_${debarch}.changes
426fi
427
394exit 0 428exit 0