~ubuntu-branches/ubuntu/lucid/linux-ports-meta/lucid-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/make -f
#
# debian/rules for kernel-source.
#
# GNU copyright 1997 to 1999 by Joey Hess.
# Copyright (c) 1999-2004 Herbert Xu <herbert@gondor.apana.org.au>
# Copyright (c) 2004 Jens Schmalzing <jensen@debian.org>
#

RELEASE_NAME=jaunty
META_VERSION=$(shell head -1 debian/changelog | sed 's/.*(\(.*\)).*/\1/')
KERNEL_VERSION=$(shell echo $(META_VERSION) | cut -d. -f1-3)
KERNEL_ABI=$(shell echo $(META_VERSION) | cut -d. -f4)
KERNEL_ABI_VERSION=$(KERNEL_VERSION)-$(KERNEL_ABI)

GENERIC_ia64=ia64
GENERIC_sparc=sparc64
# Since these can be 32-bit or 64-bit, there is no generic
GENERIC_powerpc=

GENERIC=$(value GENERIC_$(shell dpkg-architecture -qDEB_HOST_ARCH))
GENERIC_DEP=$(if $(GENERIC),$(GENERIC),)

control_files := debian/control.common $(shell LC_ALL=C ls -d debian/control.d/*)

SHELL := sh -e

build:
	dh_testdir

clean: debian/control
	dh_testdir
	dh_testroot
	dh_clean
	rm -rf linux-*

debian/control: $(control_files)
	rm -f debian/control.tmp
	for i in $^; do \
		sed 's/RELEASE_NAME/$(RELEASE_NAME)/g' $$i >> debian/control.tmp; \
		echo >> debian/control.tmp; \
	done
	rm -f $@
	mv debian/control.tmp $@

install: build
	dh_testdir
	dh_testroot
	dh_clean -k

gencontrol_flags = -Vkernel-version=$(KERNEL_VERSION)
gencontrol_flags += -Vkernel-abi-version=$(KERNEL_ABI_VERSION)
gencontrol_flags += -Vgeneric-depends=$(GENERIC_DEP)

# Build architecture-independent files here.
binary-indep: debian/control install
	dh_testdir
	dh_testroot

	dh_installdirs -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i -- $(gencontrol_flags)
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: debian/control install
	dh_testdir
	dh_testroot

	dh_installdirs -s
	dh_installdocs -s
	dh_installchangelogs -s
	dh_compress -s
	dh_fixperms -s
	dh_installdeb -s
	dh_gencontrol -s -- $(gencontrol_flags)
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary install