2005-05-10 04:16:53 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
#
|
2005-05-14 05:55:07 +00:00
|
|
|
# Required variables
|
2005-05-27 01:12:29 +00:00
|
|
|
#
|
2005-05-27 04:52:42 +00:00
|
|
|
version := 2.6.11
|
|
|
|
abiname := 1
|
2005-05-28 20:15:14 +00:00
|
|
|
ltver := 5
|
2005-05-10 04:16:53 +00:00
|
|
|
#
|
|
|
|
# Generally nothing needs to be modified below this line
|
|
|
|
#
|
2005-05-27 04:52:42 +00:00
|
|
|
SHELL := sh -e
|
|
|
|
controls := $(wildcard debian/arch/*/control.in debian/arch/*/*/control.in)
|
|
|
|
karch := $(shell dpkg-architecture -qDEB_HOST_ARCH)
|
|
|
|
major := $(basename $(version))
|
|
|
|
srcver := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
|
2005-05-28 20:15:14 +00:00
|
|
|
release := $(version)-$(ltver)
|
2005-05-27 04:52:42 +00:00
|
|
|
#
|
|
|
|
# Construct depends and provides for the linux-tree
|
|
|
|
#
|
|
|
|
lt_depends += $(shell seq -f 'linux-source-$(version) (= $(version)-%g)' \
|
2005-05-28 20:15:14 +00:00
|
|
|
-s ' | ' 1 $(ltver))
|
|
|
|
lt_provides := $(shell seq -f 'linux-tree-$(version)-%g' -s ', ' 1 $(ltver))
|
2005-05-14 05:55:07 +00:00
|
|
|
#
|
2005-05-19 00:16:36 +00:00
|
|
|
# If we are not passed a subarchs variable, we obtain the complete
|
|
|
|
# subarch list as a list of subdirectories in arch/$(karch). We
|
|
|
|
# also export the flavours variables, which allows to control which
|
|
|
|
# flavours are built.
|
2005-05-18 03:40:09 +00:00
|
|
|
#
|
|
|
|
ifndef subarchs
|
2005-05-26 01:53:38 +00:00
|
|
|
subarchs := $(shell find debian/arch/$(karch) \
|
2005-05-18 03:40:09 +00:00
|
|
|
-type d -mindepth 1 -maxdepth 1 \
|
2005-05-21 01:32:51 +00:00
|
|
|
! -name '.svn' ! -name 'patches' \
|
|
|
|
-printf '%f\n')
|
2005-05-18 03:40:09 +00:00
|
|
|
endif
|
2005-05-19 00:16:36 +00:00
|
|
|
ifeq (,$(subarchs))
|
2005-05-18 03:40:09 +00:00
|
|
|
subarchs := none
|
|
|
|
endif
|
2005-05-11 02:05:18 +00:00
|
|
|
|
2005-05-28 20:15:14 +00:00
|
|
|
export version abiname ltver kbuildver flavours
|
2005-05-19 00:16:36 +00:00
|
|
|
|
2005-05-28 20:15:14 +00:00
|
|
|
patch: debian/patch-stamp
|
|
|
|
debian/patch-stamp: debian/bin/apply
|
|
|
|
override_version=$(release) home=debian/patches debian/bin/apply
|
|
|
|
touch debian/patch-stamp
|
|
|
|
|
|
|
|
unpatch:
|
2005-05-28 20:18:48 +00:00
|
|
|
if [ -e debian/patch-stamp ]; then \
|
|
|
|
override_version=$(release) home=debian/patches \
|
|
|
|
debian/bin/apply $(version); \
|
|
|
|
rm -f debian/patch-stamp; \
|
2005-05-28 20:15:14 +00:00
|
|
|
fi
|
2005-05-27 04:52:42 +00:00
|
|
|
|
|
|
|
unpack: debian/linux-source-$(version).tar.bz2 unpack-stamp
|
2005-05-19 00:16:36 +00:00
|
|
|
unpack-stamp:
|
|
|
|
dh_testdir
|
|
|
|
for i in $(subarchs); do \
|
2005-05-27 04:52:42 +00:00
|
|
|
cd debian; \
|
|
|
|
$(MAKE) -f Makefile.subarch subarch=$${i} unpack; \
|
2005-05-11 02:05:18 +00:00
|
|
|
done
|
2005-05-26 01:53:38 +00:00
|
|
|
ln -s $$(command -v touch) debian/bin/touch.orig
|
2005-05-12 05:58:57 +00:00
|
|
|
touch unpack-stamp
|
2005-05-19 00:16:36 +00:00
|
|
|
|
2005-05-12 05:58:57 +00:00
|
|
|
build: build-stamp
|
|
|
|
build-stamp: unpack-stamp
|
|
|
|
dh_testdir
|
2005-05-19 00:16:36 +00:00
|
|
|
for i in $(subarchs); do \
|
2005-05-27 04:52:42 +00:00
|
|
|
cd debian; \
|
|
|
|
$(MAKE) -f Makefile.subarch subarch=$${i} build; \
|
2005-05-12 05:58:57 +00:00
|
|
|
done
|
|
|
|
touch build-stamp
|
2005-05-10 04:16:53 +00:00
|
|
|
|
2005-05-11 02:05:18 +00:00
|
|
|
clean:
|
2005-05-15 05:30:44 +00:00
|
|
|
dh_testdir
|
2005-05-26 01:53:38 +00:00
|
|
|
cd debian; \
|
|
|
|
rm -f *-stamp-* *-stamp config.*; \
|
|
|
|
rm -f header-install-* post-install-* bin/touch.orig; \
|
|
|
|
rm -rf kernel-source-* build-* install-*
|
2005-05-11 02:05:18 +00:00
|
|
|
dh_clean
|
2005-05-19 00:16:36 +00:00
|
|
|
|
2005-05-14 05:55:07 +00:00
|
|
|
binary-indep: build
|
|
|
|
binary-arch: build
|
|
|
|
dh_testdir
|
2005-05-19 00:16:36 +00:00
|
|
|
for i in $(subarchs); do \
|
2005-05-27 04:52:42 +00:00
|
|
|
cd debian; \
|
|
|
|
$(MAKE) -f Makefile.subarch subarch=$${i} binary; \
|
2005-05-14 05:55:07 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
binary: binary-indep binary-arch
|
|
|
|
|
2005-05-11 02:05:18 +00:00
|
|
|
#
|
2005-05-27 04:52:42 +00:00
|
|
|
# Makes the master debian/control file by substituting
|
|
|
|
# variable values into the template.
|
2005-05-11 02:05:18 +00:00
|
|
|
#
|
2005-05-27 04:52:42 +00:00
|
|
|
debian/control: debian/templates/control.main.in
|
|
|
|
cat debian/templates/control.main.in | \
|
|
|
|
sed -e 's/@version@/$(version)/g' \
|
|
|
|
-e 's/@major@/$(major)/g' \
|
2005-05-28 20:15:14 +00:00
|
|
|
-e 's/@ltver@/$(ltver)/g' \
|
2005-05-27 04:52:42 +00:00
|
|
|
-e 's/@srcver@/$(srcver)/g' \
|
|
|
|
-e 's/@lt_depends@/$(lt_depends)/g' \
|
|
|
|
-e 's/@lt_provides@/$(lt_provides)/g' \
|
|
|
|
-e 's/@abiname@/$(abiname)/g' | \
|
|
|
|
sed '/^[[:space:]]*$$/d' | \
|
2005-05-11 02:05:18 +00:00
|
|
|
sed 's/^Package:/\n&/g' > debian/control
|
2005-05-27 04:52:42 +00:00
|
|
|
#
|
|
|
|
# If we ended up here, either we need to perform the linux-source
|
|
|
|
# build, or use the existing linux-source to unpack the kernels.
|
|
|
|
# This can be controlled by the use_existing_source variable.
|
|
|
|
#
|
|
|
|
debian/linux-source-$(version).tar.bz2: debian/Makefile.source
|
|
|
|
dh_testdir
|
|
|
|
if [ '$(use_existing_source)' = 'yes' ]; then \
|
|
|
|
ln -s /usr/src/linux-source-$(version).tar.bz2 \
|
|
|
|
debian/linux-source-$(version).tar.bz2; \
|
|
|
|
else \
|
|
|
|
$(MAKE) -f debian/Makefile.source binary; \
|
|
|
|
fi
|
|
|
|
|
2005-05-28 20:15:14 +00:00
|
|
|
.PHONY: clean build unpack binary-indep binary-arch binary patch unpatch
|