1 deb_package = $(shell dpkg-parsechangelog | grep ^Source: | sed -e s,'^Source: ',,)
2 deb_version = $(shell dpkg-parsechangelog | grep ^Version: | sed -e s,'^Version: ',, -e 's,-.*,,')
3 revision = $(shell dpkg-parsechangelog | grep ^Version: | sed -e -e 's,.*-,,')
4 architecture = $(shell dpkg --print-architecture)
5 tar_dir = $(PACKAGE)-$(VERSION)
6 tar_gz = $(tar_dir).tar.gz
8 unpack_dir = $(pkg_deb_dir)/$(tar_dir)
9 orig_tar_gz = $(pkg_deb_dir)/$(PACKAGE)_$(VERSION).orig.tar.gz
10 pkg_deb_src = $(pkg_deb_dir)/$(PACKAGE)_$(VERSION)-$(revision)_source.changes
11 pkg_deb_bin = $(pkg_deb_dir)/$(PACKAGE)_$(VERSION)-$(revision)_$(architecture).changes
13 #deb_pkg_key = -kCB8C5858
22 cd $(unpack_dir) && dpkg-buildpackage -b $(deb_pkg_key)
25 cd $(unpack_dir) && dpkg-buildpackage -S $(deb_pkg_key)
27 $(unpack_dir): $(orig_tar_gz)
28 tar -zxf $(orig_tar_gz) -C $(pkg_deb_dir)
29 [ $(VERSION) = $(deb_version) ] || \
30 ( cd $(unpack_dir) && debchange -m -v $(VERSION)-1 New upstream release $(VERSION). )
31 # Remove requirements for preparing the release tarball
32 # from the Debian control file
33 sed -i -e '/^ autoconf/d' -e '/^ devscripts/d' $(unpack_dir)/debian/control
37 $(orig_tar_gz): $(tar_gz) debclean
39 [ $(PACKAGE) = $(deb_package) ]
40 ln -s ../$(tar_gz) $(orig_tar_gz)